Skip to content

Commit

Permalink
Merge #342: Add "rand" feature
Browse files Browse the repository at this point in the history
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
  • Loading branch information
apoelstra committed May 14, 2024
2 parents 7fefd90 + af66cfe commit e1c6ec4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ edition = "2018"
name = "bitcoincore_rpc"
path = "src/lib.rs"

[features]
default = ["rand"]
rand = ["bitcoincore-rpc-json/rand"]

[dependencies]
bitcoincore-rpc-json = { version = "0.18.0", path = "../json" }

Expand Down
2 changes: 1 addition & 1 deletion integration_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Steven Roose <steven@stevenroose.org>"]
edition = "2018"

[dependencies]
bitcoincore-rpc = { path = "../client" }
bitcoincore-rpc = { path = "../client", features = ["rand"] }
bitcoin = { version = "0.32.0", features = ["serde", "rand"] }
lazy_static = "1.4.0"
log = "0.4"
6 changes: 5 additions & 1 deletion json/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ rust-version = "1.56.1"
name = "bitcoincore_rpc_json"
path = "src/lib.rs"

[features]
default = ["rand"]
rand = ["bitcoin/rand-std"]

[dependencies]
serde = { version = "1", features = [ "derive" ] }
serde_json = "1"

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

0 comments on commit e1c6ec4

Please sign in to comment.