Skip to main content

Verifiable

Trait Verifiable 

Source
pub trait Verifiable<T: NodeType>:
    HasViewNumber
    + HasEpoch
    + Sized {
    type Key: Copy + Ord + Hash + Display + Send + Sync + 'static;
    type Output: Send + 'static;

    // Required methods
    fn key(&self) -> Option<Self::Key>;
    fn check(
        self,
        stake_table: &[<T::SignatureKey as SignatureKey>::StakeTableEntry],
        threshold: U256,
        epoch_height: u64,
        upgrade_lock: &UpgradeLock<T>,
        memberships: &EpochMembershipCoordinator<T>,
    ) -> Result<Self::Output>;

    // Provided method
    fn epochs(&self) -> impl Iterator<Item = EpochNumber> { ... }
}

Required Associated Types§

Source

type Key: Copy + Ord + Hash + Display + Send + Sync + 'static

Identifies the Verifiable, e.g. ViewNumber or EpochNumber.

Source

type Output: Send + 'static

Required Methods§

Source

fn key(&self) -> Option<Self::Key>

Source

fn check( self, stake_table: &[<T::SignatureKey as SignatureKey>::StakeTableEntry], threshold: U256, epoch_height: u64, upgrade_lock: &UpgradeLock<T>, memberships: &EpochMembershipCoordinator<T>, ) -> Result<Self::Output>

Provided Methods§

Source

fn epochs(&self) -> impl Iterator<Item = EpochNumber>

The epochs whose committees Self::check reads.

The item waits until every one of them is known.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T, D, V> Verifiable<T> for SimpleCertificate<T, D, V>
where T: NodeType, D: Voteable<T> + HasEpoch + Meta + 'static, V: Threshold<T>, Self: Certificate<T, D> + Send + 'static,

Source§

type Key = ViewEpoch

Source§

type Output = SimpleCertificate<T, D, V>

Source§

fn key(&self) -> Option<ViewEpoch>

Source§

fn check( self, stake_table: &[<T::SignatureKey as SignatureKey>::StakeTableEntry], threshold: U256, epoch_height: u64, upgrade_lock: &UpgradeLock<T>, _: &EpochMembershipCoordinator<T>, ) -> Result<Self>

Source§

impl<T: NodeType> Verifiable<T> for TimeoutCertificate3<T>

Source§

fn epochs(&self) -> impl Iterator<Item = EpochNumber>

Its own epoch, and its lock’s if the lock is recent: the lock certificate is verified against that epoch’s committee.

Source§

type Key = ViewNumber

Source§

type Output = TimeoutCertificate3<T>

Source§

fn key(&self) -> Option<ViewNumber>

Source§

fn check( self, stake_table: &[<T::SignatureKey as SignatureKey>::StakeTableEntry], threshold: U256, epoch_height: u64, upgrade_lock: &UpgradeLock<T>, memberships: &EpochMembershipCoordinator<T>, ) -> Result<Self>

Implementors§