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:
Tomasz Drwięga
2019-06-04 18:43:55 +02:00
committed by Gavin Wood
parent 5df89a8a6f
commit 6112f815b3
18 changed files with 289 additions and 103 deletions
+4 -2
View File
@@ -14,13 +14,15 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
//! Extrinsic helpers for author RPC module.
use primitives::Bytes;
use serde::Deserialize;
use serde::{Serialize, Deserialize};
/// RPC Extrinsic or hash
///
/// Allows to refer to extrinsic either by its raw representation or its hash.
#[derive(Debug, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum ExtrinsicOrHash<Hash> {
/// The hash of the extrinsic.
+8 -7
View File
@@ -16,6 +16,12 @@
//! Substrate block-author/full-node API.
pub mod error;
pub mod hash;
#[cfg(test)]
mod tests;
use std::sync::Arc;
use client::{self, Client};
@@ -27,6 +33,7 @@ use log::warn;
use parity_codec::{Encode, Decode};
use primitives::{Bytes, Blake2Hasher, H256};
use runtime_primitives::{generic, traits};
use self::error::Result;
use transaction_pool::{
txpool::{
ChainApi as PoolChainApi,
@@ -38,13 +45,7 @@ use transaction_pool::{
},
};
pub mod error;
mod hash;
#[cfg(test)]
mod tests;
use self::error::Result;
pub use self::gen_client::Client as AuthorClient;
/// Substrate authoring RPC API
#[rpc]