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§
sourcefn 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 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.
sourcefn 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 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
.
sourcefn 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 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
.
sourcefn cardano_era(&self) -> StdResult<CardanoEra>
fn cardano_era(&self) -> StdResult<CardanoEra>
Get the current Cardano era.
sourcefn mithril_era(&self) -> StdResult<SupportedEra>
fn mithril_era(&self) -> StdResult<SupportedEra>
Get the current Mithril era.
sourcefn epoch_of_current_data(&self) -> StdResult<Epoch>
fn epoch_of_current_data(&self) -> StdResult<Epoch>
Get the current epoch for which the data stored in this service are computed.
sourcefn current_protocol_parameters(&self) -> StdResult<&ProtocolParameters>
fn current_protocol_parameters(&self) -> StdResult<&ProtocolParameters>
Get protocol parameters used for signing in the current epoch.
sourcefn next_protocol_parameters(&self) -> StdResult<&ProtocolParameters>
fn next_protocol_parameters(&self) -> StdResult<&ProtocolParameters>
Get protocol parameters used for signing in the next epoch.
sourcefn signer_registration_protocol_parameters(
&self,
) -> StdResult<&ProtocolParameters>
fn signer_registration_protocol_parameters( &self, ) -> StdResult<&ProtocolParameters>
Get protocol parameters for signer registration.
sourcefn current_cardano_transactions_signing_config(
&self,
) -> StdResult<&CardanoTransactionsSigningConfig>
fn current_cardano_transactions_signing_config( &self, ) -> StdResult<&CardanoTransactionsSigningConfig>
Get cardano transactions signing configuration used in current epoch
sourcefn next_cardano_transactions_signing_config(
&self,
) -> StdResult<&CardanoTransactionsSigningConfig>
fn next_cardano_transactions_signing_config( &self, ) -> StdResult<&CardanoTransactionsSigningConfig>
Get next cardano transactions signing configuration used in next epoch
sourcefn current_aggregate_verification_key(
&self,
) -> StdResult<&ProtocolAggregateVerificationKey>
fn current_aggregate_verification_key( &self, ) -> StdResult<&ProtocolAggregateVerificationKey>
Get aggregate verification key for current epoch
sourcefn next_aggregate_verification_key(
&self,
) -> StdResult<&ProtocolAggregateVerificationKey>
fn next_aggregate_verification_key( &self, ) -> StdResult<&ProtocolAggregateVerificationKey>
Get next aggregate verification key for next epoch
sourcefn current_signers_with_stake(&self) -> StdResult<&Vec<SignerWithStake>>
fn current_signers_with_stake(&self) -> StdResult<&Vec<SignerWithStake>>
Get signers with stake for the current epoch
sourcefn next_signers_with_stake(&self) -> StdResult<&Vec<SignerWithStake>>
fn next_signers_with_stake(&self) -> StdResult<&Vec<SignerWithStake>>
Get signers with stake for the next epoch
sourcefn current_signers(&self) -> StdResult<&Vec<Signer>>
fn current_signers(&self) -> StdResult<&Vec<Signer>>
Get signers for the current epoch
sourcefn next_signers(&self) -> StdResult<&Vec<Signer>>
fn next_signers(&self) -> StdResult<&Vec<Signer>>
Get signers for the next epoch
sourcefn total_stakes_signers(&self) -> StdResult<Stake>
fn total_stakes_signers(&self) -> StdResult<Stake>
Get the total stakes of signers for the current epoch
sourcefn total_next_stakes_signers(&self) -> StdResult<Stake>
fn total_next_stakes_signers(&self) -> StdResult<Stake>
Get the total stakes of signers for the next epoch
sourcefn protocol_multi_signer(&self) -> StdResult<&ProtocolMultiSigner>
fn protocol_multi_signer(&self) -> StdResult<&ProtocolMultiSigner>
Get the protocol multi signer for the current epoch
sourcefn next_protocol_multi_signer(&self) -> StdResult<&ProtocolMultiSigner>
fn next_protocol_multi_signer(&self) -> StdResult<&ProtocolMultiSigner>
Get the protocol multi signer for the next epoch
sourcefn signed_entity_config(&self) -> StdResult<&SignedEntityConfig>
fn signed_entity_config(&self) -> StdResult<&SignedEntityConfig>
Get the SignedEntityConfig for the current epoch.
sourcefn total_spo(&self) -> StdResult<TotalSPOs>
fn total_spo(&self) -> StdResult<TotalSPOs>
Get the total number of SPOs for the current epoch in the Cardano stake distribution.
sourcefn total_stake(&self) -> StdResult<Stake>
fn total_stake(&self) -> StdResult<Stake>
Get the total stake for the current epoch in the Cardano stake distribution.