From d75c73087c02a75468a5bc0646be9f6fad8e5c5c 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 | 3 +++ integration_test/Cargo.toml | 2 +- json/Cargo.toml | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/client/Cargo.toml b/client/Cargo.toml index 1ec555d2..70adb8cd 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -18,6 +18,9 @@ edition = "2018" name = "bitcoincore_rpc" path = "src/lib.rs" +[features] +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 75b4a2be..95e7709c 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" } +bitcoincore-rpc = { path = "../client", features = ["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 6ff4659b..2c4f2db1 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -19,8 +19,11 @@ rust-version = "1.56.1" name = "bitcoincore_rpc_json" path = "src/lib.rs" +[features] +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"] }