Add network channel into message handler

This commit is contained in:
Age Manning
2019-03-18 23:18:25 +11:00
parent be712f5b05
commit 0625bb6b03
3 changed files with 44 additions and 21 deletions

View File

@@ -2,7 +2,10 @@ use libp2p::PeerId;
use libp2p::{HelloMessage, RPCEvent};
use types::{Hash256, Slot};
//TODO: This module can be entirely replaced in the RPC rewrite
/// Messages between nodes across the network.
//TODO: Remove this in the RPC rewrite
#[derive(Debug, Clone)]
pub enum NodeMessage {
RPC(RPCEvent),
@@ -10,11 +13,3 @@ pub enum NodeMessage {
// TODO: only for testing - remove
Message(String),
}
/// Types of messages that the network service can receive.
#[derive(Debug, Clone)]
pub enum NetworkMessage {
/// Send a message to libp2p service.
//TODO: Define typing for messages across the wire
Send(PeerId, NodeMessage),
}