pub struct ConsensusProof {
pub algorithm: ConsensusAlgorithm,
pub proof_data: Vec<u8>,
pub signatures: Vec<ValidatorSignature>,
}Expand description
Proof of consensus for a block
Contains the cryptographic evidence that the block was produced according to the consensus rules.
Fields§
§algorithm: ConsensusAlgorithmThe consensus algorithm used
proof_data: Vec<u8>Proof data specific to the consensus algorithm
signatures: Vec<ValidatorSignature>Signatures from validators
Implementations§
Source§impl ConsensusProof
impl ConsensusProof
Sourcepub fn new(algorithm: ConsensusAlgorithm, proof_data: Vec<u8>) -> Self
pub fn new(algorithm: ConsensusAlgorithm, proof_data: Vec<u8>) -> Self
Creates a new consensus proof
Sourcepub fn add_signature(&mut self, signature: ValidatorSignature)
pub fn add_signature(&mut self, signature: ValidatorSignature)
Adds a validator signature to the proof
Trait Implementations§
Source§impl Clone for ConsensusProof
impl Clone for ConsensusProof
Source§fn clone(&self) -> ConsensusProof
fn clone(&self) -> ConsensusProof
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConsensusProof
impl Debug for ConsensusProof
Source§impl<'de> Deserialize<'de> for ConsensusProof
impl<'de> Deserialize<'de> for ConsensusProof
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ConsensusProof
Source§impl PartialEq for ConsensusProof
impl PartialEq for ConsensusProof
Source§fn eq(&self, other: &ConsensusProof) -> bool
fn eq(&self, other: &ConsensusProof) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ConsensusProof
impl Serialize for ConsensusProof
impl StructuralPartialEq for ConsensusProof
Auto Trait Implementations§
impl Freeze for ConsensusProof
impl RefUnwindSafe for ConsensusProof
impl Send for ConsensusProof
impl Sync for ConsensusProof
impl Unpin for ConsensusProof
impl UnsafeUnpin for ConsensusProof
impl UnwindSafe for ConsensusProof
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
Mutably borrows from an owned value. Read more