massa_pool_exports/
channels.rs

1use massa_execution_exports::ExecutionController;
2use massa_models::{endorsement::SecureShareEndorsement, operation::SecureShareOperation};
3use massa_pos_exports::SelectorController;
4
5/// channels used by the pool worker
6#[derive(Clone)]
7pub struct PoolChannels {
8    /// Communication with the execution module
9    pub execution_controller: Box<dyn ExecutionController>,
10    /// Selector to get draws
11    pub selector: Box<dyn SelectorController>,
12    /// Broadcasts used by the pool worker to send new operations and endorsements
13    pub broadcasts: PoolBroadcasts,
14    /// Local chain id, folded into the signed hash of endorsements / block headers
15    /// when creating denunciations (F90 / PDF #11).
16    pub chain_id: u64,
17}
18
19/// Broadcasts used by the pool worker to send new operations and endorsements
20#[derive(Clone)]
21pub struct PoolBroadcasts {
22    /// Broadcast channel for new endorsements
23    pub endorsement_sender: tokio::sync::broadcast::Sender<SecureShareEndorsement>,
24    /// Broadcast channel for new operations
25    pub operation_sender: tokio::sync::broadcast::Sender<SecureShareOperation>,
26}