mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-29 07:17:17 +00:00
Fix all matches relating to new RPC methods
This commit is contained in:
parent
9db36f15bf
commit
4105b869e1
@ -81,7 +81,7 @@ fn decode(packet: Vec<u8>) -> Result<RPCEvent, DecodeError> {
|
|||||||
let (hello_body, _index) = HelloMessage::ssz_decode(&packet, index)?;
|
let (hello_body, _index) = HelloMessage::ssz_decode(&packet, index)?;
|
||||||
RPCRequest::Hello(hello_body)
|
RPCRequest::Hello(hello_body)
|
||||||
}
|
}
|
||||||
RPCMethod::Unknown => return Err(DecodeError::UnknownRPCMethod),
|
RPCMethod::Unknown | _ => return Err(DecodeError::UnknownRPCMethod),
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(RPCEvent::Request {
|
Ok(RPCEvent::Request {
|
||||||
@ -97,7 +97,7 @@ fn decode(packet: Vec<u8>) -> Result<RPCEvent, DecodeError> {
|
|||||||
let (body, _index) = HelloMessage::ssz_decode(&packet, index)?;
|
let (body, _index) = HelloMessage::ssz_decode(&packet, index)?;
|
||||||
RPCResponse::Hello(body)
|
RPCResponse::Hello(body)
|
||||||
}
|
}
|
||||||
RPCMethod::Unknown => return Err(DecodeError::UnknownRPCMethod),
|
RPCMethod::Unknown | _ => return Err(DecodeError::UnknownRPCMethod),
|
||||||
};
|
};
|
||||||
Ok(RPCEvent::Response {
|
Ok(RPCEvent::Response {
|
||||||
id,
|
id,
|
||||||
@ -134,8 +134,11 @@ impl Encodable for RPCEvent {
|
|||||||
s.append(id);
|
s.append(id);
|
||||||
s.append(method_id);
|
s.append(method_id);
|
||||||
match body {
|
match body {
|
||||||
RPCRequest::Hello(body) => s.append(body),
|
RPCRequest::Hello(body) => {
|
||||||
};
|
s.append(body);
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
RPCEvent::Response {
|
RPCEvent::Response {
|
||||||
id,
|
id,
|
||||||
@ -149,6 +152,7 @@ impl Encodable for RPCEvent {
|
|||||||
RPCResponse::Hello(response) => {
|
RPCResponse::Hello(response) => {
|
||||||
s.append(response);
|
s.append(response);
|
||||||
}
|
}
|
||||||
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,6 +122,8 @@ impl MessageHandler {
|
|||||||
RPCRequest::Hello(hello_message) => {
|
RPCRequest::Hello(hello_message) => {
|
||||||
self.handle_hello_request(peer_id, id, hello_message)
|
self.handle_hello_request(peer_id, id, hello_message)
|
||||||
}
|
}
|
||||||
|
// TODO: Handle all requests
|
||||||
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,6 +140,8 @@ impl MessageHandler {
|
|||||||
debug!(self.log, "Hello response received from peer: {:?}", peer_id);
|
debug!(self.log, "Hello response received from peer: {:?}", peer_id);
|
||||||
self.validate_hello(peer_id, hello_message);
|
self.validate_hello(peer_id, hello_message);
|
||||||
}
|
}
|
||||||
|
// TODO: Handle all responses
|
||||||
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user