1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use super::*;

pub use near_jsonrpc_primitives::types::validator::{RpcValidatorError, RpcValidatorRequest};

pub type RpcValidatorResponse = near_primitives::views::EpochValidatorInfo;

impl RpcHandlerResponse for RpcValidatorResponse {}

impl RpcMethod for RpcValidatorRequest {
    type Response = RpcValidatorResponse;
    type Error = RpcValidatorError;

    fn method_name(&self) -> &str {
        "validators"
    }

    fn params(&self) -> Result<serde_json::Value, io::Error> {
        Ok(json!(self))
    }
}

impl private::Sealed for RpcValidatorRequest {}