Skip to main content

tempo_primitives/
lib.rs

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