pub trait Certificate<TYPES: NodeType>: HasViewNumber<TYPES> {
    type Voteable: Voteable;
    type Threshold: Threshold<TYPES>;

    // Required methods
    fn create_signed_certificate<V: Versions>(
        vote_commitment: Commitment<VersionedVoteData<TYPES, Self::Voteable, V>>,
        data: Self::Voteable,
        sig: <TYPES::SignatureKey as SignatureKey>::QcType,
        view: TYPES::Time
    ) -> Self;
    fn is_valid_cert<MEMBERSHIP: Membership<TYPES>, V: Versions>(
        &self,
        membership: &MEMBERSHIP,
        upgrade_lock: &UpgradeLock<TYPES, V>
    ) -> impl Future<Output = bool>;
    fn threshold<MEMBERSHIP: Membership<TYPES>>(membership: &MEMBERSHIP) -> u64;
    fn date(&self) -> &Self::Voteable;
    fn date_commitment<V: Versions>(
        &self,
        upgrade_lock: &UpgradeLock<TYPES, V>
    ) -> impl Future<Output = Result<Commitment<VersionedVoteData<TYPES, Self::Voteable, V>>>>;
}
Expand description

The certificate formed from the collection of signatures a committee. The committee is defined by the Membership associated type. The votes all must be over the Commitment associated type.

Required Associated Types§

source

type Voteable: Voteable

The data commitment this certificate certifies.

source

type Threshold: Threshold<TYPES>

Threshold Functions

Required Methods§

source

fn create_signed_certificate<V: Versions>( vote_commitment: Commitment<VersionedVoteData<TYPES, Self::Voteable, V>>, data: Self::Voteable, sig: <TYPES::SignatureKey as SignatureKey>::QcType, view: TYPES::Time ) -> Self

Build a certificate from the data commitment and the quorum of signers

source

fn is_valid_cert<MEMBERSHIP: Membership<TYPES>, V: Versions>( &self, membership: &MEMBERSHIP, upgrade_lock: &UpgradeLock<TYPES, V> ) -> impl Future<Output = bool>

Checks if the cert is valid

source

fn threshold<MEMBERSHIP: Membership<TYPES>>(membership: &MEMBERSHIP) -> u64

Returns the amount of stake needed to create this certificate

source

fn date(&self) -> &Self::Voteable

Get the commitment which was voted on

source

fn date_commitment<V: Versions>( &self, upgrade_lock: &UpgradeLock<TYPES, V> ) -> impl Future<Output = Result<Commitment<VersionedVoteData<TYPES, Self::Voteable, V>>>>

Get the vote commitment which the votes commit to

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<TYPES: NodeType, VOTEABLE: Voteable + 'static, THRESHOLD: Threshold<TYPES>> Certificate<TYPES> for SimpleCertificate<TYPES, VOTEABLE, THRESHOLD>

§

type Voteable = VOTEABLE

§

type Threshold = THRESHOLD