Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Support latest Bitcoin Core v26 minor version
Browse files Browse the repository at this point in the history
Bitcoin Core versions `26.1` and `26.2` are out, we should support both.
  • Loading branch information
tcharding committed Aug 29, 2024
1 parent 73be7c9 commit ef0fc39
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ jobs:
matrix:
feature:
[
"26_2",
"26_1",
"26_0",
"25_2",
"25_1",
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v26.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ crate::impl_client_v17__generatetoaddress!();

// == Network ==
crate::impl_client_v17__getnetworkinfo!();
crate::impl_client_check_expected_server_version!({ [260000] });
crate::impl_client_check_expected_server_version!({ [260000, 260100, 260200] });

// == Rawtransactions ==
crate::impl_client_v17__sendrawtransaction!();
Expand Down
8 changes: 4 additions & 4 deletions contrib/run_bitcoind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ COMMAND
- stop Kill all bitcoind nodes using 'pkill bitcoind'.
KNOWN_VERSION
- v26 Bitcoin Core v26.0
- v26 Bitcoin Core v26.2
- v25 Bitcoin Core v25.2
- v24 Bitcoin Core v24.2
- v23 Bitcoin Core v23.2
Expand All @@ -48,7 +48,7 @@ main() {

case $cmd in
all)
start "v26" # 26.0
start "v26" # 26.2
start "v25" # 25.2
start "v24" # 24.2
start "v23" # 23.2
Expand Down Expand Up @@ -83,8 +83,8 @@ start() {

case $version in
v26)
local version_number="26.0"
local version_id="260"
local version_number="26.2"
local version_id="262"
;;

v25)
Expand Down
4 changes: 3 additions & 1 deletion integration_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ edition = "2021"

# Please note, in this crate the version features are mutally exclusive.
#
# - `cargo test --all-features` is the same as `cargo test --features=v26_0`
# - `cargo test --all-features` is the same as `cargo test --features=v26_2`
# - `cargo test --no-default-features` skips all tests.
[features]
# Enable the same feature in `bitcoind` and the version feature here.
# All minor releases (but only the latest patch release).
"26_2" = ["v26", "bitcoind/26_2"]
"26_1" = ["v26", "bitcoind/26_1"]
"26_0" = ["v26", "bitcoind/26_0"]
"25_2" = ["v25", "bitcoind/25_2"]
"25_1" = ["v25", "bitcoind/25_1"]
Expand Down
2 changes: 1 addition & 1 deletion integration_test/tests/v26_api.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Test the JSON-RPC API against `bitcoind v26.0`.
//! Test the JSON-RPC API against `bitcoind v26`.
#![cfg(feature = "v26")]

Expand Down
8 changes: 5 additions & 3 deletions regtest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ anyhow = "1.0.66"

# Please note, in this crate the version features are mutally exclusive.
#
# - `cargo test --all-features` is the same as `cargo test --features=v26_0`
# - `cargo test --no-default-features` uses `v26_0` also.
# - `cargo test --all-features` is the same as `cargo test --features=v26_2`
# - `cargo test --no-default-features` uses `v26_2` also.
[features]
# 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).
"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"]
Expand All @@ -65,7 +67,7 @@ anyhow = "1.0.66"


[package.metadata.docs.rs]
features = ["download", "doc", "26_0"]
features = ["download", "doc", "26_2"]
rustdoc-args = ["--cfg", "docsrs"]

[patch.crates-io.bitcoind-json-rpc-client]
Expand Down
27 changes: 27 additions & 0 deletions regtest/sha256/bitcoin-core-26.1-SHA256SUMS
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
401c093314fb517d801d4930155e5bf9fb67f45408fa81fda8dd44dd5cd915b6 bitcoin-26.1-aarch64-linux-gnu-debug.tar.gz
e198461d981b675d39caaec4d5e69e79d7fd52c3d3508f5821e2effe7d4f12c2 bitcoin-26.1-aarch64-linux-gnu.tar.gz
f515ac510dc685a8466ca09c2180b60c0be2e7eb24b46aaf80e7e3e3fa650e37 bitcoin-26.1-arm-linux-gnueabihf-debug.tar.gz
7e655c8fd72277f6b3467ae2330e5b24913f5e06089ffb24ec4464d961d5e0c2 bitcoin-26.1-arm-linux-gnueabihf.tar.gz
8f0bdc51733a94f83cb96a215943291de64b501bbe0298a9b897f79d8ad517e9 bitcoin-26.1-arm64-apple-darwin.zip
ac5ec560807023d33ea4a5d01c61b7ea8ba9d1756fda1408d96f5c403d3bafbe bitcoin-26.1-arm64-apple-darwin-unsigned.tar.gz
2d180af4902519f88252b973f054fbac656232aed420ab60663a7944a3864a31 bitcoin-26.1-arm64-apple-darwin-unsigned.zip
8a8e415763b7ffd5988153cf03967d812eca629016dd3b0ddf6da3ab6f4a3621 bitcoin-26.1-arm64-apple-darwin.tar.gz
fe57b905ecbb1793356315c947bfd60933cdce25940d9fbc7e8d94896a5e49af bitcoin-26.1-codesignatures-26.1.tar.gz
9164ee5d717b4a20cb09f0496544d9d32f365734814fe399f5cdb4552a9b35ee bitcoin-26.1.tar.gz
646538125b7575db2bbecf22222353957b5ce625d94bc35a66ca1a6a3c3b754d bitcoin-26.1-powerpc64-linux-gnu-debug.tar.gz
d7ed4a32d0242a4183b34dcc223d6aa23d18dee31fe683636139b4532fda2f46 bitcoin-26.1-powerpc64-linux-gnu.tar.gz
16ec62a47413b0153c67e989ec6a80501ea23f027df680a30d30a32345bf36ac bitcoin-26.1-powerpc64le-linux-gnu-debug.tar.gz
574e82550b261db0826391b5b41c687235646b7c0179371f617ed3a61d142bab bitcoin-26.1-powerpc64le-linux-gnu.tar.gz
12675195b33a559a0152f3598eb42a93cdbaebaee3e3ecf58b13764ee3dbb423 bitcoin-26.1-riscv64-linux-gnu-debug.tar.gz
b05b6b10c4ec2bd9c2fb340d019397e55d592cd431fed3bc0acf4479964969d0 bitcoin-26.1-riscv64-linux-gnu.tar.gz
8fd415bfd0ba2d967d1fd03433b150e9b739a08f86c58c6d4dd0f8506a41fc12 bitcoin-26.1-x86_64-apple-darwin.zip
10a63e6ac62cfb8132ba94b88c597c1fa768185478759663541ee9e19fe02a99 bitcoin-26.1-x86_64-apple-darwin-unsigned.tar.gz
e6bedda1cd8b852df6885b2252d86547da645e2d9ade25aaf9ec28264b4aec5e bitcoin-26.1-x86_64-apple-darwin-unsigned.zip
acb50edd20692a9d023de12da573b64ca0fd9b4e9a2b88d1251020a3022b0f27 bitcoin-26.1-x86_64-apple-darwin.tar.gz
4c7fdad8f76458b91fe84c1f66f76ef0292b0de3d6408070c6ede104b36967c1 bitcoin-26.1-x86_64-linux-gnu-debug.tar.gz
a5b7d206384a8100058d3f2e2f02123a8e49e83f523499e70e86e121a4897d5b bitcoin-26.1-x86_64-linux-gnu.tar.gz
8ed4feeae2ab631f5f48e9f56c52a7bcf442501cf2f04c990f1e85b761314a67 bitcoin-26.1-win64-setup.exe
a0aaea3e7b2bab22dfe4a4cc33aef5bc23dccf2eda14e26f65872ed79af75f9f bitcoin-26.1-win64-debug.zip
946f92d27a6b05b09bd63e245208be639ff26699d2d4ab7d7c9f6e3649185982 bitcoin-26.1-win64-setup-unsigned.exe
b6f5b28de625c34e0bffee449cdb5324e36c6b80a1b92cb894f436ed8157842a bitcoin-26.1-win64-unsigned.tar.gz
7bd0849e47472aeff99a0ea2c0cefd98f5be829e5a2d3b0168b5a54456cc638a bitcoin-26.1-win64.zip
27 changes: 27 additions & 0 deletions regtest/sha256/bitcoin-core-26.2-SHA256SUMS
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
49521ec94ebb523b49007a96eb18c1ab7c650c28222203104d17cdb569c58ded bitcoin-26.2-aarch64-linux-gnu-debug.tar.gz
f9d723aec022b9a857f27a76fc3500f8d82ce02ca496e0d907c07081437204c8 bitcoin-26.2-aarch64-linux-gnu.tar.gz
b5bc5a35e3bef4ee2633563df57e38b83cd1103f259a7844dc7e283049986fb0 bitcoin-26.2-arm-linux-gnueabihf-debug.tar.gz
4b767fe48867825b9e1efa8ef16570410adeb099869103eaec99b664708118d6 bitcoin-26.2-arm-linux-gnueabihf.tar.gz
d3f8f9a8da2ff6c0f7d29646c23c0028c6042bbcda35c28830ce6511c840d9c0 bitcoin-26.2-arm64-apple-darwin.zip
0d104144ee3888fbf4ac0cb01c087966625025a70394852a9db33425debce4e9 bitcoin-26.2-arm64-apple-darwin-unsigned.tar.gz
edd5e07d0b99a05d88b79f6f19e8619a24a27e27225232f3b904db567644a7d5 bitcoin-26.2-arm64-apple-darwin-unsigned.zip
863960b4f78130ebb9a5e7f68e5cc021778892ff9b3f8b060056c485470640d5 bitcoin-26.2-arm64-apple-darwin.tar.gz
633fa765be8b371ef9dc174803dd7b2d716855f4c87e8f27e9ade0b588b9030a bitcoin-26.2-codesignatures-26.2.tar.gz
78d59418741f45cbdaa9bf20ebc49a5e95ff9f7172f72fc78d14307eaf341b3c bitcoin-26.2.tar.gz
a4cebb8873f05609b10763c35a32da8f798db55676c669e3d64249fecc7f1409 bitcoin-26.2-powerpc64-linux-gnu-debug.tar.gz
3fe1350951e72be109ce28d679776cb8f630d0db39a5b1c342856e0527478142 bitcoin-26.2-powerpc64-linux-gnu.tar.gz
015b925c04590fbe8d198e5bf2d5a5903efdbd71a052df94a836390cbbd9283b bitcoin-26.2-powerpc64le-linux-gnu-debug.tar.gz
0344a286b16c117d486dcd2e721a055072b77bab7cfa542ab6c22268591de1f6 bitcoin-26.2-powerpc64le-linux-gnu.tar.gz
bf12bcc0aeae60abf51841a14b67c48fdca5ee8e276d1bd72a76867e5825cc45 bitcoin-26.2-riscv64-linux-gnu-debug.tar.gz
60bf104a6467d105439507526be0ebee47cc0436a831562a4253e4e113af3a21 bitcoin-26.2-riscv64-linux-gnu.tar.gz
dd83901d294e7d9de150a85cffd1aadb2d674c15e8b23473e8d3770e21df5ef5 bitcoin-26.2-x86_64-apple-darwin.zip
f238818530a9c0cbc1ad6d5ece3099a3eb324a407b4742ab9baf127e084e1774 bitcoin-26.2-x86_64-apple-darwin-unsigned.tar.gz
a6efec89816073246d40b29b5bb4ec3426f624c7e1a16252cba3f60ca8cac896 bitcoin-26.2-x86_64-apple-darwin-unsigned.zip
8a15491cb1ea1a11c667b31606563e3a325e0ae1ff250e86a8453630f3c966f1 bitcoin-26.2-x86_64-apple-darwin.tar.gz
bb60a33684301e5848f21e573f18440ac1a8cc5ed711372766c8174b4f33ba04 bitcoin-26.2-x86_64-linux-gnu-debug.tar.gz
77c63bec845b318c07f3a7660c579f63da18b58d25699ab8b8df6034e8ed55c0 bitcoin-26.2-x86_64-linux-gnu.tar.gz
f9e359602e138681cb652013901dd9c5d9341b9da2507e7180bc35c8db13e288 bitcoin-26.2-win64-setup.exe
0ec3e2e1c3a198612c3ce97b279fdebe85cf47ac8caf3e34395988d51e8249b2 bitcoin-26.2-win64-debug.zip
1d9d030f1b7f105ed3d58a52c9285d4f175f9d89b1eedacb0515c55a01b7023c bitcoin-26.2-win64-setup-unsigned.exe
0232ae5c288a1c2ccc3d0966da2162f7f9998f5fc947a3febf2f1f9ec77fbea0 bitcoin-26.2-win64-unsigned.tar.gz
9251aa806244ac176d09bbe0a3808247d791e48ce3a6b6256adfdd14d9135e0f bitcoin-26.2-win64.zip
14 changes: 11 additions & 3 deletions regtest/src/client_versions.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
// All features uses 26_0
// All features uses 26_2
/// The version specific client and json types.
///
/// **THIS IS AVAILABLE FOR ALL VERSION NUMBER FEATURES** (eg `25_0`, `24_2` etc). This crate is
/// unusual in that it expects exactly one version number feature to be selected, docs.rs is not set
/// up to handle such oddity.
///
#[cfg(feature = "26_0")]
#[cfg(feature = "26_2")]
#[allow(unused_imports)] // Not all users need the json types.
pub use bitcoind_json_rpc_client::{client_sync::v26::{Client, AddressType}, json::v26 as json};

#[cfg(all(feature = "26_1", not(feature = "26_2")))]
#[allow(unused_imports)] // Not all users need the json types.
pub use bitcoind_json_rpc_client::{client_sync::v26::{Client, AddressType}, json::v26 as json};

#[cfg(all(feature = "26_0", not(feature = "26_1")))]
#[allow(unused_imports)] // Not all users need the json types.
pub use bitcoind_json_rpc_client::{client_sync::v26::{Client, AddressType}, json::v26 as json};

Expand Down Expand Up @@ -74,6 +82,6 @@ pub use bitcoind_json_rpc_client::{client_sync::v18::{Client, AddressType}, json
pub use bitcoind_json_rpc_client::{client_sync::v17::{Client, AddressType}, json::v17 as json};

// 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 = "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 = "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")))]
#[allow(unused_imports)] // Not all users need the json types.
pub use bitcoind_json_rpc_client::{client_sync::v26::{Client, AddressType}, json::v26 as json};
12 changes: 9 additions & 3 deletions regtest/src/versions.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#[cfg(feature = "26_0")]
#[cfg(feature = "26_2")]
pub const VERSION: &str = "26.2";

#[cfg(all(feature = "26_1", not(feature = "26_2")))]
pub const VERSION: &str = "26.1";

#[cfg(all(feature = "26_0", not(feature = "26_1")))]
pub const VERSION: &str = "26.0";

#[cfg(all(feature = "25_2", not(feature = "26_0")))]
Expand Down Expand Up @@ -50,6 +56,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 = "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 = "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")))]
#[allow(dead_code)] // for --no-default-features
pub const VERSION: &str = "26.0";
pub const VERSION: &str = "26.2";

0 comments on commit ef0fc39

Please sign in to comment.