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§
sourcefn 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 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.
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 registration_protocol_parameters(&self) -> StdResult<&ProtocolParameters>
fn registration_protocol_parameters(&self) -> StdResult<&ProtocolParameters>
Get protocol parameters for registration.
sourcefn protocol_initializer(&self) -> StdResult<&Option<ProtocolInitializer>>
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.
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 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 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
sourcefn 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 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
sourcefn allowed_discriminants(
&self,
) -> StdResult<&BTreeSet<SignedEntityTypeDiscriminants>>
fn allowed_discriminants( &self, ) -> StdResult<&BTreeSet<SignedEntityTypeDiscriminants>>
Get the list of signed entity types that are allowed to sign for the current epoch
sourcefn cardano_transactions_signing_config(
&self,
) -> StdResult<&Option<CardanoTransactionsSigningConfig>>
fn cardano_transactions_signing_config( &self, ) -> StdResult<&Option<CardanoTransactionsSigningConfig>>
Get the cardano transactions signing configuration for the current epoch
sourcefn next_cardano_transactions_signing_config(
&self,
) -> StdResult<&Option<CardanoTransactionsSigningConfig>>
fn next_cardano_transactions_signing_config( &self, ) -> StdResult<&Option<CardanoTransactionsSigningConfig>>
Get the cardano transactions signing configuration for the next epoch
sourcefn can_signer_sign_current_epoch(&self, party_id: PartyId) -> StdResult<bool>
fn can_signer_sign_current_epoch(&self, party_id: PartyId) -> StdResult<bool>
Check if the given signer can sign for the current epoch