rpc_misc.rs 443 B

123456789101112131415
  1. use serde_json::{json, Value};
  2. use darkfi::rpc::{jsonrpc, jsonrpc::JsonResult};
  3. use super::Darkfid;
  4. impl Darkfid {
  5. // RPCAPI:
  6. // Returns a `pong` to the `ping` request.
  7. // --> {"jsonrpc": "2.0", "method": "ping", "params": [], "id": 1}
  8. // <-- {"jsonrpc": "2.0", "result": "pong", "id": 1}
  9. pub async fn pong(&self, id: Value, _params: &[Value]) -> JsonResult {
  10. jsonrpc::response(json!("pong"), id).into()
  11. }
  12. }