Type Alias SealedHeaderFor
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
§impl<H> SealedHeader<&H>where
H: Sealable,
impl<H> SealedHeader<&H>where
H: Sealable,
pub 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.
§impl<H> SealedHeader<H>
impl<H> SealedHeader<H>
pub fn new_unhashed(header: H) -> SealedHeader<H>
pub fn new_unhashed(header: H) -> SealedHeader<H>
Creates the sealed header without hashing the header.
pub fn new(header: H, hash: FixedBytes<32>) -> SealedHeader<H>
pub fn new(header: H, hash: FixedBytes<32>) -> SealedHeader<H>
Creates the sealed header with the corresponding block hash.
pub fn clone_header(&self) -> Hwhere
H: Clone,
pub fn clone_header(&self) -> Hwhere
H: Clone,
Clone the header.
pub fn into_header(self) -> H
pub fn into_header(self) -> H
Consumes the type and returns the wrapped header.
pub fn unseal(self) -> H
pub fn unseal(self) -> H
Consumes the type and returns the wrapped header.
pub fn sealed_ref(&self) -> SealedHeader<&H>
pub fn sealed_ref(&self) -> SealedHeader<&H>
Converts from &SealedHeader<H>
to SealedHeader<&H>
.
§impl<H> SealedHeader<H>where
H: TestHeader,
impl<H> SealedHeader<H>where
H: TestHeader,
pub 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.
pub fn set_hash(&mut self, hash: FixedBytes<32>)
Available on crate feature test-utils
only.
pub fn set_hash(&mut self, hash: FixedBytes<32>)
test-utils
only.Updates the block hash.
pub 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.
pub fn set_parent_hash(&mut self, hash: FixedBytes<32>)
Available on crate feature test-utils
only.
pub fn set_parent_hash(&mut self, hash: FixedBytes<32>)
test-utils
only.Updates the parent block hash.
pub fn set_block_number(&mut self, number: u64)
Available on crate feature test-utils
only.
pub fn set_block_number(&mut self, number: u64)
test-utils
only.Updates the block number.
pub fn set_state_root(&mut self, state_root: FixedBytes<32>)
Available on crate feature test-utils
only.
pub fn set_state_root(&mut self, state_root: FixedBytes<32>)
test-utils
only.Updates the block state root.
pub fn set_difficulty(&mut self, difficulty: Uint<256, 4>)
Available on crate feature test-utils
only.
pub fn set_difficulty(&mut self, difficulty: Uint<256, 4>)
test-utils
only.Updates the block difficulty.
§impl<H> SealedHeader<H>where
H: BlockHeader + Sealable,
impl<H> SealedHeader<H>where
H: BlockHeader + Sealable,
pub fn num_hash(&self) -> NumHash
pub fn num_hash(&self) -> NumHash
Return the number hash tuple.
pub fn block_with_parent(&self) -> BlockWithParent
pub fn block_with_parent(&self) -> BlockWithParent
Return a [BlockWithParent
] for this header.
§impl<H> SealedHeader<H>where
H: Sealable,
impl<H> SealedHeader<H>where
H: Sealable,
pub fn seal_slow(header: H) -> SealedHeader<H>
pub fn seal_slow(header: H) -> SealedHeader<H>
Hashes the header and creates a sealed header.
pub fn hash_ref(&self) -> &FixedBytes<32>
pub fn hash_ref(&self) -> &FixedBytes<32>
Returns the block hash.
Note: if the hash has not been computed yet, this will compute the hash:
[Sealable::hash_slow
].
pub fn hash(&self) -> FixedBytes<32>
pub fn hash(&self) -> FixedBytes<32>
Returns a copy of the block hash.
pub fn split(self) -> (H, FixedBytes<32>)
pub fn split(self) -> (H, FixedBytes<32>)
This is the inverse of Header::seal_slow
which returns the raw header and hash.
Trait Implementations
§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.§fn arbitrary(u: &mut Unstructured<'a>) -> Result<SealedHeader<H>, Error>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<SealedHeader<H>, Error>
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 more§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured
this type
needs to construct itself. Read more§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured
this type
needs to construct itself. Read more§impl<H> AsRef<H> for SealedHeader<H>
impl<H> AsRef<H> for SealedHeader<H>
§impl<H> Clone for SealedHeader<H>where
H: Clone,
impl<H> Clone for SealedHeader<H>where
H: Clone,
§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 more§impl<H> Debug for SealedHeader<H>where
H: Debug,
impl<H> Debug for SealedHeader<H>where
H: Debug,
§impl Decodable for SealedHeader
impl Decodable for SealedHeader
§fn decode(buf: &mut &[u8]) -> Result<SealedHeader, Error>
fn decode(buf: &mut &[u8]) -> Result<SealedHeader, Error>
buf
must be advanced past
the decoded object.§impl<H> Default for SealedHeader<H>where
H: Sealable + Default,
impl<H> Default for SealedHeader<H>where
H: Sealable + Default,
§fn default() -> SealedHeader<H>
fn default() -> SealedHeader<H>
§impl<H> Deref for SealedHeader<H>
impl<H> Deref for SealedHeader<H>
§impl<'de, H> Deserialize<'de> for SealedHeader<H>where
H: Deserialize<'de>,
impl<'de, H> Deserialize<'de> for SealedHeader<H>where
H: Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SealedHeader<H>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SealedHeader<H>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Encodable for SealedHeader
impl Encodable for SealedHeader
§impl<'a, H> From<SealedHeader<'a, H>> for SealedHeader<H>where
H: Sealable + SerdeBincodeCompat,
impl<'a, H> From<SealedHeader<'a, H>> for SealedHeader<H>where
H: Sealable + SerdeBincodeCompat,
§fn from(value: SealedHeader<'a, H>) -> SealedHeader<H>
fn from(value: SealedHeader<'a, H>) -> SealedHeader<H>
§impl<H> Hash for SealedHeader<H>where
H: Sealable,
impl<H> Hash for SealedHeader<H>where
H: Sealable,
§impl<H> InMemorySize for SealedHeader<H>where
H: InMemorySize,
impl<H> InMemorySize for SealedHeader<H>where
H: InMemorySize,
§fn size(&self) -> usize
fn size(&self) -> usize
Calculates a heuristic for the in-memory size of the SealedHeader
.