Skip to content

Commit

Permalink
Bump jsonrpsee from 0.6.1 to 0.8.0 (use-ink#433)
Browse files Browse the repository at this point in the history
* Bump jsonrpsee from 0.6.1 to 0.8.0

Bumps [jsonrpsee](https://github.com/paritytech/jsonrpsee) from 0.6.1 to 0.8.0.
- [Release notes](https://github.com/paritytech/jsonrpsee/releases)
- [Changelog](https://github.com/paritytech/jsonrpsee/blob/master/CHANGELOG.md)
- [Commits](paritytech/jsonrpsee@v0.6.1...v0.8.0)

---
updated-dependencies:
- dependency-name: jsonrpsee
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix jsonrpsee errors

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Jones <ascjones@gmail.com>
  • Loading branch information
dependabot[bot] and ascjones authored Feb 17, 2022
1 parent 8a39ac5 commit 438b31d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 87 deletions.
76 changes: 12 additions & 64 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pallet-contracts-primitives = "5.0.0"
subxt = "0.17.0"
futures = "0.3.19"
hex = "0.4.3"
jsonrpsee = { version = "0.6.1", features = ["ws-client"] }
jsonrpsee = { version = "0.8.0", features = ["ws-client"] }
nom = "7.1.0"
nom-supreme = "0.6.0"
indexmap = "1.8.0"
Expand Down
9 changes: 3 additions & 6 deletions src/cmd/extrinsics/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ use super::{
};
use crate::name_value_println;
use anyhow::Result;
use jsonrpsee::{
types::{to_json_value, traits::Client as _},
ws_client::WsClientBuilder,
};
use jsonrpsee::{core::client::ClientT, rpc_params, ws_client::WsClientBuilder};
use serde::Serialize;
use sp_core::Bytes;
use std::fmt::Debug;
Expand Down Expand Up @@ -92,8 +89,8 @@ impl CallCommand {
storage_deposit_limit,
input_data: Bytes(data),
};
let params = vec![to_json_value(call_request)?];
let result: ContractExecResult = cli.request("contracts_call", Some(params.into())).await?;
let params = rpc_params![call_request];
let result: ContractExecResult = cli.request("contracts_call", params).await?;

match result.result {
Ok(ref ret_val) => {
Expand Down
12 changes: 4 additions & 8 deletions src/cmd/extrinsics/instantiate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ use super::{
};
use crate::{name_value_println, util::decode_hex, Verbosity};
use anyhow::{anyhow, Context, Result};
use jsonrpsee::{
types::{to_json_value, traits::Client as _},
ws_client::WsClientBuilder,
};
use jsonrpsee::{core::client::ClientT, rpc_params, ws_client::WsClientBuilder};
use serde::Serialize;
use sp_core::{crypto::Ss58Codec, Bytes};
use std::{
Expand Down Expand Up @@ -298,10 +295,9 @@ impl<'a> Exec<'a> {
data: self.args.data.clone().into(),
salt: self.args.salt.clone(),
};
let params = vec![to_json_value(call_request)?];
let result: ContractInstantiateResult = cli
.request("contracts_instantiate", Some(params.into()))
.await?;
let params = rpc_params![call_request];
let result: ContractInstantiateResult =
cli.request("contracts_instantiate", params).await?;
Ok(result)
}
}
Expand Down
11 changes: 3 additions & 8 deletions src/cmd/extrinsics/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ use super::{
};
use crate::name_value_println;
use anyhow::{Context, Result};
use jsonrpsee::{
types::{to_json_value, traits::Client as _},
ws_client::WsClientBuilder,
};
use jsonrpsee::{core::client::ClientT, rpc_params, ws_client::WsClientBuilder};
use serde::Serialize;
use sp_core::Bytes;
use std::{fmt::Debug, path::PathBuf};
Expand Down Expand Up @@ -98,11 +95,9 @@ impl UploadCommand {
code: Bytes(code),
storage_deposit_limit,
};
let params = vec![to_json_value(call_request)?];
let params = rpc_params!(call_request);

let result: CodeUploadResult = cli
.request("contracts_upload_code", Some(params.into()))
.await?;
let result: CodeUploadResult = cli.request("contracts_upload_code", params).await?;

result.map_err(|e| anyhow::anyhow!("Failed to execute call via rpc: {:?}", e))
}
Expand Down

0 comments on commit 438b31d

Please sign in to comment.