Trait hotshot_types::vote::Certificate
source · 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§
Required Methods§
sourcefn 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 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
sourcefn is_valid_cert<MEMBERSHIP: Membership<TYPES>, V: Versions>(
&self,
membership: &MEMBERSHIP,
upgrade_lock: &UpgradeLock<TYPES, V>
) -> impl Future<Output = bool>
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
sourcefn threshold<MEMBERSHIP: Membership<TYPES>>(membership: &MEMBERSHIP) -> u64
fn threshold<MEMBERSHIP: Membership<TYPES>>(membership: &MEMBERSHIP) -> u64
Returns the amount of stake needed to create this certificate
sourcefn date_commitment<V: Versions>(
&self,
upgrade_lock: &UpgradeLock<TYPES, V>
) -> impl Future<Output = Result<Commitment<VersionedVoteData<TYPES, Self::Voteable, V>>>>
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.