From e20a116c3fc179d2a63c0e4bfe850e395c854ae3 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 1 May 2024 10:22:57 +1000 Subject: [PATCH] Add rand feature Currently we activate the "bitcoin/rand-std" feature unconditionally in `json`. Some users may not wish to use the bitcoin "rand" feature. Add a "rand" feature to `json` and `client` and use it to activate "rand-std" in `bitcoin`. --- client/Cargo.toml | 1 + integration_test/Cargo.toml | 2 +- json/Cargo.toml | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/Cargo.toml b/client/Cargo.toml index 3f1e01f4..574d243c 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -20,6 +20,7 @@ path = "src/lib.rs" [features] verifymessage = ["bitcoincore-rpc-json/verifymessage"] +rand = ["bitcoincore-rpc-json/rand"] [dependencies] bitcoincore-rpc-json = { version = "0.18.0", path = "../json" } diff --git a/integration_test/Cargo.toml b/integration_test/Cargo.toml index a0b8d2f1..4e27b1df 100644 --- a/integration_test/Cargo.toml +++ b/integration_test/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Steven Roose "] edition = "2018" [dependencies] -bitcoincore-rpc = { path = "../client", features = ["verifymessage"] } +bitcoincore-rpc = { path = "../client", features = ["verifymessage", "rand"] } bitcoin = { version = "0.32.0", features = ["serde", "rand", "base64"]} lazy_static = "1.4.0" log = "0.4" diff --git a/json/Cargo.toml b/json/Cargo.toml index 3f35db59..e3619718 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -21,9 +21,10 @@ path = "src/lib.rs" [features] verifymessage = ["bitcoin/base64"] +rand = ["bitcoin/rand-std"] [dependencies] serde = { version = "1.0.156", features = [ "derive" ] } serde_json = "1.0.96" -bitcoin = { version = "0.32.0", features = ["serde", "rand-std"] } +bitcoin = { version = "0.32.0", features = ["serde"] }