mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-08-24 22:29:22 +00:00
feat: added consensus and networking mocks
This commit is contained in:
@@ -9,6 +9,7 @@ serde_json.workspace = true
|
||||
env_logger.workspace = true
|
||||
log.workspace = true
|
||||
serde.workspace = true
|
||||
tokio.workspace = true
|
||||
|
||||
[dependencies.networking]
|
||||
path = "../networking"
|
||||
+22
-1
@@ -1 +1,22 @@
|
||||
//ToDo: Add consensus module
|
||||
use std::sync::Arc;
|
||||
|
||||
use networking::peer_manager::PeerManager;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
#[derive(Debug)]
|
||||
///Entrypoint to consensus.
|
||||
/// Manages consensus protocol.
|
||||
pub struct ConsensusManager {
|
||||
pub peer_manager: Arc<Mutex<PeerManager>>,
|
||||
}
|
||||
|
||||
impl ConsensusManager {
|
||||
pub fn new(peer_manager: Arc<Mutex<PeerManager>>) -> Self {
|
||||
Self { peer_manager }
|
||||
}
|
||||
|
||||
//ToDo: change block from generic value into struct, when data block will be defined
|
||||
pub fn vote(&self, _block: serde_json::Value) -> bool {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user