mithril_aggregator::services

Trait StakeDistributionService

source
pub trait StakeDistributionService: Sync + Send {
    // Required methods
    fn get_stake_distribution<'life0, 'async_trait>(
        &'life0 self,
        epoch: Epoch,
    ) -> Pin<Box<dyn Future<Output = Result<StakeDistribution, Box<StakePoolDistributionServiceError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_stake_distribution<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<StakePoolDistributionServiceError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Responsible of synchronizing with Cardano stake distribution.

Required Methods§

source

fn get_stake_distribution<'life0, 'async_trait>( &'life0 self, epoch: Epoch, ) -> Pin<Box<dyn Future<Output = Result<StakeDistribution, Box<StakePoolDistributionServiceError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the stake distribution fot the given epoch.

source

fn update_stake_distribution<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Box<StakePoolDistributionServiceError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

This launches the stake distribution computation if not already started.

Implementors§