mithril_aggregator/services/signature_consumer/
interface.rs

1use mithril_common::{
2    entities::{SignedEntityType, SingleSignature},
3    StdResult,
4};
5
6/// A signature consumer which blocks until messages are available.
7#[cfg_attr(test, mockall::automock)]
8#[async_trait::async_trait]
9pub trait SignatureConsumer: Sync + Send {
10    /// Returns signatures when available
11    async fn get_signatures(&self) -> StdResult<Vec<(SingleSignature, SignedEntityType)>>;
12
13    /// Returns the origin tag of the consumer (e.g. HTTP or DMQ)
14    fn get_origin_tag(&self) -> String;
15}