mithril_aggregator/store/
verification_key_store.rs1use async_trait::async_trait;
2use mithril_common::StdResult;
3use std::collections::HashMap;
4
5use mithril_common::entities::{Epoch, PartyId, Signer, SignerWithStake};
6
7#[cfg_attr(test, mockall::automock)]
12#[async_trait]
13pub trait VerificationKeyStorer: Sync + Send {
14 async fn save_verification_key(
17 &self,
18 epoch: Epoch,
19 signer: SignerWithStake,
20 ) -> StdResult<Option<SignerWithStake>>;
21
22 async fn get_verification_keys(
24 &self,
25 epoch: Epoch,
26 ) -> StdResult<Option<HashMap<PartyId, Signer>>>;
27
28 async fn get_signers(&self, epoch: Epoch) -> StdResult<Option<Vec<SignerWithStake>>>;
30
31 async fn prune_verification_keys(&self, max_epoch_to_prune: Epoch) -> StdResult<()>;
33}