mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-17 03:42:46 +00:00
Complete initial testing of new RPC
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
use ssz::{impl_decode_via_from, impl_encode_via_from};
|
||||
use ssz_derive::{Decode, Encode};
|
||||
use types::{BeaconBlockBody, BeaconBlockHeader, Epoch, Hash256, Slot};
|
||||
use types::{BeaconBlockBody, Epoch, Hash256, Slot};
|
||||
|
||||
/* Request/Response data structures for RPC methods */
|
||||
|
||||
@@ -136,11 +136,6 @@ pub struct BeaconBlockHeadersResponse {
|
||||
pub headers: Vec<u8>,
|
||||
}
|
||||
|
||||
#[derive(Encode, Decode, Debug)]
|
||||
pub struct EncodeableBeaconBlockHeadersResponse {
|
||||
pub headers: Vec<BeaconBlockHeader>,
|
||||
}
|
||||
|
||||
/// Request a number of beacon block bodies from a peer.
|
||||
#[derive(Encode, Decode, Clone, Debug, PartialEq)]
|
||||
pub struct BeaconBlockBodiesRequest {
|
||||
@@ -208,16 +203,6 @@ pub enum RPCErrorResponse {
|
||||
}
|
||||
|
||||
impl RPCErrorResponse {
|
||||
/// If a response has no payload, returns the variant corresponding to the code.
|
||||
pub fn internal_data(response_code: u8) -> Option<RPCErrorResponse> {
|
||||
match response_code {
|
||||
// EncodingError
|
||||
1 => Some(RPCErrorResponse::EncodingError),
|
||||
// All others require further data
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Used to encode the response.
|
||||
pub fn as_u8(&self) -> u8 {
|
||||
match self {
|
||||
|
||||
Reference in New Issue
Block a user