pub trait Certificate<TYPES: NodeType, T>: HasViewNumber<TYPES> {
type Voteable: Voteable<TYPES>;
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::View,
) -> Self;
fn is_valid_cert<V: Versions>(
&self,
stake_table: &[<TYPES::SignatureKey as SignatureKey>::StakeTableEntry],
threshold: U256,
upgrade_lock: &UpgradeLock<TYPES, V>,
) -> impl Future<Output = Result<()>>;
fn threshold(
membership: &EpochMembership<TYPES>,
) -> impl Future<Output = U256> + Send;
fn stake_table(
membership: &EpochMembership<TYPES>,
) -> impl Future<Output = HSStakeTable<TYPES>> + Send;
fn total_nodes(
membership: &EpochMembership<TYPES>,
) -> impl Future<Output = usize> + Send;
fn stake_table_entry(
membership: &EpochMembership<TYPES>,
pub_key: &TYPES::SignatureKey,
) -> impl Future<Output = Option<PeerConfig<TYPES>>> + Send;
fn data(&self) -> &Self::Voteable;
fn data_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::View,
) -> 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::View, ) -> Self
Build a certificate from the data commitment and the quorum of signers
Sourcefn is_valid_cert<V: Versions>(
&self,
stake_table: &[<TYPES::SignatureKey as SignatureKey>::StakeTableEntry],
threshold: U256,
upgrade_lock: &UpgradeLock<TYPES, V>,
) -> impl Future<Output = Result<()>>
fn is_valid_cert<V: Versions>( &self, stake_table: &[<TYPES::SignatureKey as SignatureKey>::StakeTableEntry], threshold: U256, upgrade_lock: &UpgradeLock<TYPES, V>, ) -> impl Future<Output = Result<()>>
Checks if the cert is valid in the given epoch
Sourcefn threshold(
membership: &EpochMembership<TYPES>,
) -> impl Future<Output = U256> + Send
fn threshold( membership: &EpochMembership<TYPES>, ) -> impl Future<Output = U256> + Send
Returns the amount of stake needed to create this certificate
Sourcefn stake_table(
membership: &EpochMembership<TYPES>,
) -> impl Future<Output = HSStakeTable<TYPES>> + Send
fn stake_table( membership: &EpochMembership<TYPES>, ) -> impl Future<Output = HSStakeTable<TYPES>> + Send
Get Stake Table from Membership implementation.
Sourcefn total_nodes(
membership: &EpochMembership<TYPES>,
) -> impl Future<Output = usize> + Send
fn total_nodes( membership: &EpochMembership<TYPES>, ) -> impl Future<Output = usize> + Send
Get Total Nodes from Membership implementation.
Sourcefn stake_table_entry(
membership: &EpochMembership<TYPES>,
pub_key: &TYPES::SignatureKey,
) -> impl Future<Output = Option<PeerConfig<TYPES>>> + Send
fn stake_table_entry( membership: &EpochMembership<TYPES>, pub_key: &TYPES::SignatureKey, ) -> impl Future<Output = Option<PeerConfig<TYPES>>> + Send
Get StakeTableEntry
from Membership implementation.
Sourcefn data_commitment<V: Versions>(
&self,
upgrade_lock: &UpgradeLock<TYPES, V>,
) -> impl Future<Output = Result<Commitment<VersionedVoteData<TYPES, Self::Voteable, V>>>>
fn data_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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.