diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index c1aec02c00919b59af649d40143598b207025bc6..bba0fc2f6fe7859de933a68c758cddfd4a0ff2cb 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -4052,6 +4052,7 @@ dependencies = [ "sr-primitives 2.0.0", "srml-contracts-rpc-runtime-api 2.0.0", "substrate-client 2.0.0", + "substrate-primitives 2.0.0", "substrate-rpc-primitives 2.0.0", ] diff --git a/substrate/srml/contracts/rpc/Cargo.toml b/substrate/srml/contracts/rpc/Cargo.toml index 8ebb714e2053906af3024fef9d6072dd02202cda..90bf34bec1fd9fefe3768cd849af835d1e5b45d4 100644 --- a/substrate/srml/contracts/rpc/Cargo.toml +++ b/substrate/srml/contracts/rpc/Cargo.toml @@ -10,8 +10,8 @@ codec = { package = "parity-scale-codec", version = "1.0.0" } jsonrpc-core = "13.2.0" jsonrpc-core-client = "13.2.0" jsonrpc-derive = "13.2.0" +primitives = { package = "substrate-primitives", path = "../../../core/primitives" } rpc-primitives = { package = "substrate-rpc-primitives", path = "../../../core/rpc/primitives" } serde = { version = "1.0.101", features = ["derive"] } sr-primitives = { path = "../../../core/sr-primitives" } srml-contracts-rpc-runtime-api = { path = "./runtime-api" } - diff --git a/substrate/srml/contracts/rpc/src/lib.rs b/substrate/srml/contracts/rpc/src/lib.rs index 7e17aaaf177cc17b266015d8b6e93f5cd8362e84..ba50bd12f030034bf5370c66de28e26b40f06f2b 100644 --- a/substrate/srml/contracts/rpc/src/lib.rs +++ b/substrate/srml/contracts/rpc/src/lib.rs @@ -23,6 +23,7 @@ use client::blockchain::HeaderBackend; use codec::Codec; use jsonrpc_core::{Error, ErrorCode, Result}; use jsonrpc_derive::rpc; +use primitives::Bytes; use sr_primitives::{ generic::BlockId, traits::{Block as BlockT, ProvideRuntimeApi}, @@ -41,7 +42,7 @@ pub struct CallRequest<AccountId, Balance> { dest: AccountId, value: Balance, gas_limit: number::NumberOrHex<u64>, - input_data: Vec<u8>, + input_data: Bytes, } /// Contracts RPC methods. @@ -111,7 +112,7 @@ where })?; let exec_result = api - .call(&at, origin, dest, value, gas_limit, input_data) + .call(&at, origin, dest, value, gas_limit, input_data.to_vec()) .map_err(|e| Error { code: ErrorCode::ServerError(RUNTIME_ERROR), message: "Runtime trapped while executing a contract.".into(),