Struct linera_chain::data_types::LiteCertificate
source · pub struct LiteCertificate<'a> {
pub value: LiteValue,
pub round: Round,
pub signatures: Cow<'a, [(ValidatorName, Signature)]>,
}
Expand description
A certified statement from the committee, without the value.
Fields§
§value: LiteValue
Hash and chain ID of the certified value (used as key for storage).
round: Round
The round in which the value was certified.
signatures: Cow<'a, [(ValidatorName, Signature)]>
Signatures on the value.
Implementations§
source§impl<'a> LiteCertificate<'a>
impl<'a> LiteCertificate<'a>
pub fn new( value: LiteValue, round: Round, signatures: Vec<(ValidatorName, Signature)> ) -> Self
sourcepub fn try_from_votes(votes: impl IntoIterator<Item = LiteVote>) -> Option<Self>
pub fn try_from_votes(votes: impl IntoIterator<Item = LiteVote>) -> Option<Self>
Creates a LiteCertificate
from a list of votes, without cryptographically checking the
signatures. Returns None
if the votes are empty or don’t have matching values and rounds.
sourcepub fn check(self, committee: &Committee) -> Result<LiteValue, ChainError>
pub fn check(self, committee: &Committee) -> Result<LiteValue, ChainError>
Verifies the certificate.
sourcepub fn with_value(self, value: HashedValue) -> Option<Certificate>
pub fn with_value(self, value: HashedValue) -> Option<Certificate>
Returns the Certificate
with the specified value, if it matches.
sourcepub fn cloned(&self) -> LiteCertificate<'static>
pub fn cloned(&self) -> LiteCertificate<'static>
Returns a LiteCertificate
that owns the list of signatures.
Trait Implementations§
source§impl<'a> Clone for LiteCertificate<'a>
impl<'a> Clone for LiteCertificate<'a>
source§fn clone(&self) -> LiteCertificate<'a>
fn clone(&self) -> LiteCertificate<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for LiteCertificate<'a>
impl<'a> Debug for LiteCertificate<'a>
source§impl<'de, 'a> Deserialize<'de> for LiteCertificate<'a>
impl<'de, 'a> Deserialize<'de> for LiteCertificate<'a>
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
Auto Trait Implementations§
impl<'a> Freeze for LiteCertificate<'a>
impl<'a> RefUnwindSafe for LiteCertificate<'a>
impl<'a> Send for LiteCertificate<'a>
impl<'a> Sync for LiteCertificate<'a>
impl<'a> Unpin for LiteCertificate<'a>
impl<'a> UnwindSafe for LiteCertificate<'a>
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