Skip to content

Commit 1d2e1a4

Browse files
committed
Upgrade jsonrpc dependency to v0.18.0
Upgrade to the latest released `jsonrpc` version.
1 parent c2eeee3 commit 1d2e1a4

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ rand = ["bitcoincore-rpc-json/rand"]
2626
bitcoincore-rpc-json = { version = "0.18.0", path = "../json" }
2727

2828
log = "0.4.5"
29-
jsonrpc = "0.14.0"
29+
jsonrpc = { version = "0.18.0", features = [] }
3030

3131
# Used for deserialization of JSON.
3232
serde = "1.0.156"

client/src/client.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,15 +1321,8 @@ impl RpcApi for Client {
13211321
cmd: &str,
13221322
args: &[serde_json::Value],
13231323
) -> Result<T> {
1324-
let raw_args: Vec<_> = args
1325-
.iter()
1326-
.map(|a| {
1327-
let json_string = serde_json::to_string(a)?;
1328-
serde_json::value::RawValue::from_string(json_string) // we can't use to_raw_value here due to compat with Rust 1.29
1329-
})
1330-
.map(|a| a.map_err(|e| Error::Json(e)))
1331-
.collect::<Result<Vec<_>>>()?;
1332-
let req = self.client.build_request(&cmd, &raw_args);
1324+
let raw = serde_json::value::to_raw_value(args)?;
1325+
let req = self.client.build_request(&cmd, Some(&*raw));
13331326
if log_enabled!(Debug) {
13341327
debug!(target: "bitcoincore_rpc", "JSON-RPC request: {} {}", cmd, serde_json::Value::from(args));
13351328
}

0 commit comments

Comments
 (0)