reth_ethereum_primitives/
lib.rs

1//! Standalone crate for ethereum-specific Reth primitive types.
2
3#![doc(
4    html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
5    html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
6    issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
7)]
8#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
9#![cfg_attr(not(feature = "std"), no_std)]
10
11extern crate alloc;
12
13mod receipt;
14pub use receipt::*;
15
16mod transaction;
17pub use transaction::*;
18
19#[cfg(feature = "alloy-compat")]
20mod alloy_compat;
21
22/// Bincode-compatible serde implementations.
23#[cfg(feature = "serde-bincode-compat")]
24pub mod serde_bincode_compat {
25    pub use super::receipt::serde_bincode_compat::*;
26}
27
28/// Type alias for the ethereum block
29pub type Block = alloy_consensus::Block<TransactionSigned>;
30
31/// Type alias for the ethereum blockbody
32pub type BlockBody = alloy_consensus::BlockBody<TransactionSigned>;
33
34/// Helper struct that specifies the ethereum
35/// [`NodePrimitives`](reth_primitives_traits::NodePrimitives) types.
36#[derive(Debug, Clone, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
37#[non_exhaustive]
38pub struct EthPrimitives;
39
40impl reth_primitives_traits::NodePrimitives for EthPrimitives {
41    type Block = crate::Block;
42    type BlockHeader = alloy_consensus::Header;
43    type BlockBody = crate::BlockBody;
44    type SignedTx = crate::TransactionSigned;
45    type Receipt = crate::Receipt;
46}