pub struct BlockHeaderWithSignatures { /* private fields */ }Expand description
A block header and collection of signatures of a given block.
Implementations§
Source§impl BlockHeaderWithSignatures
impl BlockHeaderWithSignatures
Sourcepub fn new(block_header: BlockHeader, block_signatures: BlockSignatures) -> Self
pub fn new(block_header: BlockHeader, block_signatures: BlockSignatures) -> Self
Returns a new BlockHeaderWithSignatures.
Sourcepub fn block_header(&self) -> &BlockHeader
pub fn block_header(&self) -> &BlockHeader
Returns the block header.
Sourcepub fn block_signatures(&self) -> &BlockSignatures
pub fn block_signatures(&self) -> &BlockSignatures
Returns the block signatures.
Sourcepub fn is_valid(&self) -> Result<(), BlockHeaderWithSignaturesValidationError>
pub fn is_valid(&self) -> Result<(), BlockHeaderWithSignaturesValidationError>
Returns Ok if and only if the block hash and era ID in the BlockHeader are identical to
those in the BlockSignatures.
Note that no cryptographic verification of the contained signatures is performed. For this,
see BlockSignatures::is_verified.
Sourcepub fn invalidate_era(&mut self)
Available on crate feature testing only.
pub fn invalidate_era(&mut self)
testing only.Sets the era ID contained in block_signatures to its max value, rendering it and hence
self invalid (assuming the relevant era ID for this BlockHeaderWithSignatures wasn’t
already the max value).
Sourcepub fn invalidate_last_signature(&mut self)
Available on crate feature testing only.
pub fn invalidate_last_signature(&mut self)
testing only.Replaces the signature field of the last block_signatures entry with the System variant
of crate::crypto::Signature, rendering that entry invalid.
Note that Self::is_valid will be unaffected by this as it only checks for equality in
the block hash and era ID of the header and signatures; no cryptographic verification is
performed.
Trait Implementations§
Source§impl Clone for BlockHeaderWithSignatures
impl Clone for BlockHeaderWithSignatures
Source§fn clone(&self) -> BlockHeaderWithSignatures
fn clone(&self) -> BlockHeaderWithSignatures
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl DataSize for BlockHeaderWithSignatures
impl DataSize for BlockHeaderWithSignatures
Source§const IS_DYNAMIC: bool = true
const IS_DYNAMIC: bool = true
true, the type has a heap size that can vary at runtime, depending on the actual value.Source§const STATIC_HEAP_SIZE: usize = 0usize
const STATIC_HEAP_SIZE: usize = 0usize
IS_DYNAMIC is false, this is
the total amount of heap memory occupied by the value. Otherwise this is a lower bound.Source§fn estimate_heap_size(&self) -> usize
fn estimate_heap_size(&self) -> usize
Source§impl Debug for BlockHeaderWithSignatures
impl Debug for BlockHeaderWithSignatures
Source§impl<'de> Deserialize<'de> for BlockHeaderWithSignatures
impl<'de> Deserialize<'de> for BlockHeaderWithSignatures
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 Display for BlockHeaderWithSignatures
impl Display for BlockHeaderWithSignatures
impl Eq for BlockHeaderWithSignatures
impl StructuralPartialEq for BlockHeaderWithSignatures
Auto Trait Implementations§
impl !Freeze for BlockHeaderWithSignatures
impl RefUnwindSafe for BlockHeaderWithSignatures
impl Send for BlockHeaderWithSignatures
impl Sync for BlockHeaderWithSignatures
impl Unpin for BlockHeaderWithSignatures
impl UnwindSafe for BlockHeaderWithSignatures
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more