Trait mithril_signer::services::EpochService

source ·
pub trait EpochService: Sync + Send {
    // Required methods
    fn inform_epoch_settings<'life0, 'async_trait>(
        &'life0 mut self,
        epoch_settings: SignerEpochSettings,
        allowed_discriminants: BTreeSet<SignedEntityTypeDiscriminants>,
    ) -> 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 registration_protocol_parameters(&self) -> StdResult<&ProtocolParameters>;
    fn protocol_initializer(&self) -> StdResult<&Option<ProtocolInitializer>>;
    fn current_signers(&self) -> StdResult<&Vec<Signer>>;
    fn next_signers(&self) -> StdResult<&Vec<Signer>>;
    fn current_signers_with_stake<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = StdResult<Vec<SignerWithStake>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn next_signers_with_stake<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = StdResult<Vec<SignerWithStake>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn allowed_discriminants(
        &self,
    ) -> StdResult<&BTreeSet<SignedEntityTypeDiscriminants>>;
    fn cardano_transactions_signing_config(
        &self,
    ) -> StdResult<&Option<CardanoTransactionsSigningConfig>>;
    fn next_cardano_transactions_signing_config(
        &self,
    ) -> StdResult<&Option<CardanoTransactionsSigningConfig>>;
    fn can_signer_sign_current_epoch(
        &self,
        party_id: PartyId,
    ) -> StdResult<bool>;
}
Expand description

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

Required Methods§

source

fn inform_epoch_settings<'life0, 'async_trait>( &'life0 mut self, epoch_settings: SignerEpochSettings, allowed_discriminants: BTreeSet<SignedEntityTypeDiscriminants>, ) -> 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 epoch_of_current_data(&self) -> StdResult<Epoch>

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

source

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

Get protocol parameters for registration.

source

fn protocol_initializer(&self) -> StdResult<&Option<ProtocolInitializer>>

Get the protocol initializer for the current epoch if any

None if the signer can’t sign for the current 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 current_signers_with_stake<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = StdResult<Vec<SignerWithStake>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get signers with stake for the current epoch

source

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

Get signers with stake for the next epoch

source

fn allowed_discriminants( &self, ) -> StdResult<&BTreeSet<SignedEntityTypeDiscriminants>>

Get the list of signed entity types that are allowed to sign for the current epoch

source

fn cardano_transactions_signing_config( &self, ) -> StdResult<&Option<CardanoTransactionsSigningConfig>>

Get the cardano transactions signing configuration for the current epoch

source

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

Get the cardano transactions signing configuration for the next epoch

source

fn can_signer_sign_current_epoch(&self, party_id: PartyId) -> StdResult<bool>

Check if the given signer can sign for the current epoch

Implementors§