mithril_aggregator/store/
pending_certificate_store.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use async_trait::async_trait;
use mithril_common::StdResult;

use mithril_common::entities::CertificatePending;

/// Store for [CertificatePending].
#[cfg_attr(test, mockall::automock)]
#[async_trait]
pub trait CertificatePendingStorer: Sync + Send {
    /// Fetch the current [CertificatePending] if any.
    async fn get(&self) -> StdResult<Option<CertificatePending>>;

    /// Save the given [CertificatePending].
    async fn save(&self, certificate: CertificatePending) -> StdResult<()>;

    /// Remove and return the current [CertificatePending] if any.
    async fn remove(&self) -> StdResult<Option<CertificatePending>>;
}