Skip to content

Commit

Permalink
Upgrade jsonrpc dependency to v0.18.0
Browse files Browse the repository at this point in the history
Upgrade to the latest released `jsonrpc` version.
  • Loading branch information
tcharding committed May 1, 2024
1 parent 12bd0b1 commit 4ff2563
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ path = "src/lib.rs"
bitcoincore-rpc-json = { version = "0.18.0", path = "../json" }

log = "0.4.5"
jsonrpc = "0.14.0"
jsonrpc = { version = "0.18.0", features = [] }

# Used for deserialization of JSON.
serde = "1.0.156"
Expand Down
11 changes: 2 additions & 9 deletions client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1320,15 +1320,8 @@ impl RpcApi for Client {
cmd: &str,
args: &[serde_json::Value],
) -> Result<T> {
let raw_args: Vec<_> = args
.iter()
.map(|a| {
let json_string = serde_json::to_string(a)?;
serde_json::value::RawValue::from_string(json_string) // we can't use to_raw_value here due to compat with Rust 1.29
})
.map(|a| a.map_err(|e| Error::Json(e)))
.collect::<Result<Vec<_>>>()?;
let req = self.client.build_request(&cmd, &raw_args);
let raw = serde_json::value::to_raw_value(args)?;
let req = self.client.build_request(&cmd, Some(&*raw));
if log_enabled!(Debug) {
debug!(target: "bitcoincore_rpc", "JSON-RPC request: {} {}", cmd, serde_json::Value::from(args));
}
Expand Down

0 comments on commit 4ff2563

Please sign in to comment.