Skip to main content

TestStakeTable

Trait TestStakeTable 

Source
pub trait TestStakeTable<PubKey: SignatureKey, StatePubKey: StateSignatureKey + LCV1StateSignatureKey + LCV2StateSignatureKey + LCV3StateSignatureKey>:
    Clone
    + Debug
    + Send
    + Sync {
Show 16 methods // Required methods fn new( quorum_members: Vec<TestStakeTableEntry<PubKey, StatePubKey>>, da_members: Vec<TestStakeTableEntry<PubKey, StatePubKey>>, ) -> Self; fn stake_table( &self, epoch: Option<u64>, ) -> Vec<TestStakeTableEntry<PubKey, StatePubKey>>; fn full_stake_table(&self) -> Vec<TestStakeTableEntry<PubKey, StatePubKey>>; fn da_stake_table( &self, epoch: Option<u64>, ) -> Vec<TestStakeTableEntry<PubKey, StatePubKey>>; fn lookup_leader( &self, view_number: u64, epoch: Option<u64>, ) -> Result<PubKey>; fn has_stake_table(&self, epoch: u64) -> bool; fn has_randomized_stake_table(&self, epoch: u64) -> Result<bool>; fn add_epoch_root(&mut self, epoch: u64); fn add_drb_result(&mut self, epoch: u64, drb_result: DrbResult); fn set_first_epoch(&mut self, epoch: u64, initial_drb_result: DrbResult); fn first_epoch(&self) -> Option<u64>; fn get_epoch_drb(&self, epoch: u64) -> Result<DrbResult>; fn add_da_committee( &mut self, first_epoch: u64, committee: Vec<TestStakeTableEntry<PubKey, StatePubKey>>, ); // Provided methods fn stake( &self, pub_key: PubKey, epoch: Option<u64>, ) -> Option<TestStakeTableEntry<PubKey, StatePubKey>> { ... } fn da_stake( &self, pub_key: PubKey, epoch: Option<u64>, ) -> Option<TestStakeTableEntry<PubKey, StatePubKey>> { ... } fn add_quorum_committee( &mut self, _first_epoch: u64, _committee: Vec<TestStakeTableEntry<PubKey, StatePubKey>>, ) { ... }
}

Required Methods§

Source

fn new( quorum_members: Vec<TestStakeTableEntry<PubKey, StatePubKey>>, da_members: Vec<TestStakeTableEntry<PubKey, StatePubKey>>, ) -> Self

Source

fn stake_table( &self, epoch: Option<u64>, ) -> Vec<TestStakeTableEntry<PubKey, StatePubKey>>

Source

fn full_stake_table(&self) -> Vec<TestStakeTableEntry<PubKey, StatePubKey>>

Source

fn da_stake_table( &self, epoch: Option<u64>, ) -> Vec<TestStakeTableEntry<PubKey, StatePubKey>>

Source

fn lookup_leader(&self, view_number: u64, epoch: Option<u64>) -> Result<PubKey>

Source

fn has_stake_table(&self, epoch: u64) -> bool

Source

fn has_randomized_stake_table(&self, epoch: u64) -> Result<bool>

Source

fn add_epoch_root(&mut self, epoch: u64)

Source

fn add_drb_result(&mut self, epoch: u64, drb_result: DrbResult)

Source

fn set_first_epoch(&mut self, epoch: u64, initial_drb_result: DrbResult)

Source

fn first_epoch(&self) -> Option<u64>

Source

fn get_epoch_drb(&self, epoch: u64) -> Result<DrbResult>

Source

fn add_da_committee( &mut self, first_epoch: u64, committee: Vec<TestStakeTableEntry<PubKey, StatePubKey>>, )

Provided Methods§

Source

fn stake( &self, pub_key: PubKey, epoch: Option<u64>, ) -> Option<TestStakeTableEntry<PubKey, StatePubKey>>

Source

fn da_stake( &self, pub_key: PubKey, epoch: Option<u64>, ) -> Option<TestStakeTableEntry<PubKey, StatePubKey>>

Source

fn add_quorum_committee( &mut self, _first_epoch: u64, _committee: Vec<TestStakeTableEntry<PubKey, StatePubKey>>, )

Register a quorum committee effective from first_epoch (inclusive). Mirrors add_da_committee; implementations without per-epoch quorum committees keep the panicking default.

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§

Source§

impl<PubKey, StatePubKey> TestStakeTable<PubKey, StatePubKey> for RandomizedStakeTable<PubKey, StatePubKey>

Source§

impl<PubKey, StatePubKey> TestStakeTable<PubKey, StatePubKey> for StaticStakeTable<PubKey, StatePubKey>

Source§

impl<PubKey, StatePubKey> TestStakeTable<PubKey, StatePubKey> for StaticStakeTableLeaderForTwoViews<PubKey, StatePubKey>

Source§

impl<PubKey, StatePubKey> TestStakeTable<PubKey, StatePubKey> for TwoStakeTables<PubKey, StatePubKey>

Source§

impl<PubKey: SignatureKey, StatePubKey: StateSignatureKey + LCV1StateSignatureKey + LCV2StateSignatureKey + LCV3StateSignatureKey, QuorumConfig: QuorumFilterConfig, DaConfig: QuorumFilterConfig> TestStakeTable<PubKey, StatePubKey> for RandomizedCommitteeMembers<PubKey, StatePubKey, QuorumConfig, DaConfig>