chore: misc sealed fn (#13378)

This commit is contained in:
Matthias Seitz
2024-12-13 13:49:32 +01:00
committed by GitHub
parent f347977765
commit 088925c08a
3 changed files with 15 additions and 8 deletions

View File

@ -255,6 +255,11 @@ impl<H, B> SealedBlock<H, B> {
self.header.hash()
}
/// Returns reference to block body.
pub const fn body(&self) -> &B {
&self.body
}
/// Splits the [`BlockBody`] and [`SealedHeader`] into separate components
#[inline]
pub fn split_header_body(self) -> (SealedHeader<H>, B) {
@ -326,12 +331,6 @@ where
H: reth_primitives_traits::BlockHeader,
B: reth_primitives_traits::BlockBody,
{
/// Splits the sealed block into underlying components
#[inline]
pub fn split(self) -> (SealedHeader<H>, B) {
(self.header, self.body)
}
/// Expensive operation that recovers transaction signer. See [`SealedBlockWithSenders`].
pub fn senders(&self) -> Option<Vec<Address>>
where
@ -496,7 +495,7 @@ impl<B: reth_primitives_traits::Block> SealedBlockWithSenders<B> {
#[inline]
pub fn unseal(self) -> BlockWithSenders<B> {
let (block, senders) = self.into_components();
let (header, body) = block.split();
let (header, body) = block.split_header_body();
let header = header.unseal();
BlockWithSenders::new_unchecked(B::new(header, body), senders)
}