Add an RPC method for calling a contract. (#3563)

* Sketch

* Some work on docs.

* Doc improvements.

* More docs.

* Some more docs.

* Yet another comment.

* Bump impl_version.

* Accept the block hash

* Use NumberOrHex

* Update node/rpc/src/contracts.rs

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Move rpc/primitives
This commit is contained in:
Sergei Pepyakin
2019-09-12 13:30:10 +02:00
committed by GitHub
parent 294d172187
commit 4daac15d22
18 changed files with 279 additions and 27 deletions
+1
View File
@@ -17,6 +17,7 @@ runtime_version = { package = "sr-version", path = "../sr-version" }
serde_json = "1.0"
session = { package = "substrate-session", path = "../session" }
sr-primitives = { path = "../sr-primitives" }
rpc-primitives = { package = "substrate-rpc-primitives", path = "primitives" }
state_machine = { package = "substrate-state-machine", path = "../state-machine" }
substrate-executor = { path = "../executor" }
substrate-keystore = { path = "../keystore" }
+1
View File
@@ -19,3 +19,4 @@ runtime_version = { package = "sr-version", path = "../../sr-version" }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
txpool = { package = "substrate-transaction-graph", path = "../../transaction-pool/graph" }
rpc-primitives = { package = "substrate-rpc-primitives", path = "../../rpc/primitives" }
+1 -1
View File
@@ -17,12 +17,12 @@
//! Substrate blockchain API.
pub mod error;
pub mod number;
use jsonrpc_core::Result as RpcResult;
use jsonrpc_core::futures::Future;
use jsonrpc_derive::rpc;
use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId};
use rpc_primitives::number;
use self::error::{FutureResult, Result};
pub use self::gen_client::Client as ChainClient;
+9
View File
@@ -0,0 +1,9 @@
[package]
name = "substrate-rpc-primitives"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
serde = { version = "1.0", features = ["derive"] }
primitives = { package = "substrate-primitives", path = "../../primitives" }
+21
View File
@@ -0,0 +1,21 @@
// Copyright 2019 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
// Substrate is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Substrate is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
//! Substrate RPC primitives and utilities.
#![warn(missing_docs)]
pub mod number;
+1
View File
@@ -37,6 +37,7 @@ use client::{
};
use jsonrpc_pubsub::{typed::Subscriber, SubscriptionId};
use primitives::{H256, Blake2Hasher};
use rpc_primitives::number;
use sr_primitives::{
generic::{BlockId, SignedBlock},
traits::{Block as BlockT, Header, NumberFor},