pub struct FinalitySignatureV2 { /* private fields */ }Expand description
A validator’s signature of a block, confirming it is finalized.
Clients and joining nodes should wait until the signers’ combined weight exceeds the fault tolerance threshold before accepting the block as finalized.
Implementations§
Source§impl FinalitySignatureV2
impl FinalitySignatureV2
Sourcepub fn create(
block_hash: BlockHash,
block_height: u64,
era_id: EraId,
chain_name_hash: ChainNameDigest,
secret_key: &SecretKey,
) -> Self
pub fn create( block_hash: BlockHash, block_height: u64, era_id: EraId, chain_name_hash: ChainNameDigest, secret_key: &SecretKey, ) -> Self
Constructs a new FinalitySignatureV2.
Sourcepub fn block_hash(&self) -> &BlockHash
pub fn block_hash(&self) -> &BlockHash
Returns the block hash of the associated block.
Sourcepub fn block_height(&self) -> u64
pub fn block_height(&self) -> u64
Returns the height of the associated block.
Sourcepub fn chain_name_hash(&self) -> ChainNameDigest
pub fn chain_name_hash(&self) -> ChainNameDigest
Returns the hash of the chain name of the associated block.
Sourcepub fn signature(&self) -> &Signature
pub fn signature(&self) -> &Signature
Returns the signature over the block hash of the associated block.
Sourcepub fn public_key(&self) -> &PublicKey
pub fn public_key(&self) -> &PublicKey
Returns the public key of the signing validator.
Sourcepub fn is_verified(&self) -> Result<(), Error>
pub fn is_verified(&self) -> Result<(), Error>
Returns Ok if the signature is cryptographically valid.
Sourcepub fn new(
block_hash: BlockHash,
block_height: u64,
era_id: EraId,
chain_name_hash: ChainNameDigest,
signature: Signature,
public_key: PublicKey,
) -> Self
Available on crate feature testing only.
pub fn new( block_hash: BlockHash, block_height: u64, era_id: EraId, chain_name_hash: ChainNameDigest, signature: Signature, public_key: PublicKey, ) -> Self
testing only.Constructs a new FinalitySignatureV2.
Sourcepub fn random(rng: &mut TestRng) -> Self
Available on crate feature testing only.
pub fn random(rng: &mut TestRng) -> Self
testing only.Returns a random FinalitySignatureV2.
Sourcepub fn random_for_block(
block_hash: BlockHash,
block_height: u64,
era_id: EraId,
chain_name_hash: ChainNameDigest,
rng: &mut TestRng,
) -> Self
Available on crate feature testing only.
pub fn random_for_block( block_hash: BlockHash, block_height: u64, era_id: EraId, chain_name_hash: ChainNameDigest, rng: &mut TestRng, ) -> Self
testing only.Returns a random FinalitySignatureV2 for the provided block_hash, block_height,
era_id, and chain_name_hash.
Trait Implementations§
Source§impl Clone for FinalitySignatureV2
impl Clone for FinalitySignatureV2
Source§fn clone(&self) -> FinalitySignatureV2
fn clone(&self) -> FinalitySignatureV2
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl DataSize for FinalitySignatureV2
impl DataSize for FinalitySignatureV2
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 FinalitySignatureV2
impl Debug for FinalitySignatureV2
Source§impl<'de> Deserialize<'de> for FinalitySignatureV2
impl<'de> Deserialize<'de> for FinalitySignatureV2
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 FinalitySignatureV2
impl Display for FinalitySignatureV2
Source§impl From<FinalitySignatureV2> for FinalitySignature
impl From<FinalitySignatureV2> for FinalitySignature
Source§fn from(fs: FinalitySignatureV2) -> Self
fn from(fs: FinalitySignatureV2) -> Self
Source§impl Hash for FinalitySignatureV2
impl Hash for FinalitySignatureV2
Source§impl JsonSchema for FinalitySignatureV2
impl JsonSchema for FinalitySignatureV2
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl Ord for FinalitySignatureV2
impl Ord for FinalitySignatureV2
Source§fn cmp(&self, other: &FinalitySignatureV2) -> Ordering
fn cmp(&self, other: &FinalitySignatureV2) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for FinalitySignatureV2
impl PartialEq for FinalitySignatureV2
Source§impl PartialOrd for FinalitySignatureV2
impl PartialOrd for FinalitySignatureV2
Source§impl Serialize for FinalitySignatureV2
impl Serialize for FinalitySignatureV2
impl Eq for FinalitySignatureV2
Auto Trait Implementations§
impl !Freeze for FinalitySignatureV2
impl RefUnwindSafe for FinalitySignatureV2
impl Send for FinalitySignatureV2
impl Sync for FinalitySignatureV2
impl Unpin for FinalitySignatureV2
impl UnwindSafe for FinalitySignatureV2
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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