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§
Sourcetype Key: Copy + Ord + Hash + Display + Send + Sync + 'static
type Key: Copy + Ord + Hash + Display + Send + Sync + 'static
Identifies the Verifiable, e.g. ViewNumber or EpochNumber.
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 Methods§
Sourcefn epochs(&self) -> impl Iterator<Item = EpochNumber>
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>
impl<T, D, V> Verifiable<T> for SimpleCertificate<T, D, V>
type Key = ViewEpoch
type Output = SimpleCertificate<T, D, V>
fn key(&self) -> Option<ViewEpoch>
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>
impl<T: NodeType> Verifiable<T> for TimeoutCertificate3<T>
Source§fn epochs(&self) -> impl Iterator<Item = EpochNumber>
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.