Implement Goodbye libp2p rpc request
This commit is contained in:
parent
d229bc9ccb
commit
0e8b174770
@ -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)]
|
||||
|
Loading…
Reference in New Issue
Block a user