chore(sdk): Add NodePrimitives::BlockHeader and NodePrimitives::BlockBody (#12647)

This commit is contained in:
Emilia Hane
2024-11-21 18:03:05 +01:00
committed by GitHub
parent 2c7b404c24
commit 2093d2bd9a
9 changed files with 68 additions and 31 deletions

View File

@ -39,10 +39,21 @@ reth-codecs = { workspace = true, features = ["test-utils"] }
rstest.workspace = true
[features]
default = ["reth-codec"]
default = ["std", "reth-codec"]
std = [
"reth-primitives-traits/std",
"reth-primitives/std",
"reth-node-types/std",
"reth-codecs/std",
"alloy-consensus/std",
"alloy-eips/std",
"alloy-primitives/std",
"serde/std",
]
reth-codec = [
"dep:reth-codecs",
"reth-primitives/reth-codec"
"reth-primitives/reth-codec",
"reth-primitives-traits/reth-codec",
]
serde = [
"dep:serde",

View File

@ -6,21 +6,25 @@
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
pub mod bedrock;
pub mod tx_type;
pub use tx_type::OpTxType;
use reth_node_types::NodePrimitives;
use reth_primitives::{Block, Receipt, TransactionSigned};
use alloy_consensus::Header;
use reth_node_types::FullNodePrimitives;
use reth_primitives::{Block, BlockBody, Receipt, TransactionSigned};
/// Optimism primitive types.
#[derive(Debug, Default, Clone, PartialEq, Eq)]
pub struct OpPrimitives;
impl NodePrimitives for OpPrimitives {
impl FullNodePrimitives for OpPrimitives {
type Block = Block;
type BlockHeader = Header;
type BlockBody = BlockBody;
type SignedTx = TransactionSigned;
type TxType = OpTxType;
type Receipt = Receipt;