tempo_primitives/
lib.rs

1//! Tempo primitive types
2
3#![cfg_attr(not(test), warn(unused_crate_dependencies))]
4#![cfg_attr(docsrs, feature(doc_cfg), allow(unexpected_cfgs))]
5
6pub use alloy_consensus::Header;
7use alloy_primitives::Log;
8use reth_ethereum_primitives::EthereumReceipt;
9use reth_primitives_traits::NodePrimitives;
10
11pub mod transaction;
12pub use transaction::{
13    AASigned, FEE_TOKEN_TX_TYPE_ID, MAX_WEBAUTHN_SIGNATURE_LENGTH, P256_SIGNATURE_LENGTH,
14    SECP256K1_SIGNATURE_LENGTH, SignatureType, TEMPO_GAS_PRICE_SCALING_FACTOR, TEMPO_TX_TYPE_ID,
15    TempoSignature, TempoTransaction, TempoTxEnvelope, TempoTxType, TxFeeToken,
16    derive_p256_address,
17};
18
19mod header;
20pub use header::TempoHeader;
21
22pub mod subblock;
23pub use subblock::{
24    RecoveredSubBlock, SignedSubBlock, SubBlock, SubBlockMetadata, SubBlockVersion,
25};
26
27/// Tempo block.
28pub type Block = alloy_consensus::Block<TempoTxEnvelope, TempoHeader>;
29
30/// Tempo block body.
31pub type BlockBody = alloy_consensus::BlockBody<TempoTxEnvelope, TempoHeader>;
32
33/// Tempo receipt.
34pub type TempoReceipt<L = Log> = EthereumReceipt<TempoTxType, L>;
35
36/// A [`NodePrimitives`] implementation for Tempo.
37#[derive(Debug, Clone, Default, Eq, PartialEq)]
38#[non_exhaustive]
39pub struct TempoPrimitives;
40
41impl NodePrimitives for TempoPrimitives {
42    type Block = Block;
43    type BlockHeader = TempoHeader;
44    type BlockBody = BlockBody;
45    type SignedTx = TempoTxEnvelope;
46    type Receipt = TempoReceipt;
47}