pub trait EpochService: Sync + Send {
    // Required methods
    fn inform_epoch<'life0, 'async_trait>(
        &'life0 mut self,
        epoch: Epoch
    ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_protocol_parameters<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn precompute_epoch_data<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn epoch_of_current_data(&self) -> StdResult<Epoch>;
    fn current_protocol_parameters(&self) -> StdResult<&ProtocolParameters>;
    fn next_protocol_parameters(&self) -> StdResult<&ProtocolParameters>;
    fn upcoming_protocol_parameters(&self) -> StdResult<&ProtocolParameters>;
    fn current_aggregate_verification_key(
        &self
    ) -> StdResult<&ProtocolAggregateVerificationKey>;
    fn next_aggregate_verification_key(
        &self
    ) -> StdResult<&ProtocolAggregateVerificationKey>;
    fn current_signers_with_stake(&self) -> StdResult<&Vec<SignerWithStake>>;
    fn next_signers_with_stake(&self) -> StdResult<&Vec<SignerWithStake>>;
    fn protocol_multi_signer(&self) -> StdResult<&ProtocolMultiSigner>;
}
Expand description

Service that aggregates all data that don’t change in a given epoch.

Required Methods§

source

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

Inform the service a new epoch has been detected, telling it to update its internal state for the new epoch.

source

fn update_protocol_parameters<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Insert future protocol parameters in the store based on this service current epoch.

Note: must be called after inform_epoch.

source

fn precompute_epoch_data<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Inform the service that it can precompute data for its current epoch.

Note: must be called after inform_epoch.

source

fn epoch_of_current_data(&self) -> StdResult<Epoch>

Get the current epoch for which the data stored in this service are computed.

source

fn current_protocol_parameters(&self) -> StdResult<&ProtocolParameters>

Get protocol parameters used in current epoch (associated with the previous epoch)

source

fn next_protocol_parameters(&self) -> StdResult<&ProtocolParameters>

Get next protocol parameters used in next epoch (associated with the actual epoch)

source

fn upcoming_protocol_parameters(&self) -> StdResult<&ProtocolParameters>

Get upcoming protocol parameters used in next epoch (associated with the next epoch)

source

fn current_aggregate_verification_key( &self ) -> StdResult<&ProtocolAggregateVerificationKey>

Get aggregate verification key for current epoch

source

fn next_aggregate_verification_key( &self ) -> StdResult<&ProtocolAggregateVerificationKey>

Get next aggregate verification key for next epoch

source

fn current_signers_with_stake(&self) -> StdResult<&Vec<SignerWithStake>>

Get signers with stake for the current epoch

source

fn next_signers_with_stake(&self) -> StdResult<&Vec<SignerWithStake>>

Get signers with stake for the next epoch

source

fn protocol_multi_signer(&self) -> StdResult<&ProtocolMultiSigner>

Get the protocol multi signer for the current epoch

Implementors§