pub type SealedHeaderFor<N> = SealedHeader<<N as NodePrimitives>::BlockHeader>;
Expand description
Type alias for SealedHeader
generic over the BlockHeader
type of NodePrimitives
.
Aliased Type§
struct SealedHeaderFor<N> { /* private fields */ }
Layout§
Note: Encountered an error during type layout; the type failed to be normalized.
Implementations
Source§impl<H: Sealable> SealedHeader<&H>
impl<H: Sealable> SealedHeader<&H>
Sourcepub fn cloned(self) -> SealedHeader<H>where
H: Clone,
pub fn cloned(self) -> SealedHeader<H>where
H: Clone,
Maps a SealedHeader<&H>
to a SealedHeader<H>
by cloning the header.
Source§impl<H: BlockHeader + Sealable> SealedHeader<H>
impl<H: BlockHeader + Sealable> SealedHeader<H>
Sourcepub fn block_with_parent(&self) -> BlockWithParent
pub fn block_with_parent(&self) -> BlockWithParent
Return a [BlockWithParent
] for this header.
Source§impl<H: TestHeader> SealedHeader<H>
impl<H: TestHeader> SealedHeader<H>
Sourcepub fn set_header(&mut self, header: H)
Available on crate feature test-utils
only.
pub fn set_header(&mut self, header: H)
test-utils
only.Updates the block header.
Sourcepub fn set_hash(&mut self, hash: BlockHash)
Available on crate feature test-utils
only.
pub fn set_hash(&mut self, hash: BlockHash)
test-utils
only.Updates the block hash.
Sourcepub fn header_mut(&mut self) -> &mut H
Available on crate feature test-utils
only.
pub fn header_mut(&mut self) -> &mut H
test-utils
only.Returns a mutable reference to the header.
Sourcepub fn set_parent_hash(&mut self, hash: BlockHash)
Available on crate feature test-utils
only.
pub fn set_parent_hash(&mut self, hash: BlockHash)
test-utils
only.Updates the parent block hash.
Sourcepub fn set_block_number(&mut self, number: BlockNumber)
Available on crate feature test-utils
only.
pub fn set_block_number(&mut self, number: BlockNumber)
test-utils
only.Updates the block number.
Sourcepub fn set_state_root(&mut self, state_root: B256)
Available on crate feature test-utils
only.
pub fn set_state_root(&mut self, state_root: B256)
test-utils
only.Updates the block state root.
Sourcepub fn set_difficulty(&mut self, difficulty: U256)
Available on crate feature test-utils
only.
pub fn set_difficulty(&mut self, difficulty: U256)
test-utils
only.Updates the block difficulty.
Source§impl<H> SealedHeader<H>
impl<H> SealedHeader<H>
Sourcepub fn new_unhashed(header: H) -> Self
pub fn new_unhashed(header: H) -> Self
Creates the sealed header without hashing the header.
Sourcepub fn new(header: H, hash: BlockHash) -> Self
pub fn new(header: H, hash: BlockHash) -> Self
Creates the sealed header with the corresponding block hash.
Sourcepub fn clone_header(&self) -> Hwhere
H: Clone,
pub fn clone_header(&self) -> Hwhere
H: Clone,
Clone the header.
Sourcepub fn into_header(self) -> H
pub fn into_header(self) -> H
Consumes the type and returns the wrapped header.
Sourcepub fn sealed_ref(&self) -> SealedHeader<&H>
pub fn sealed_ref(&self) -> SealedHeader<&H>
Converts from &SealedHeader<H>
to SealedHeader<&H>
.
Source§impl<H: Sealable> SealedHeader<H>
impl<H: Sealable> SealedHeader<H>
Sourcepub fn hash_ref(&self) -> &BlockHash
pub fn hash_ref(&self) -> &BlockHash
Returns the block hash.
Note: if the hash has not been computed yet, this will compute the hash:
[Sealable::hash_slow
].
Sourcepub fn split(self) -> (H, BlockHash)
pub fn split(self) -> (H, BlockHash)
This is the inverse of Header::seal_slow
which returns the raw header and hash.
Trait Implementations
Source§impl<'a, H> Arbitrary<'a> for SealedHeader<H>where
H: for<'b> Arbitrary<'b> + Sealable,
Available on crate feature arbitrary
only.
impl<'a, H> Arbitrary<'a> for SealedHeader<H>where
H: for<'b> Arbitrary<'b> + Sealable,
arbitrary
only.Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Self
from the given unstructured data. Read more§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self
from the entirety of the given
unstructured data. Read moreSource§impl<H> AsRef<H> for SealedHeader<H>
impl<H> AsRef<H> for SealedHeader<H>
Source§impl<H: Clone> Clone for SealedHeader<H>
impl<H: Clone> Clone for SealedHeader<H>
Source§fn clone(&self) -> SealedHeader<H>
fn clone(&self) -> SealedHeader<H>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<H: Debug> Debug for SealedHeader<H>
impl<H: Debug> Debug for SealedHeader<H>
Source§impl Decodable for SealedHeader
impl Decodable for SealedHeader
Source§impl<H: Sealable + Default> Default for SealedHeader<H>
impl<H: Sealable + Default> Default for SealedHeader<H>
Source§impl<H> Deref for SealedHeader<H>
impl<H> Deref for SealedHeader<H>
Source§impl<'de, H> Deserialize<'de> for SealedHeader<H>where
H: Deserialize<'de>,
impl<'de, H> Deserialize<'de> for SealedHeader<H>where
H: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Encodable for SealedHeader
impl Encodable for SealedHeader
Source§impl<'a, H: Sealable + SerdeBincodeCompat> From<SealedHeader<'a, H>> for SealedHeader<H>
Available on crate feature serde-bincode-compat
only.
impl<'a, H: Sealable + SerdeBincodeCompat> From<SealedHeader<'a, H>> for SealedHeader<H>
serde-bincode-compat
only.Source§fn from(value: SealedHeader<'a, H>) -> Self
fn from(value: SealedHeader<'a, H>) -> Self
Source§impl<H: Sealable> Hash for SealedHeader<H>
impl<H: Sealable> Hash for SealedHeader<H>
Source§impl<H: InMemorySize> InMemorySize for SealedHeader<H>
impl<H: InMemorySize> InMemorySize for SealedHeader<H>
Source§fn size(&self) -> usize
fn size(&self) -> usize
Calculates a heuristic for the in-memory size of the SealedHeader
.
Source§impl<H: Sealable> PartialEq for SealedHeader<H>
impl<H: Sealable> PartialEq for SealedHeader<H>
Source§impl<H: Sealable + SerdeBincodeCompat> SerdeBincodeCompat for SealedHeader<H>
Available on crate feature serde-bincode-compat
only.
impl<H: Sealable + SerdeBincodeCompat> SerdeBincodeCompat for SealedHeader<H>
serde-bincode-compat
only.