Skip to content

Commit

Permalink
Inline Body impl for Block types
Browse files Browse the repository at this point in the history
  • Loading branch information
emhane committed Nov 14, 2024
1 parent 133a957 commit cac0655
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/primitives-traits/src/block/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,42 +57,52 @@ impl<T: Block>
Body<T::Header, <T::Body as BlockBody>::Transaction, <T::Body as BlockBody>::Withdrawals>
for T
{
#[inline]
fn transactions(&self) -> &[<T::Body as BlockBody>::Transaction] {
self.body().transactions()
}

#[inline]
fn withdrawals(&self) -> Option<&<T::Body as BlockBody>::Withdrawals> {
self.body().withdrawals()
}

#[inline]
fn ommers(&self) -> &[T::Header] {
self.body().ommers()
}

#[inline]
fn requests(&self) -> Option<&Requests> {
self.body().requests()
}

#[inline]
fn calculate_tx_root(&self) -> B256 {
self.body().calculate_tx_root()
}

#[inline]
fn calculate_ommers_root(&self) -> B256 {
self.body().calculate_ommers_root()
}

#[inline]
fn calculate_withdrawals_root(&self) -> Option<B256> {
self.body().calculate_withdrawals_root()
}

#[inline]
fn recover_signers(&self) -> Option<Vec<Address>> {
self.body().recover_signers()
}

#[inline]
fn blob_versioned_hashes(&self) -> Vec<&B256> {
self.body().blob_versioned_hashes()
}

#[inline]
fn blob_versioned_hashes_copied(&self) -> Vec<B256> {
self.body().blob_versioned_hashes_copied()
}
Expand Down

0 comments on commit cac0655

Please sign in to comment.