Implement Goodbye libp2p rpc request

This commit is contained in:
Age Manning 2019-03-20 10:05:17 +11:00
parent d229bc9ccb
commit 0e8b174770
No known key found for this signature in database
GPG Key ID: 05EED64B79E06A93

View File

@ -5,6 +5,7 @@ use types::{Epoch, Hash256, Slot};
#[derive(Debug)]
pub enum RPCMethod {
Hello,
Goodbye,
Unknown,
}
@ -12,6 +13,7 @@ impl From<u16> for RPCMethod {
fn from(method_id: u16) -> Self {
match method_id {
0 => RPCMethod::Hello,
1 => RPCMethod::Goodbye,
_ => RPCMethod::Unknown,
}
}
@ -21,6 +23,7 @@ impl Into<u16> for RPCMethod {
fn into(self) -> u16 {
match self {
RPCMethod::Hello => 0,
RPCMethod::Goodbye => 1,
_ => 0,
}
}
@ -29,6 +32,7 @@ impl Into<u16> for RPCMethod {
#[derive(Debug, Clone)]
pub enum RPCRequest {
Hello(HelloMessage),
Goodbye(u64),
}
#[derive(Debug, Clone)]