penumbra_stake::component::stake

Trait ConsensusIndexRead

Source
pub trait ConsensusIndexRead: StateRead {
    // Provided methods
    fn consensus_set_stream(
        &self,
    ) -> Result<Pin<Box<dyn Stream<Item = Result<IdentityKey>> + Send + 'static>>> { ... }
    fn get_consensus_set<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<IdentityKey>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn belongs_in_index<'life0, 'life1, 'async_trait>(
        &'life0 self,
        validator_id: &'life1 IdentityKey,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Available on crate feature component only.

Provided Methods§

Source

fn consensus_set_stream( &self, ) -> Result<Pin<Box<dyn Stream<Item = Result<IdentityKey>> + Send + 'static>>>

Returns a stream of IdentityKeys of validators that are currently in the consensus set. This only excludes validators that do not meet the minimum validator stake requirement (see StakeParameters::min_validator_stake).

Source

fn get_consensus_set<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<IdentityKey>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Returns the IdentityKeys of validators that are currently in the consensus set.

Source

fn belongs_in_index<'life0, 'life1, 'async_trait>( &'life0 self, validator_id: &'life1 IdentityKey, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns whether a validator should be indexed in the consensus set. Here, “consensus set” refers to the set of active validators as well as the “inactive” validators which could be promoted during a view change.

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.

Implementors§