pub struct Certificate {
pub value: HashedCertificateValue,
pub round: Round,
/* private fields */
}
Expand description
A certified statement from the committee.
Fields§
§value: HashedCertificateValue
The certified value.
round: Round
The round in which the value was certified.
Implementations§
Source§impl Certificate
impl Certificate
pub fn new( value: HashedCertificateValue, 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 HashedCertificateValue, ChainError>
pub fn check<'a>( &'a self, committee: &Committee, ) -> Result<&'a HashedCertificateValue, 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_bundles_for<'a>(
&'a self,
medium: &'a Medium,
recipient: ChainId,
) -> impl Iterator<Item = (Epoch, MessageBundle)> + 'a
pub fn message_bundles_for<'a>( &'a self, medium: &'a Medium, recipient: ChainId, ) -> impl Iterator<Item = (Epoch, MessageBundle)> + 'a
Returns the bundles of messages sent via the given medium to the specified recipient. Messages originating from different transactions of the original block are kept in separate bundles. If the medium is a channel, does not verify that the recipient is actually subscribed to that channel.
pub fn requires_blob(&self, blob_id: &BlobId) -> bool
Trait Implementations§
Source§impl Clone for Certificate
impl Clone for Certificate
Source§fn clone(&self) -> Certificate
fn clone(&self) -> Certificate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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
.