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_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>>;
}
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_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>>>
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_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