mithril_signer::store

Trait ProtocolInitializerStorer

source
pub trait ProtocolInitializerStorer: Sync + Send {
    // Required methods
    fn save_protocol_initializer<'life0, 'async_trait>(
        &'life0 self,
        epoch: Epoch,
        protocol_initializer: ProtocolInitializer,
    ) -> Pin<Box<dyn Future<Output = StdResult<Option<ProtocolInitializer>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_protocol_initializer<'life0, 'async_trait>(
        &'life0 self,
        epoch: Epoch,
    ) -> Pin<Box<dyn Future<Output = StdResult<Option<ProtocolInitializer>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_last_protocol_initializer<'life0, 'async_trait>(
        &'life0 self,
        last: usize,
    ) -> Pin<Box<dyn Future<Output = StdResult<Vec<(Epoch, ProtocolInitializer)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Store the ProtocolInitializer used for each Epoch. This is useful because protocol parameters and stake distribution change over time.

Required Methods§

source

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

Save a protocol initializer for the given Epoch.

source

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

Fetch a protocol initializer if any saved for the given Epoch.

source

fn get_last_protocol_initializer<'life0, 'async_trait>( &'life0 self, last: usize, ) -> Pin<Box<dyn Future<Output = StdResult<Vec<(Epoch, ProtocolInitializer)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the list of the N last saved protocol initializers if any.

Implementors§