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§
Sourcefn get_stake_table(
&self,
epoch: Option<EpochNumber>,
) -> impl Send + Future<Output = Result<Vec<PeerConfig<T>>>>
fn get_stake_table( &self, epoch: Option<EpochNumber>, ) -> impl Send + Future<Output = Result<Vec<PeerConfig<T>>>>
Get the stake table for a given epoch
Sourcefn get_stake_table_current(
&self,
) -> impl Send + Future<Output = Result<StakeTableWithEpochNumber<T>>>
fn get_stake_table_current( &self, ) -> impl Send + Future<Output = Result<StakeTableWithEpochNumber<T>>>
Get the stake table for the current epoch if not provided
Sourcefn get_da_stake_table(
&self,
epoch: Option<EpochNumber>,
) -> impl Send + Future<Output = Result<Vec<PeerConfig<T>>>>
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
Sourcefn get_da_stake_table_current(
&self,
) -> impl Send + Future<Output = Result<StakeTableWithEpochNumber<T>>>
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
Sourcefn get_validators(
&self,
epoch: EpochNumber,
) -> impl Send + Future<Output = Result<IndexMap<Address, AuthenticatedValidator<BLSPubKey>>>>
fn get_validators( &self, epoch: EpochNumber, ) -> impl Send + Future<Output = Result<IndexMap<Address, AuthenticatedValidator<BLSPubKey>>>>
Get all the validators
fn get_block_reward( &self, epoch: Option<EpochNumber>, ) -> impl Send + Future<Output = Result<Option<RewardAmount>>>
Sourcefn current_proposal_participation(
&self,
) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>
fn current_proposal_participation( &self, ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>
Get the current proposal participation.
Sourcefn proposal_participation(
&self,
epoch: EpochNumber,
) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>
fn proposal_participation( &self, epoch: EpochNumber, ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>
Get the proposal participation for a given epoch.
Sourcefn current_vote_participation(
&self,
) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>
fn current_vote_participation( &self, ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>
Get the current vote participation.
Sourcefn vote_participation(
&self,
epoch: EpochNumber,
) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>
fn vote_participation( &self, epoch: EpochNumber, ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>
Get the vote participation for a given epoch.
fn get_all_validators( &self, epoch: EpochNumber, offset: u64, limit: u64, ) -> impl Send + Future<Output = Result<Vec<RegisteredValidator<PubKey>>>>
Sourcefn stake_table_events(
&self,
from_l1_block: u64,
to_l1_block: u64,
) -> impl Send + Future<Output = Result<Vec<StakeTableEvent>>>
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>
impl<D: Sync> StakeTableDataSource<SeqTypes> for ExtensibleDataSource<D, ApiState>
Source§async fn get_stake_table(
&self,
epoch: Option<EpochNumber>,
) -> Result<Vec<PeerConfig<SeqTypes>>>
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>>
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>>>
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>>
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>
async fn get_validators( &self, epoch: EpochNumber, ) -> Result<AuthenticatedValidatorMap>
Get all the validators
Source§async fn current_proposal_participation(&self) -> HashMap<PubKey, f64>
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>
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>
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>
async fn vote_participation(&self, epoch: EpochNumber) -> HashMap<PubKey, f64>
Get all the vote participation for a given epoch