Skip to content

Commit e1c6ec4

Browse files
committed
Merge rust-bitcoin#342: Add "rand" feature
af66cfe Add rand feature (Tobin C. Harding) Pull request description: 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`. The crates currently have no features, this is the first. In order to be less of a breaking change also add a "default" feature and enable "rand" from "default". ACKs for top commit: apoelstra: ACK af66cfe Tree-SHA512: 50e8c5b17bd20623ce2f4c46cf2fcdd0eec6fb3c177a68536033b50d9ae5f4e57be9a8f2e8223a0a9855f3c1c704d3b258878bb7e9bdfc03c8362ab8e02fe7b3
2 parents 7fefd90 + af66cfe commit e1c6ec4

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

client/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ edition = "2018"
1818
name = "bitcoincore_rpc"
1919
path = "src/lib.rs"
2020

21+
[features]
22+
default = ["rand"]
23+
rand = ["bitcoincore-rpc-json/rand"]
24+
2125
[dependencies]
2226
bitcoincore-rpc-json = { version = "0.18.0", path = "../json" }
2327

integration_test/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["Steven Roose <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8-
bitcoincore-rpc = { path = "../client" }
8+
bitcoincore-rpc = { path = "../client", features = ["rand"] }
99
bitcoin = { version = "0.32.0", features = ["serde", "rand"] }
1010
lazy_static = "1.4.0"
1111
log = "0.4"

json/Cargo.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ rust-version = "1.56.1"
1919
name = "bitcoincore_rpc_json"
2020
path = "src/lib.rs"
2121

22+
[features]
23+
default = ["rand"]
24+
rand = ["bitcoin/rand-std"]
25+
2226
[dependencies]
2327
serde = { version = "1", features = [ "derive" ] }
2428
serde_json = "1"
2529

26-
bitcoin = { version = "0.32.0", features = ["serde", "rand-std"] }
30+
bitcoin = { version = "0.32.0", features = ["serde"] }

0 commit comments

Comments
 (0)