1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
pub mod author;
pub mod chain;
pub mod grandpa;
pub mod state;
pub mod system;
#[cfg(any(feature = "isahc-client", feature = "ureq-client"))]
pub mod client;
use serde::Serialize;
use serde_json::{json, Value};
const DEFAULT_ID: u8 = 1;
pub fn rpc(id: impl Serialize, method: impl Serialize, params: impl Serialize) -> Value {
json!({
"jsonrpc": "2.0",
"id": id,
"method": method,
"params": params
})
}
#[cfg(feature = "tracing")]
pub fn debug_rpc(rpc: Value) -> Value {
tracing::debug!("{}", rpc);
rpc
}