use crate::{abci, block, rpc};
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
pub struct Request {
height: Option<block::Height>,
}
impl Request {
pub fn new(height: block::Height) -> Self {
Self {
height: Some(height),
}
}
}
impl rpc::Request for Request {
type Response = Response;
fn method(&self) -> rpc::Method {
rpc::Method::BlockResults
}
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Response {
pub height: block::Height,
pub results: abci::Responses,
}
impl rpc::Response for Response {}