Struct linera_chain::data_types::Certificate
source · pub struct Certificate {
pub value: HashedValue,
pub round: Round,
/* private fields */
}
Expand description
A certified statement from the committee.
Fields§
§value: HashedValue
The certified value.
round: Round
The round in which the value was certified.
Implementations§
source§impl Certificate
impl Certificate
pub fn new( value: HashedValue, round: Round, signatures: Vec<(ValidatorName, Signature)> ) -> Self
pub fn signatures(&self) -> &Vec<(ValidatorName, Signature)>
pub fn add_signature( &mut self, signature: (ValidatorName, Signature) ) -> &Vec<(ValidatorName, Signature)>
sourcepub fn check<'a>(
&'a self,
committee: &Committee
) -> Result<&'a HashedValue, ChainError>
pub fn check<'a>( &'a self, committee: &Committee ) -> Result<&'a HashedValue, ChainError>
Verifies the certificate.
sourcepub fn lite_certificate(&self) -> LiteCertificate<'_>
pub fn lite_certificate(&self) -> LiteCertificate<'_>
Returns the certificate without the full value.
sourcepub fn lite_value(&self) -> LiteValue
pub fn lite_value(&self) -> LiteValue
Returns the LiteValue
corresponding to the certified value.
sourcepub fn value(&self) -> &CertificateValue
pub fn value(&self) -> &CertificateValue
Returns the certified value.
sourcepub fn hash(&self) -> CryptoHash
pub fn hash(&self) -> CryptoHash
Returns the certified value’s hash.
sourcepub fn is_signed_by(&self, validator_name: &ValidatorName) -> bool
pub fn is_signed_by(&self, validator_name: &ValidatorName) -> bool
Returns whether the validator is among the signatories of this certificate.
sourcepub fn message_bundle_for(
&self,
medium: &Medium,
recipient: ChainId
) -> Option<MessageBundle>
pub fn message_bundle_for( &self, medium: &Medium, recipient: ChainId ) -> Option<MessageBundle>
Returns the bundle of messages sent via the given medium to the specified recipient. If the medium is a channel, does not verify that the recipient is actually subscribed to that channel.
Trait Implementations§
source§impl Clone for Certificate
impl Clone for Certificate
source§fn clone(&self) -> Certificate
fn clone(&self) -> Certificate
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 Debug for Certificate
impl Debug for Certificate
source§impl<'de> Deserialize<'de> for Certificate
impl<'de> Deserialize<'de> for Certificate
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 Freeze for Certificate
impl RefUnwindSafe for Certificate
impl Send for Certificate
impl Sync for Certificate
impl Unpin for Certificate
impl UnwindSafe for Certificate
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