Fix all matches relating to new RPC methods

This commit is contained in:
Age Manning
2019-03-20 10:54:19 +11:00
parent 9db36f15bf
commit 4105b869e1
2 changed files with 12 additions and 4 deletions

View File

@@ -81,7 +81,7 @@ fn decode(packet: Vec<u8>) -> Result<RPCEvent, DecodeError> {
let (hello_body, _index) = HelloMessage::ssz_decode(&packet, index)?;
RPCRequest::Hello(hello_body)
}
RPCMethod::Unknown => return Err(DecodeError::UnknownRPCMethod),
RPCMethod::Unknown | _ => return Err(DecodeError::UnknownRPCMethod),
};
Ok(RPCEvent::Request {
@@ -97,7 +97,7 @@ fn decode(packet: Vec<u8>) -> Result<RPCEvent, DecodeError> {
let (body, _index) = HelloMessage::ssz_decode(&packet, index)?;
RPCResponse::Hello(body)
}
RPCMethod::Unknown => return Err(DecodeError::UnknownRPCMethod),
RPCMethod::Unknown | _ => return Err(DecodeError::UnknownRPCMethod),
};
Ok(RPCEvent::Response {
id,
@@ -134,8 +134,11 @@ impl Encodable for RPCEvent {
s.append(id);
s.append(method_id);
match body {
RPCRequest::Hello(body) => s.append(body),
};
RPCRequest::Hello(body) => {
s.append(body);
}
_ => {}
}
}
RPCEvent::Response {
id,
@@ -149,6 +152,7 @@ impl Encodable for RPCEvent {
RPCResponse::Hello(response) => {
s.append(response);
}
_ => {}
}
}
}