From dfc5f8615da41b293e47a2bb7d889a9530f9e620 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. --- Cargo-minimal.lock | 42 ++++++++++-------------------------------- Cargo-recent.lock | 42 ++++++++++-------------------------------- client/Cargo.toml | 2 +- client/src/client.rs | 8 ++------ 4 files changed, 23 insertions(+), 71 deletions(-) diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock index 762f15b9..3a8c3cc5 100644 --- a/Cargo-minimal.lock +++ b/Cargo-minimal.lock @@ -20,8 +20,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c8d66485a3a2ea485c1913c4572ce0256067a5377ac8c75c4960e1cda98605f" dependencies = [ - "bitcoin-internals 0.3.0", - "bitcoin_hashes 0.14.0", + "bitcoin-internals", + "bitcoin_hashes", ] [[package]] @@ -44,22 +44,16 @@ checksum = "7170e7750a20974246f17ece04311b4205a6155f1db564c5b224af817663c3ea" dependencies = [ "base58ck", "bech32", - "bitcoin-internals 0.3.0", + "bitcoin-internals", "bitcoin-io", "bitcoin-units", - "bitcoin_hashes 0.14.0", - "hex-conservative 0.2.0", + "bitcoin_hashes", + "hex-conservative", "hex_lit", "secp256k1", "serde", ] -[[package]] -name = "bitcoin-internals" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" - [[package]] name = "bitcoin-internals" version = "0.3.0" @@ -81,20 +75,10 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb54da0b28892f3c52203a7191534033e051b6f4b52bc15480681b57b7e036f5" dependencies = [ - "bitcoin-internals 0.3.0", + "bitcoin-internals", "serde", ] -[[package]] -name = "bitcoin_hashes" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" -dependencies = [ - "bitcoin-internals 0.2.0", - "hex-conservative 0.1.1", -] - [[package]] name = "bitcoin_hashes" version = "0.14.0" @@ -102,7 +86,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" dependencies = [ "bitcoin-io", - "hex-conservative 0.2.0", + "hex-conservative", "serde", ] @@ -181,12 +165,6 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" -[[package]] -name = "hex-conservative" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" - [[package]] name = "hex-conservative" version = "0.2.0" @@ -240,9 +218,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jsonrpc" -version = "0.14.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8128f36b47411cd3f044be8c1f5cc0c9e24d1d1bfdc45f0a57897b32513053f2" +checksum = "3662a38d341d77efecb73caf01420cfa5aa63c0253fd7bc05289ef9f6616e1bf" dependencies = [ "base64", "serde", @@ -362,7 +340,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3" dependencies = [ - "bitcoin_hashes 0.13.0", + "bitcoin_hashes", "rand", "secp256k1-sys", "serde", diff --git a/Cargo-recent.lock b/Cargo-recent.lock index 762f15b9..3a8c3cc5 100644 --- a/Cargo-recent.lock +++ b/Cargo-recent.lock @@ -20,8 +20,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c8d66485a3a2ea485c1913c4572ce0256067a5377ac8c75c4960e1cda98605f" dependencies = [ - "bitcoin-internals 0.3.0", - "bitcoin_hashes 0.14.0", + "bitcoin-internals", + "bitcoin_hashes", ] [[package]] @@ -44,22 +44,16 @@ checksum = "7170e7750a20974246f17ece04311b4205a6155f1db564c5b224af817663c3ea" dependencies = [ "base58ck", "bech32", - "bitcoin-internals 0.3.0", + "bitcoin-internals", "bitcoin-io", "bitcoin-units", - "bitcoin_hashes 0.14.0", - "hex-conservative 0.2.0", + "bitcoin_hashes", + "hex-conservative", "hex_lit", "secp256k1", "serde", ] -[[package]] -name = "bitcoin-internals" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" - [[package]] name = "bitcoin-internals" version = "0.3.0" @@ -81,20 +75,10 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb54da0b28892f3c52203a7191534033e051b6f4b52bc15480681b57b7e036f5" dependencies = [ - "bitcoin-internals 0.3.0", + "bitcoin-internals", "serde", ] -[[package]] -name = "bitcoin_hashes" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" -dependencies = [ - "bitcoin-internals 0.2.0", - "hex-conservative 0.1.1", -] - [[package]] name = "bitcoin_hashes" version = "0.14.0" @@ -102,7 +86,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" dependencies = [ "bitcoin-io", - "hex-conservative 0.2.0", + "hex-conservative", "serde", ] @@ -181,12 +165,6 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" -[[package]] -name = "hex-conservative" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" - [[package]] name = "hex-conservative" version = "0.2.0" @@ -240,9 +218,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jsonrpc" -version = "0.14.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8128f36b47411cd3f044be8c1f5cc0c9e24d1d1bfdc45f0a57897b32513053f2" +checksum = "3662a38d341d77efecb73caf01420cfa5aa63c0253fd7bc05289ef9f6616e1bf" dependencies = [ "base64", "serde", @@ -362,7 +340,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3" dependencies = [ - "bitcoin_hashes 0.13.0", + "bitcoin_hashes", "rand", "secp256k1-sys", "serde", diff --git a/client/Cargo.toml b/client/Cargo.toml index a9ff7ec3..65049ef4 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" diff --git a/client/src/client.rs b/client/src/client.rs index c97a0174..2f809a79 100644 --- a/client/src/client.rs +++ b/client/src/client.rs @@ -1313,12 +1313,8 @@ impl RpcApi for Client { cmd: &str, args: &[serde_json::Value], ) -> Result { - let raw_args: Vec<_> = args - .iter() - .map(serde_json::value::to_raw_value) - .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)); }