Implement BeaconBlockHeaders RPC method
This commit is contained in:
parent
766a79adfa
commit
56cd77ead8
@ -90,6 +90,11 @@ fn decode(packet: Vec<u8>) -> Result<RPCEvent, DecodeError> {
|
|||||||
BeaconBlockRootsRequest::ssz_decode(&packet, index)?;
|
BeaconBlockRootsRequest::ssz_decode(&packet, index)?;
|
||||||
RPCRequest::BeaconBlockRoots(block_roots_request)
|
RPCRequest::BeaconBlockRoots(block_roots_request)
|
||||||
}
|
}
|
||||||
|
RPCMethod::BeaconBlockHeaders => {
|
||||||
|
let (block_headers_request, _index) =
|
||||||
|
BeaconBlockHeadersRequest::ssz_decode(&packet, index)?;
|
||||||
|
RPCRequest::BeaconBlockHeaders(block_headers_request)
|
||||||
|
}
|
||||||
RPCMethod::Unknown | _ => return Err(DecodeError::UnknownRPCMethod),
|
RPCMethod::Unknown | _ => return Err(DecodeError::UnknownRPCMethod),
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -111,6 +116,10 @@ fn decode(packet: Vec<u8>) -> Result<RPCEvent, DecodeError> {
|
|||||||
let (body, _index) = BeaconBlockRootsResponse::ssz_decode(&packet, index)?;
|
let (body, _index) = BeaconBlockRootsResponse::ssz_decode(&packet, index)?;
|
||||||
RPCResponse::BeaconBlockRoots(body)
|
RPCResponse::BeaconBlockRoots(body)
|
||||||
}
|
}
|
||||||
|
RPCMethod::BeaconBlockHeaders => {
|
||||||
|
let (body, _index) = BeaconBlockHeadersResponse::ssz_decode(&packet, index)?;
|
||||||
|
RPCResponse::BeaconBlockHeaders(body)
|
||||||
|
}
|
||||||
RPCMethod::Unknown | _ => return Err(DecodeError::UnknownRPCMethod),
|
RPCMethod::Unknown | _ => return Err(DecodeError::UnknownRPCMethod),
|
||||||
};
|
};
|
||||||
Ok(RPCEvent::Response {
|
Ok(RPCEvent::Response {
|
||||||
|
Loading…
Reference in New Issue
Block a user