1
2
3
4
5
6
7
8
9
10
11
12
13
use async_trait::async_trait;
use hotshot_types::traits::signature_key::SignatureKey;

use super::request::Request;

/// A trait that allows the [`RequestResponseProtocol`] to get the recipients that a specific message should
/// expect responses from. In `HotShot` this would go on top of the [`Membership`] trait and determine
/// which nodes are able (quorum/DA) to respond to which requests
#[async_trait]
pub trait RecipientSource<K: SignatureKey + 'static>: Send + Sync + 'static {
    /// Get all the recipients that the specific request should expect responses from
    async fn get_recipients_for<R: Request>(&self, request: &R) -> Vec<K>;
}