Skip to content

Commit 2d34081

Browse files
committed
Upgrade jsonrpc dependency to v0.18.0
Upgrade to the latest released `jsonrpc` version.
1 parent d71ac1b commit 2d34081

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

client/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ verifymessage = ["bitcoincore-rpc-json/verifymessage"]
2525
bitcoincore-rpc-json = { version = "0.18.0", path = "../json" }
2626

2727
log = "0.4.5"
28-
jsonrpc = "0.14.0"
28+
jsonrpc = { version = "0.18.0", features = [] }
2929

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

client/src/client.rs

+2-9
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)