From 4ff256340a0a8b4fa1f7acbde8fce3cbaf0eabee Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 1 May 2024 09:48:55 +1000 Subject: [PATCH] Upgrade jsonrpc dependency to v0.18.0 Upgrade to the latest released `jsonrpc` version. --- client/Cargo.toml | 2 +- client/src/client.rs | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/client/Cargo.toml b/client/Cargo.toml index 1ec555d2..64a30d24 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -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" diff --git a/client/src/client.rs b/client/src/client.rs index 5074bf63..f2b10420 100644 --- a/client/src/client.rs +++ b/client/src/client.rs @@ -1320,15 +1320,8 @@ impl RpcApi for Client { cmd: &str, args: &[serde_json::Value], ) -> Result { - 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::>>()?; - 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)); }