diff --git a/crates/primitives-traits/src/block/body.rs b/crates/primitives-traits/src/block/body.rs index 13fdb201f58c..2063799dc5da 100644 --- a/crates/primitives-traits/src/block/body.rs +++ b/crates/primitives-traits/src/block/body.rs @@ -1,6 +1,6 @@ //! Block body abstraction. -use alloc::fmt; +use alloc::{fmt, vec::Vec}; use alloy_eips::{eip4895::Withdrawal, eip7685::Requests}; use alloy_primitives::{Address, B256}; diff --git a/crates/primitives-traits/src/block/mod.rs b/crates/primitives-traits/src/block/mod.rs index 46a99089c27e..9006d5251a00 100644 --- a/crates/primitives-traits/src/block/mod.rs +++ b/crates/primitives-traits/src/block/mod.rs @@ -3,7 +3,7 @@ pub mod body; pub mod header; -use alloc::fmt; +use alloc::{fmt, vec::Vec}; use alloy_consensus::BlockHeader as _; use alloy_eips::eip7685::Requests; @@ -65,94 +65,117 @@ pub trait Block: } impl Header for T { + #[inline] fn parent_hash(&self) -> B256 { self.header().parent_hash() } + #[inline] fn ommers_hash(&self) -> B256 { self.header().ommers_hash() } + #[inline] fn beneficiary(&self) -> Address { self.header().beneficiary() } + #[inline] fn state_root(&self) -> B256 { self.header().state_root() } + #[inline] fn transactions_root(&self) -> B256 { self.header().transactions_root() } + #[inline] fn receipts_root(&self) -> B256 { self.header().receipts_root() } + #[inline] fn withdrawals_root(&self) -> Option { self.header().withdrawals_root() } + #[inline] fn logs_bloom(&self) -> Bloom { self.header().logs_bloom() } + #[inline] fn difficulty(&self) -> U256 { self.header().difficulty() } + #[inline] fn number(&self) -> BlockNumber { self.header().number() } + #[inline] fn gas_limit(&self) -> u64 { self.header().gas_limit() } + #[inline] fn gas_used(&self) -> u64 { self.header().gas_used() } + #[inline] fn timestamp(&self) -> u64 { self.header().timestamp() } + #[inline] fn mix_hash(&self) -> Option { self.header().mix_hash() } + #[inline] fn nonce(&self) -> Option { self.header().nonce() } + #[inline] fn base_fee_per_gas(&self) -> Option { self.header().base_fee_per_gas() } + #[inline] fn blob_gas_used(&self) -> Option { self.header().blob_gas_used() } + #[inline] fn excess_blob_gas(&self) -> Option { self.header().excess_blob_gas() } + #[inline] fn parent_beacon_block_root(&self) -> Option { self.header().parent_beacon_block_root() } + #[inline] fn requests_hash(&self) -> Option { self.header().requests_hash() } + #[inline] fn extra_data(&self) -> &Bytes { self.header().extra_data() } + #[inline] fn next_block_excess_blob_gas(&self) -> Option { self.header().next_block_excess_blob_gas() } + #[inline] fn next_block_blob_fee(&self) -> Option { self.header().next_block_blob_fee() } diff --git a/crates/primitives-traits/src/transaction/signed.rs b/crates/primitives-traits/src/transaction/signed.rs index be7a308271ff..48afd86e88bc 100644 --- a/crates/primitives-traits/src/transaction/signed.rs +++ b/crates/primitives-traits/src/transaction/signed.rs @@ -1,6 +1,6 @@ //! API of a signed transaction. -use alloc::fmt; +use alloc::{fmt, vec::Vec}; use core::hash::Hash; #[cfg(feature = "std")] use std::sync::LazyLock;