use crate::{block, rpc, validator};
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct Request {
height: block::Height,
}
impl Request {
pub fn new(height: block::Height) -> Self {
Self { height }
}
}
impl rpc::Request for Request {
type Response = Response;
fn method(&self) -> rpc::Method {
rpc::Method::Validators
}
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Response {
pub block_height: block::Height,
pub validators: Vec<validator::Info>,
}
impl rpc::Response for Response {}