Trait mithril_persistence::store::StakeStorer

source ·
pub trait StakeStorer: Sync + Send {
    // Required methods
    fn save_stakes<'life0, 'async_trait>(
        &'life0 self,
        epoch: Epoch,
        stakes: StakeDistribution,
    ) -> Pin<Box<dyn Future<Output = StdResult<Option<StakeDistribution>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_stakes<'life0, 'async_trait>(
        &'life0 self,
        epoch: Epoch,
    ) -> Pin<Box<dyn Future<Output = StdResult<Option<StakeDistribution>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Represent a way to store the stake of mithril party members.

Required Methods§

source

fn save_stakes<'life0, 'async_trait>( &'life0 self, epoch: Epoch, stakes: StakeDistribution, ) -> Pin<Box<dyn Future<Output = StdResult<Option<StakeDistribution>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Save the stakes in the store for a given epoch.

source

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

Get the stakes of all party at a given epoch.

Implementors§