pub(crate) trait StakeTableDataSource<T: NodeType> {
// Required methods
fn get_stake_table(
&self,
epoch: Option<<T as NodeType>::Epoch>,
) -> 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<<T as NodeType>::Epoch>,
) -> 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: <T as NodeType>::Epoch,
) -> impl Send + Future<Output = Result<IndexMap<Address, Validator<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 previous_proposal_participation(
&self,
) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>;
fn get_all_validators(
&self,
epoch: <T as NodeType>::Epoch,
offset: u64,
limit: u64,
) -> impl Send + Future<Output = Result<Vec<Validator<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<<T as NodeType>::Epoch>,
) -> impl Send + Future<Output = Result<Vec<PeerConfig<T>>>>
fn get_stake_table( &self, epoch: Option<<T as NodeType>::Epoch>, ) -> 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<<T as NodeType>::Epoch>,
) -> impl Send + Future<Output = Result<Vec<PeerConfig<T>>>>
fn get_da_stake_table( &self, epoch: Option<<T as NodeType>::Epoch>, ) -> 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: <T as NodeType>::Epoch,
) -> impl Send + Future<Output = Result<IndexMap<Address, Validator<BLSPubKey>>>>
fn get_validators( &self, epoch: <T as NodeType>::Epoch, ) -> impl Send + Future<Output = Result<IndexMap<Address, Validator<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 previous_proposal_participation(
&self,
) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>
fn previous_proposal_participation( &self, ) -> impl Send + Future<Output = HashMap<BLSPubKey, f64>>
Get the previous proposal participation.
fn get_all_validators( &self, epoch: <T as NodeType>::Epoch, offset: u64, limit: u64, ) -> impl Send + Future<Output = Result<Vec<Validator<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", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<N: ConnectedNetwork<PubKey>, D: Sync, V: Versions, P: SequencerPersistence> StakeTableDataSource<SeqTypes> for ExtensibleDataSource<D, ApiState<N, P, V>>
impl<N: ConnectedNetwork<PubKey>, D: Sync, V: Versions, P: SequencerPersistence> StakeTableDataSource<SeqTypes> for ExtensibleDataSource<D, ApiState<N, P, V>>
Source§async fn get_stake_table(
&self,
epoch: Option<<SeqTypes as NodeType>::Epoch>,
) -> Result<Vec<PeerConfig<SeqTypes>>>
async fn get_stake_table( &self, epoch: Option<<SeqTypes as NodeType>::Epoch>, ) -> 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<<SeqTypes as NodeType>::Epoch>,
) -> Result<Vec<PeerConfig<SeqTypes>>>
async fn get_da_stake_table( &self, epoch: Option<<SeqTypes as NodeType>::Epoch>, ) -> 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: <SeqTypes as NodeType>::Epoch,
) -> Result<ValidatorMap>
async fn get_validators( &self, epoch: <SeqTypes as NodeType>::Epoch, ) -> Result<ValidatorMap>
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