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: HashedCertificateValue) -> Option<Certificate>
pub fn with_value(self, value: HashedCertificateValue) -> 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
source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
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>
Converts
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>
Converts
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 moresource§impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
source§fn read<'instance>(
&self,
instance: &'instance &mut I,
location: GuestPointer,
length: u32
) -> Result<Cow<'instance, [u8]>, RuntimeError>
fn read<'instance>( &self, instance: &'instance &mut I, location: GuestPointer, length: u32 ) -> Result<Cow<'instance, [u8]>, RuntimeError>
Reads length
bytes from memory from the provided location
.
source§fn write(
&mut self,
instance: &mut &mut I,
location: GuestPointer,
bytes: &[u8]
) -> Result<(), RuntimeError>
fn write( &mut self, instance: &mut &mut I, location: GuestPointer, bytes: &[u8] ) -> Result<(), RuntimeError>
Writes the bytes
to memory at the provided location
.