mod consensus_graph_exposer;
mod network_exposer;
mod sync_graph_exposer;
pub use self::{
consensus_graph_exposer::{
ConsensusGraphBlockExecutionState, ConsensusGraphBlockState,
ConsensusGraphStates,
},
network_exposer::NetworkExposer,
sync_graph_exposer::{SyncGraphBlockState, SyncGraphStates},
};
use parking_lot::Mutex;
use std::sync::Arc;
pub type SharedStateExposer = Arc<StateExposer>;
pub struct StateExposer {
pub consensus_graph: Mutex<ConsensusGraphStates>,
pub sync_graph: Mutex<SyncGraphStates>,
pub network: Mutex<NetworkExposer>,
}
impl StateExposer {
pub fn new() -> Self {
Self {
consensus_graph: Mutex::new(Default::default()),
sync_graph: Mutex::new(Default::default()),
network: Mutex::new(Default::default()),
}
}
}
lazy_static! {
pub static ref STATE_EXPOSER: SharedStateExposer =
SharedStateExposer::new(StateExposer::new());
}