mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 14:27:57 +00:00
JSON-RPC client generation (#2778)
* Bump jsonrpc & generate clients. * Initial version of JSON-RPC client. * Re-wort * Remove spurious `#[derive(Encode, Decode)]` They did not compile, since `Encode` and `Decode` are deliberately not implemented for `usize`. Fixes #2742. * Re-write rpc-client example. * Update to jsonrpc=12.0.0 * Remove unnecessary import * Bump version. * Revert version bump. * Bump again.
This commit is contained in:
committed by
Gavin Wood
parent
5df89a8a6f
commit
6112f815b3
@@ -17,7 +17,7 @@
|
||||
//! Substrate system API helpers.
|
||||
|
||||
use std::fmt;
|
||||
use serde::Serialize;
|
||||
use serde::{Serialize, Deserialize};
|
||||
use serde_json::{Value, map::Map};
|
||||
|
||||
/// Node properties
|
||||
@@ -37,7 +37,7 @@ pub struct SystemInfo {
|
||||
}
|
||||
|
||||
/// Health struct returned by the RPC
|
||||
#[derive(Debug, PartialEq, Serialize)]
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Health {
|
||||
/// Number of connected peers
|
||||
@@ -51,7 +51,7 @@ pub struct Health {
|
||||
}
|
||||
|
||||
/// Network Peer information
|
||||
#[derive(Debug, PartialEq, Serialize)]
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PeerInfo<Hash, Number> {
|
||||
/// Peer ID
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
//! Substrate system API.
|
||||
|
||||
pub mod error;
|
||||
pub mod helpers;
|
||||
|
||||
mod helpers;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
@@ -30,6 +30,8 @@ use runtime_primitives::traits::{self, Header as HeaderT};
|
||||
use self::error::Result;
|
||||
pub use self::helpers::{Properties, SystemInfo, Health, PeerInfo};
|
||||
|
||||
pub use self::gen_client::Client as SystemClient;
|
||||
|
||||
/// Substrate system RPC API
|
||||
#[rpc]
|
||||
pub trait SystemApi<Hash, Number> {
|
||||
|
||||
Reference in New Issue
Block a user