Trait mithril_aggregator::services::EpochService

source ·
pub trait EpochService: Sync + Send {
Show 24 methods // 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_epoch_settings<'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 cardano_era(&self) -> StdResult<CardanoEra>; fn mithril_era(&self) -> StdResult<SupportedEra>; fn epoch_of_current_data(&self) -> StdResult<Epoch>; fn current_protocol_parameters(&self) -> StdResult<&ProtocolParameters>; fn next_protocol_parameters(&self) -> StdResult<&ProtocolParameters>; fn signer_registration_protocol_parameters( &self, ) -> StdResult<&ProtocolParameters>; fn current_cardano_transactions_signing_config( &self, ) -> StdResult<&CardanoTransactionsSigningConfig>; fn next_cardano_transactions_signing_config( &self, ) -> StdResult<&CardanoTransactionsSigningConfig>; 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 current_signers(&self) -> StdResult<&Vec<Signer>>; fn next_signers(&self) -> StdResult<&Vec<Signer>>; fn total_stakes_signers(&self) -> StdResult<Stake>; fn total_next_stakes_signers(&self) -> StdResult<Stake>; fn protocol_multi_signer(&self) -> StdResult<&ProtocolMultiSigner>; fn next_protocol_multi_signer(&self) -> StdResult<&ProtocolMultiSigner>; fn signed_entity_config(&self) -> StdResult<&SignedEntityConfig>; fn total_spo(&self) -> StdResult<TotalSPOs>; fn total_stake(&self) -> StdResult<Stake>;
}
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_epoch_settings<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = StdResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Insert future epoch settings in the store based on this service current epoch (epoch offset +2).

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 cardano_era(&self) -> StdResult<CardanoEra>

Get the current Cardano era.

source

fn mithril_era(&self) -> StdResult<SupportedEra>

Get the current Mithril era.

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 for signing in the current epoch.

source

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

Get protocol parameters used for signing in the next epoch.

source

fn signer_registration_protocol_parameters( &self, ) -> StdResult<&ProtocolParameters>

Get protocol parameters for signer registration.

source

fn current_cardano_transactions_signing_config( &self, ) -> StdResult<&CardanoTransactionsSigningConfig>

Get cardano transactions signing configuration used in current epoch

source

fn next_cardano_transactions_signing_config( &self, ) -> StdResult<&CardanoTransactionsSigningConfig>

Get next cardano transactions signing configuration used in 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 current_signers(&self) -> StdResult<&Vec<Signer>>

Get signers for the current epoch

source

fn next_signers(&self) -> StdResult<&Vec<Signer>>

Get signers for the next epoch

source

fn total_stakes_signers(&self) -> StdResult<Stake>

Get the total stakes of signers for the current epoch

source

fn total_next_stakes_signers(&self) -> StdResult<Stake>

Get the total stakes of signers for the next epoch

source

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

Get the protocol multi signer for the current epoch

source

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

Get the protocol multi signer for the next epoch

source

fn signed_entity_config(&self) -> StdResult<&SignedEntityConfig>

Get the SignedEntityConfig for the current epoch.

source

fn total_spo(&self) -> StdResult<TotalSPOs>

Get the total number of SPOs for the current epoch in the Cardano stake distribution.

source

fn total_stake(&self) -> StdResult<Stake>

Get the total stake for the current epoch in the Cardano stake distribution.

Implementors§