diff --git a/.github/workflows/README.md b/.github/workflows/README.md index fb078c2..fc18863 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -23,6 +23,6 @@ Run from `rust.yml` unless stated otherwise. Total 11 jobs. 9. `Docsrs` 10. `Format` -+1 job for each supported version of Core. ++15 jobs - 1 for each supported version of Core. diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index dafdd56..df96b42 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -203,16 +203,9 @@ jobs: "26_1", "26_0", "25_2", - "25_1", - "25_0", "24_2", - "24_1", - "24_0_1", "23_2", - "23_1", - "23_0", "22_1", - "22_0", "0_21_2", "0_20_2", "0_19_1", diff --git a/integration_test/Cargo.toml b/integration_test/Cargo.toml index 7aabfa0..b319fc1 100644 --- a/integration_test/Cargo.toml +++ b/integration_test/Cargo.toml @@ -12,7 +12,7 @@ edition = "2021" # - `cargo test --no-default-features` skips all tests. [features] # Enable the same feature in `node` and the version feature here. -# All minor releases (but only the latest patch release). +# All minor releases of the latest three versions. 28_0 = ["v28", "node/28_0"] 27_2 = ["v27", "node/27_2"] 27_1 = ["v27", "node/27_1"] @@ -20,18 +20,11 @@ edition = "2021" 26_2 = ["v26", "node/26_2"] 26_1 = ["v26", "node/26_1"] 26_0 = ["v26", "node/26_0"] +# Only the latest minor version for older versions. 25_2 = ["v25", "node/25_2"] -25_1 = ["v25", "node/25_1"] -25_0 = ["v25", "node/25_0"] 24_2 = ["v24", "node/24_2"] -24_1 = ["v24", "node/24_1"] -24_0_1 = ["v24", "node/24_0_1"] 23_2 = ["v23", "node/23_2"] -23_1 = ["v23", "node/23_1"] -23_0 = ["v23", "node/23_0"] 22_1 = ["v22", "node/22_1"] -22_0 = ["v22", "node/22_0"] -# Only the latest minor version for these. 0_21_2 = ["v21", "node/0_21_2"] 0_20_2 = ["v20", "node/0_20_2"] 0_19_1 = ["v19", "node/0_19_1"] diff --git a/node/Cargo.toml b/node/Cargo.toml index 2d55eb8..9b3157a 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -44,7 +44,7 @@ default = ["28_0"] # download is not supposed to be used directly only through selecting one of the version feature download = ["bitcoin_hashes", "flate2", "tar", "minreq", "zip"] -# We support all minor releases (but only the latest patch release). +# We support all minor releases of the latest three versions. 28_0 = ["download", "27_2"] 27_2 = ["download", "27_1"] 27_1 = ["download", "27_0"] @@ -52,18 +52,11 @@ download = ["bitcoin_hashes", "flate2", "tar", "minreq", "zip"] 26_2 = ["download", "26_1"] 26_1 = ["download", "26_0"] 26_0 = ["download", "25_2"] -25_2 = ["download", "25_1"] -25_1 = ["download", "25_0"] -25_0 = ["download", "24_2"] -24_2 = ["download", "24_1"] -24_1 = ["download", "24_0_1"] -24_0_1 = ["download", "23_2"] -23_2 = ["download", "23_1"] -23_1 = ["download", "23_0"] -23_0 = ["download", "22_1"] -22_1 = ["download", "22_0"] -22_0 = ["download", "0_21_2"] -# We only support the latest minor version for these. +# We only support the latest minor version for older versions. +25_2 = ["download", "24_2"] +24_2 = ["download", "23_2"] +23_2 = ["download", "22_1"] +22_1 = ["download", "0_21_2"] 0_21_2 = ["download", "0_20_2"] 0_20_2 = ["download", "0_19_1"] 0_19_1 = ["download", "0_18_1"] diff --git a/node/build.rs b/node/build.rs index 1a65469..0b1fc5a 100644 --- a/node/build.rs +++ b/node/build.rs @@ -24,7 +24,7 @@ mod download { #[cfg(all(target_os = "macos", any(target_arch = "x86_64", target_arch = "aarch64"),))] fn download_filename() -> String { - if cfg!(not(feature = "23_1")) { + if cfg!(not(feature = "23_2")) { format!("bitcoin-{}-osx64.tar.gz", &VERSION) } else { format!("bitcoin-{}-x86_64-apple-darwin.tar.gz", &VERSION) @@ -43,7 +43,7 @@ mod download { #[allow(clippy::lines_filter_map_ok)] // clippy doesn't like the `lines` call below and the suggested fix is incorrect. fn get_expected_sha256(filename: &str) -> anyhow::Result { let sha256sums_filename = format!("sha256/bitcoin-core-{}-SHA256SUMS", &VERSION); - #[cfg(not(feature = "22_0"))] + #[cfg(not(feature = "22_1"))] let sha256sums_filename = format!("{}.asc", sha256sums_filename); let file = File::open(&sha256sums_filename) .with_context(|| format!("cannot find {:?}", sha256sums_filename))?; diff --git a/node/src/client_versions.rs b/node/src/client_versions.rs index 62cd266..c97a7c5 100644 --- a/node/src/client_versions.rs +++ b/node/src/client_versions.rs @@ -38,47 +38,19 @@ pub use corepc_client::{client_sync::v26::{Client, AddressType}, types::v26 as t #[allow(unused_imports)] // Not all users need the json types. pub use corepc_client::{client_sync::v25::{Client, AddressType}, types::v25 as types}; -#[cfg(all(feature = "25_1", not(feature = "25_2")))] -#[allow(unused_imports)] // Not all users need the json types. -pub use corepc_client::{client_sync::v25::{Client, AddressType}, types::v25 as types}; - -#[cfg(all(feature = "25_0", not(feature = "25_1")))] -#[allow(unused_imports)] // Not all users need the json types. -pub use corepc_client::{client_sync::v25::{Client, AddressType}, types::v25 as types}; - -#[cfg(all(feature = "24_2", not(feature = "25_0")))] +#[cfg(all(feature = "24_2", not(feature = "25_2")))] #[allow(unused_imports)] // Not all users need the json types. pub use corepc_client::{client_sync::v24::{Client, AddressType}, types::v24 as types}; -#[cfg(all(feature = "24_1", not(feature = "24_2")))] -#[allow(unused_imports)] // Not all users need the json types. -pub use corepc_client::{client_sync::v24::{Client, AddressType}, types::v24 as types}; - -#[cfg(all(feature = "24_0_1", not(feature = "24_1")))] -#[allow(unused_imports)] // Not all users need the json types. -pub use corepc_client::{client_sync::v24::{Client, AddressType}, types::v24 as types}; - -#[cfg(all(feature = "23_2", not(feature = "24_0_1")))] -#[allow(unused_imports)] // Not all users need the json types. -pub use corepc_client::{client_sync::v23::{Client, AddressType}, types::v23 as types}; - -#[cfg(all(feature = "23_1", not(feature = "23_2")))] -#[allow(unused_imports)] // Not all users need the json types. -pub use corepc_client::{client_sync::v23::{Client, AddressType}, types::v23 as types}; - -#[cfg(all(feature = "23_0", not(feature = "23_1")))] +#[cfg(all(feature = "23_2", not(feature = "24_2")))] #[allow(unused_imports)] // Not all users need the json types. pub use corepc_client::{client_sync::v23::{Client, AddressType}, types::v23 as types}; -#[cfg(all(feature = "22_1", not(feature = "23_0")))] -#[allow(unused_imports)] // Not all users need the json types. -pub use corepc_client::{client_sync::v22::{Client, AddressType}, types::v22 as types}; - -#[cfg(all(feature = "22_0", not(feature = "22_1")))] +#[cfg(all(feature = "22_1", not(feature = "23_2")))] #[allow(unused_imports)] // Not all users need the json types. pub use corepc_client::{client_sync::v22::{Client, AddressType}, types::v22 as types}; -#[cfg(all(feature = "0_21_2", not(feature = "22_0")))] +#[cfg(all(feature = "0_21_2", not(feature = "22_1")))] #[allow(unused_imports)] // Not all users need the json types. pub use corepc_client::{client_sync::v21::{Client, AddressType}, types::v21 as types}; @@ -99,6 +71,6 @@ pub use corepc_client::{client_sync::v18::{Client, AddressType}, types::v18 as t pub use corepc_client::{client_sync::v17::{Client, AddressType}, types::v17 as types}; // To make --no-default-features work we have to re-export a the types, use most recent version same as we do for all features. -#[cfg(all(not(feature = "28_0"), not(feature = "27_1"), not(feature = "27_0"), not(feature = "26_2"), not(feature = "26_1"), not(feature = "26_0"), not(feature = "25_2"), not(feature = "25_1"), not(feature = "25_0"), not(feature = "24_2"),not(feature = "24_1"), not(feature = "24_0_1"), not(feature = "23_2"), not(feature = "23_1"), not(feature = "23_0"), not(feature = "22_1"), not(feature = "22_0"), not(feature = "0_21_2"), not(feature = "0_20_2"), not(feature = "0_19_1"), not(feature = "0_18_1"), not(feature = "0_17_1")))] +#[cfg(all(not(feature = "28_0"), not(feature = "27_1"), not(feature = "27_0"), not(feature = "26_2"), not(feature = "26_1"), not(feature = "26_0"), not(feature = "25_2"), not(feature = "24_2"), not(feature = "23_2"), not(feature = "22_1"), not(feature = "0_21_2"), not(feature = "0_20_2"), not(feature = "0_19_1"), not(feature = "0_18_1"), not(feature = "0_17_1")))] #[allow(unused_imports)] // Not all users need the json types. pub use corepc_client::{client_sync::v28::{Client, AddressType}, types::v28 as types}; diff --git a/node/src/versions.rs b/node/src/versions.rs index 3360a7b..d217ce0 100644 --- a/node/src/versions.rs +++ b/node/src/versions.rs @@ -22,37 +22,16 @@ pub const VERSION: &str = "26.0"; #[cfg(all(feature = "25_2", not(feature = "26_0")))] pub const VERSION: &str = "25.2"; -#[cfg(all(feature = "25_1", not(feature = "25_2")))] -pub const VERSION: &str = "25.1"; - -#[cfg(all(feature = "25_0", not(feature = "25_1")))] -pub const VERSION: &str = "25.0"; - -#[cfg(all(feature = "24_2", not(feature = "25_0")))] +#[cfg(all(feature = "24_2", not(feature = "25_2")))] pub const VERSION: &str = "24.2"; -#[cfg(all(feature = "24_1", not(feature = "24_2")))] -pub const VERSION: &str = "24.1"; - -#[cfg(all(feature = "24_0_1", not(feature = "24_1")))] -pub const VERSION: &str = "24.0.1"; - -#[cfg(all(feature = "23_2", not(feature = "24_0_1")))] +#[cfg(all(feature = "23_2", not(feature = "24_2")))] pub const VERSION: &str = "23.2"; -#[cfg(all(feature = "23_1", not(feature = "23_2")))] -pub const VERSION: &str = "23.1"; - -#[cfg(all(feature = "23_0", not(feature = "23_1")))] -pub const VERSION: &str = "23.0"; - -#[cfg(all(feature = "22_1", not(feature = "23_0")))] +#[cfg(all(feature = "22_1", not(feature = "23_2")))] pub const VERSION: &str = "22.1"; -#[cfg(all(feature = "22_0", not(feature = "22_1")))] -pub const VERSION: &str = "22.0"; - -#[cfg(all(feature = "0_21_2", not(feature = "22_0")))] +#[cfg(all(feature = "0_21_2", not(feature = "22_1")))] pub const VERSION: &str = "0.21.2"; #[cfg(all(feature = "0_20_2", not(feature = "0_21_2")))] @@ -68,6 +47,6 @@ pub const VERSION: &str = "0.18.1"; pub const VERSION: &str = "0.17.1"; // To make --no-default-features work we have to enable some feature, use most recent version same as for default. -#[cfg(all(not(feature = "28_0"), not(feature = "27_1"), not(feature = "27_0"), not(feature = "26_2"), not(feature = "26_1"), not(feature = "26_0"), not(feature = "25_2"), not(feature = "25_1"), not(feature = "25_0"), not(feature = "24_2"),not(feature = "24_1"), not(feature = "24_0_1"), not(feature = "23_2"), not(feature = "23_1"), not(feature = "23_0"), not(feature = "22_1"), not(feature = "22_0"), not(feature = "0_21_2"), not(feature = "0_20_2"), not(feature = "0_19_1"), not(feature = "0_18_1"), not(feature = "0_17_1")))] +#[cfg(all(not(feature = "28_0"), not(feature = "27_1"), not(feature = "27_0"), not(feature = "26_2"), not(feature = "26_1"), not(feature = "26_0"), not(feature = "25_2"), not(feature = "24_2"), not(feature = "23_2"), not(feature = "22_1"), not(feature = "0_21_2"), not(feature = "0_20_2"), not(feature = "0_19_1"), not(feature = "0_18_1"), not(feature = "0_17_1")))] #[allow(dead_code)] // for --no-default-features pub const VERSION: &str = "28.0";