Skip to content

Commit 05d7b7e

Browse files
committed
Set default feature to 0_17_1
In `node` and `integration_test`. In #45 we removed the default feature because we were setting it to `28_0` and this was a footgun because downstream crates needed to explicitly use no default features. This change made it impossible to build the crate without selecting a version feature which implicitly means `--no-default-features` does not work. Instead we can set the default to `0_17_1` and then the crate builds with no default features and also downstream users who select a higher version get correct behaviour because higher versions override lower ones.
1 parent d658ae3 commit 05d7b7e

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

integration_test/Cargo.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@ license = "CC0-1.0"
66
description = "Integration tests for corepc"
77
edition = "2021"
88

9-
# Please note, in this crate the version features are mutally exclusive.
9+
# Please note, it is expected that a single version feature will be enabled however if you enable
10+
# multiple the highest version number will take precedence.
1011
#
11-
# - `cargo test --all-features` is the same as `cargo test --features=v26_2`
12-
# - `cargo test --no-default-features` skips all tests.
12+
# - `cargo test --features=27_2,download` to download Bitcoin Core binary `v27.2`.
13+
# - `cargo test --features=28_0` to use `bitcoind` from the host environment.
14+
# - `cargo test` is equivalent to `cargo test --features=0_17_1`.
15+
# - `cargo test --all-features`: Same as using latest version.
16+
# - `cargo test --no-default-features` does not work, you MUST enable a version feature.
1317
[features]
18+
default = ["0_17_1"]
19+
1420
# Enable the same feature in `node` and the version feature here.
1521
# All minor releases of the latest three versions.
1622
28_0 = ["v28", "node/28_0"]

node/Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@ zip = { version = "0.6", optional = true }
3636
#
3737
# - `cargo test --features=27_2,download` to download Bitcoin Core binary `v27.2`.
3838
# - `cargo test --features=28_0` to use `bitcoind` from the host environment.
39-
# - `cargo test --all-features`: Same as using latest version e.g., `cargo test --features=20_0,download`
40-
# - `cargo test`: Does not work, you MUST enable a version feature.
39+
# - `cargo test` is equivalent to `cargo test --features=0_17_1`.
40+
# - `cargo test --all-features`: Same as using latest version.
41+
# - `cargo test --no-default-features` does not work, you MUST enable a version feature.
4142
[features]
43+
default = ["0_17_1"]
44+
4245
download = ["anyhow", "bitcoin_hashes", "flate2", "tar", "minreq", "zip"]
4346

4447
# We support all minor releases of the latest three versions.

0 commit comments

Comments
 (0)