Skip to main content

StakeTableDataSource

Trait StakeTableDataSource 

Source
pub(crate) trait StakeTableDataSource<T: NodeType> {
    // Required methods
    fn get_stake_table(
        &self,
        epoch: Option<EpochNumber>,
    ) -> impl Send + Future<Output = Result<Vec<PeerConfig<T>>>>;
    fn get_stake_table_current(
        &self,
    ) -> impl Send + Future<Output = Result<StakeTableWithEpochNumber<T>>>;
    fn get_da_stake_table(
        &self,
        epoch: Option<EpochNumber>,
    ) -> impl Send + Future<Output = Result<Vec<PeerConfig<T>>>>;
    fn get_da_stake_table_current(
        &self,
    ) -> impl Send + Future<Output = Result<StakeTableWithEpochNumber<T>>>;
    fn get_validators(
        &self,
        epoch: EpochNumber,
    ) -> impl Send + Future<Output = Result<IndexMap<Address, AuthenticatedValidator<BLSPubKey>>>>;
    fn get_block_reward(
        &self,
        epoch: Option<EpochNumber>,
    ) -> impl Send + Future<Output = Result<Option<RewardAmount>>>;
    fn current_proposal_participation(
        &self,
    ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>;
    fn proposal_participation(
        &self,
        epoch: EpochNumber,
    ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>;
    fn current_vote_participation(
        &self,
    ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>;
    fn vote_participation(
        &self,
        epoch: EpochNumber,
    ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>;
    fn get_all_validators(
        &self,
        epoch: EpochNumber,
        offset: u64,
        limit: u64,
    ) -> impl Send + Future<Output = Result<Vec<RegisteredValidator<PubKey>>>>;
    fn stake_table_events(
        &self,
        from_l1_block: u64,
        to_l1_block: u64,
    ) -> impl Send + Future<Output = Result<Vec<StakeTableEvent>>>;
}

Required Methods§

Source

fn get_stake_table( &self, epoch: Option<EpochNumber>, ) -> impl Send + Future<Output = Result<Vec<PeerConfig<T>>>>

Get the stake table for a given epoch

Source

fn get_stake_table_current( &self, ) -> impl Send + Future<Output = Result<StakeTableWithEpochNumber<T>>>

Get the stake table for the current epoch if not provided

Source

fn get_da_stake_table( &self, epoch: Option<EpochNumber>, ) -> impl Send + Future<Output = Result<Vec<PeerConfig<T>>>>

Get the DA stake table for a given epoch

Source

fn get_da_stake_table_current( &self, ) -> impl Send + Future<Output = Result<StakeTableWithEpochNumber<T>>>

Get the DA stake table for the current epoch if not provided

Source

fn get_validators( &self, epoch: EpochNumber, ) -> impl Send + Future<Output = Result<IndexMap<Address, AuthenticatedValidator<BLSPubKey>>>>

Get all the validators

Source

fn get_block_reward( &self, epoch: Option<EpochNumber>, ) -> impl Send + Future<Output = Result<Option<RewardAmount>>>

Source

fn current_proposal_participation( &self, ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>

Get the current proposal participation.

Source

fn proposal_participation( &self, epoch: EpochNumber, ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>

Get the proposal participation for a given epoch.

Source

fn current_vote_participation( &self, ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>

Get the current vote participation.

Source

fn vote_participation( &self, epoch: EpochNumber, ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>

Get the vote participation for a given epoch.

Source

fn get_all_validators( &self, epoch: EpochNumber, offset: u64, limit: u64, ) -> impl Send + Future<Output = Result<Vec<RegisteredValidator<PubKey>>>>

Source

fn stake_table_events( &self, from_l1_block: u64, to_l1_block: u64, ) -> impl Send + Future<Output = Result<Vec<StakeTableEvent>>>

Get stake table events from L1 blocks from_l1_block..=to_l1_block.

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<D: Sync> StakeTableDataSource<SeqTypes> for ExtensibleDataSource<D, ApiState>

Source§

async fn get_stake_table( &self, epoch: Option<EpochNumber>, ) -> Result<Vec<PeerConfig<SeqTypes>>>

Get the stake table for a given epoch

Source§

async fn get_stake_table_current( &self, ) -> Result<StakeTableWithEpochNumber<SeqTypes>>

Get the stake table for the current epoch if not provided

Source§

async fn get_da_stake_table( &self, epoch: Option<EpochNumber>, ) -> Result<Vec<PeerConfig<SeqTypes>>>

Get the DA stake table for a given epoch

Source§

async fn get_da_stake_table_current( &self, ) -> Result<StakeTableWithEpochNumber<SeqTypes>>

Get the DA stake table for the current epoch if not provided

Source§

async fn get_validators( &self, epoch: EpochNumber, ) -> Result<AuthenticatedValidatorMap>

Get all the validators

Source§

async fn current_proposal_participation(&self) -> HashMap<PubKey, f64>

Get all the validator participation for the current epoch

Source§

async fn proposal_participation( &self, epoch: EpochNumber, ) -> HashMap<PubKey, f64>

Get all the validator participation for the previous epoch

Source§

async fn current_vote_participation(&self) -> HashMap<PubKey, f64>

Get all the vote participation for the current epoch

Source§

async fn vote_participation(&self, epoch: EpochNumber) -> HashMap<PubKey, f64>

Get all the vote participation for a given epoch

Source§

async fn get_block_reward( &self, epoch: Option<EpochNumber>, ) -> Result<Option<RewardAmount>>

Source§

async fn get_all_validators( &self, epoch: EpochNumber, offset: u64, limit: u64, ) -> Result<Vec<RegisteredValidator<PubKey>>>

Source§

async fn stake_table_events( &self, from_l1_block: u64, to_l1_block: u64, ) -> Result<Vec<StakeTableEvent>>

Source§

impl<T, D> StakeTableDataSource<T> for Arc<D>
where T: NodeType, D: StakeTableDataSource<T> + Sync + Send,

Source§

fn get_stake_table( &self, epoch: Option<EpochNumber>, ) -> impl Send + Future<Output = Result<Vec<PeerConfig<T>>>>

Source§

fn get_stake_table_current( &self, ) -> impl Send + Future<Output = Result<StakeTableWithEpochNumber<T>>>

Source§

fn get_da_stake_table( &self, epoch: Option<EpochNumber>, ) -> impl Send + Future<Output = Result<Vec<PeerConfig<T>>>>

Source§

fn get_da_stake_table_current( &self, ) -> impl Send + Future<Output = Result<StakeTableWithEpochNumber<T>>>

Source§

fn get_validators( &self, epoch: EpochNumber, ) -> impl Send + Future<Output = Result<IndexMap<Address, AuthenticatedValidator<BLSPubKey>>>>

Source§

fn get_block_reward( &self, epoch: Option<EpochNumber>, ) -> impl Send + Future<Output = Result<Option<RewardAmount>>>

Source§

fn current_proposal_participation( &self, ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>

Source§

fn proposal_participation( &self, epoch: EpochNumber, ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>

Source§

fn current_vote_participation( &self, ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>

Source§

fn vote_participation( &self, epoch: EpochNumber, ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>

Source§

fn get_all_validators( &self, epoch: EpochNumber, offset: u64, limit: u64, ) -> impl Send + Future<Output = Result<Vec<RegisteredValidator<PubKey>>>>

Source§

fn stake_table_events( &self, from_l1_block: u64, to_l1_block: u64, ) -> impl Send + Future<Output = Result<Vec<StakeTableEvent>>>

Implementors§