Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,10 @@ jobs:
version:
[
"30_2",
# Don't integration test v30.0 and v30.1 as the binaries have been
# removed due to a wallet migration bug.
# No `30_0` or `30_1` because of wallet migration bug.
"29_0",
"28_2",
"28_1",
"28_0",
"27_2",
"27_1",
"27_0",
"26_2",
"25_2",
"24_2",
Expand Down
25 changes: 11 additions & 14 deletions bitcoind/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,28 @@ zip = { version = "0.6.6", default-features = false, features = ["bzip2", "defla
# Please note, it is expected that a single version feature will be enabled however if you enable
# multiple the highest version number will take precedence.
#
# - `cargo test --features=latest,download` to download the latest version of Core that we support.
# - `cargo test --features=27_2,download` to download Bitcoin Core binary `v27.2`.
# - `cargo test --features=28_0` to use `bitcoind` from the host environment.
# - `cargo test` is equivalent to `cargo test --features=0_17_2`.
# - `cargo test --all-features`: Same as using latest version.
# - `cargo test --no-default-features` does not work, you MUST enable a version feature.
# - `cargo test --all-features`: Will download latest version of Core we support.
# - `cargo test --no-default-features` does not build, you MUST enable a version feature.
[features]
default = ["0_17_2"]
# TODO: Set this to 31_0 after all the TODOs are cleared from `types/src/v31/mod.rs`.
latest = ["30_2"]

download = ["anyhow", "bitcoin_hashes", "flate2", "tar", "bitreq", "zip"]

latest = ["30_2"]

# We support all minor releases of the latest four versions.
30_2 = ["30_0"]
# Skip v30.1 due to wallet migration bug.
30_0 = ["29_0"]
# We support all minor releases of the latest three versions.
31_0 = ["30_2"]
30_2 = ["29_0"]
# No `30_0` or `30_1` because of wallet migration bug.
29_0 = ["28_2"]
28_2 = ["28_1"]
28_1 = ["28_0"]
28_0 = ["27_2"]
27_2 = ["27_1"]
27_1 = ["27_0"]
27_0 = ["26_2"]

# We only support the latest minor version for older versions.
28_2 = ["27_2"]
27_2 = ["26_2"]
26_2 = ["25_2"]
25_2 = ["24_2"]
24_2 = ["23_2"]
Expand Down
2 changes: 1 addition & 1 deletion bitcoind/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ mod download {
#[cfg(not(target_os = "windows"))]
let cache_complete = existing_filename.exists()
&& version_dir.join("bin").join("bitcoin-cli").exists()
&& (!cfg!(feature = "30_0")
&& (!cfg!(feature = "30_2")
|| version_dir.join("libexec").join("bitcoin-node").exists());
#[cfg(target_os = "windows")]
let cache_complete = existing_filename.exists();
Expand Down
28 changes: 28 additions & 0 deletions bitcoind/sha256/bitcoin-core-31.0-SHA256SUMS
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
91917647aaf50965fc834e048256fce17e8f5590658c7e8de2879fb66cdc9a73 bitcoin-31.0-aarch64-linux-gnu-debug.tar.gz
4de1d568dedd48604f75132421bc0abeca432639589b49a3909c81db3a813112 bitcoin-31.0-aarch64-linux-gnu.tar.gz
fc17562b66707d0c8d1863af0cd40d7c6818a8d7d7b360b8d43276b1593924d9 bitcoin-31.0-arm-linux-gnueabihf-debug.tar.gz
8c19d007bfc73502625095ea4073af3a98ceb722d500556ab173bac5bcadd0d6 bitcoin-31.0-arm-linux-gnueabihf.tar.gz
a2d7a13b4da53d4a3e4c517f3a0269e2429813417bb320d3b268993cfdc545d0 bitcoin-31.0-arm64-apple-darwin.tar.gz
fc119a34915daac57e5fbdf181c9295d862d6843d52a9380e39dc0d0ac69cf20 bitcoin-31.0-arm64-apple-darwin.zip
955563c720b4d5fc22a11d4b102940d605f1cb9eb0b564f50deb606412c631e5 bitcoin-31.0-arm64-apple-darwin-codesigning.tar.gz
48d34a140aeaacd63a4bd37c24ed1876df4b077c98a7e0dd9a4483d1032839f4 bitcoin-31.0-arm64-apple-darwin-unsigned.tar.gz
b639946d343114cca5d87b218aaece04d0d111374b725d90dffc7e2d1d3b99f5 bitcoin-31.0-arm64-apple-darwin-unsigned.zip
7e45bab1787af974307fc077e6688d3eaab6788f3ad0e3a65d8cc9e428c41219 bitcoin-31.0-codesignatures-31.0.tar.gz
0ba0ef5eea3aefd96cc1774be274c3d594812cfac0988809d706738bb067b3e3 bitcoin-31.0.tar.gz
efe3e7d0383d54e5d79ac47911be0100b99872fa5205510a2a22d1194a0212d8 bitcoin-31.0-powerpc64-linux-gnu-debug.tar.gz
1d9c865aa0ccf675fc068e79d9fa57a5a70b59132fca38bb322a7d44ce2f0ff2 bitcoin-31.0-powerpc64-linux-gnu.tar.gz
acd0e38f4bb99c7c3024e494ca218d3ae67ec4a8b3b7ae556a8292353fe308b5 bitcoin-31.0-riscv64-linux-gnu-debug.tar.gz
7ece4ea365bba9b2008b27f0717ef6a518598a572edaa2815e775faadc53c136 bitcoin-31.0-riscv64-linux-gnu.tar.gz
56824dd705bc2a3b22d42e8aa02ed53498d491ff7c2c8aa96831333871887ead bitcoin-31.0-x86_64-apple-darwin.tar.gz
8e230f36a2020072763adf742b20d95348cb20aaa0b0a918ca44ecdc83ac4efd bitcoin-31.0-x86_64-apple-darwin.zip
fccf54f31bd58a3f834add05fa5df36520313d936445c556be8f71ccf314b658 bitcoin-31.0-x86_64-apple-darwin-codesigning.tar.gz
d1d0174f07cf87d9af4318f7072350510fa0f1bf8d3d3b1ee7143ad5967b6bdf bitcoin-31.0-x86_64-apple-darwin-unsigned.tar.gz
b8d9b9915a1871ee12a3a9883fd47860028454fcd192864735f2e0d3a88b4735 bitcoin-31.0-x86_64-apple-darwin-unsigned.zip
96e3506195c5cc2ea9ca72fb2ddcbcf5246dd0db0d21d726f3c98eaf0c6b9078 bitcoin-31.0-x86_64-linux-gnu-debug.tar.gz
d3e4c58a35b1d0a97a457462c94f55501ad167c660c245cb1ffa565641c65074 bitcoin-31.0-x86_64-linux-gnu.tar.gz
1893e819d7554ca43e6e812dc642bd1fb4570a4077b07a03180ad1041e74e223 bitcoin-31.0-win64-setup.exe
82fd2c504a0f20a31d4d13bd407783d6fc7bf17622d0ce85228a9b92694e03f0 bitcoin-31.0-win64.zip
62baf547357029ac557d6fbbe91742c4ba6c1461c19ed4fab5131d4300b74d93 bitcoin-31.0-win64-codesigning.tar.gz
df3f8c2f6ce8fde8d2661d3c01f5265f90f938019d52e2f94acf2a9001af70ae bitcoin-31.0-win64-debug.zip
ad31d4d82a0ddcf1340a447575ca958ee664656ca2e77282737898e1b8209ec8 bitcoin-31.0-win64-setup-unsigned.exe
5ecd365b53a2896850178f90302375480933e6c85ef81bb8abe8675fd44e1d9c bitcoin-31.0-win64-unsigned.zip
41 changes: 5 additions & 36 deletions bitcoind/src/client_versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,19 @@

#![allow(unused_imports)] // Not all users need the json types.

#[cfg(feature = "30_0")]
#[cfg(feature = "30_2")]
pub use corepc_client::{client_sync::v30::*, types::v30 as vtype};

#[cfg(all(feature = "29_0", not(feature = "30_0")))]
#[cfg(all(feature = "29_0", not(feature = "30_2")))]
pub use corepc_client::{client_sync::v29::*, types::v29 as vtype};

#[cfg(all(feature = "28_2", not(feature = "29_0")))]
pub use corepc_client::{client_sync::v28::*, types::v28 as vtype};

#[cfg(all(feature = "28_1", not(feature = "28_2")))]
pub use corepc_client::{client_sync::v28::*, types::v28 as vtype};

#[cfg(all(feature = "28_0", not(feature = "28_1")))]
pub use corepc_client::{client_sync::v28::*, types::v28 as vtype};

#[cfg(all(feature = "27_2", not(feature = "28_0")))]
pub use corepc_client::{client_sync::v27::*, types::v27 as vtype};

#[cfg(all(feature = "27_1", not(feature = "27_2")))]
pub use corepc_client::{client_sync::v27::*, types::v27 as vtype};

#[cfg(all(feature = "27_0", not(feature = "27_1")))]
#[cfg(all(feature = "27_2", not(feature = "28_2")))]
pub use corepc_client::{client_sync::v27::*, types::v27 as vtype};

#[cfg(all(feature = "26_2", not(feature = "27_0")))]
#[cfg(all(feature = "26_2", not(feature = "27_2")))]
pub use corepc_client::{client_sync::v26::*, types::v26 as vtype};

#[cfg(all(feature = "25_2", not(feature = "26_2")))]
Expand Down Expand Up @@ -62,24 +50,5 @@ pub use corepc_client::{client_sync::v17::*, types::v17 as vtype};

/// This is meaningless but we need it otherwise we can't get far enough into
/// the build process to trigger the `compile_error!` in `./versions.rs`.
#[cfg(all(
not(feature = "30_0"),
not(feature = "29_0"),
not(feature = "28_2"),
not(feature = "28_1"),
not(feature = "28_0"),
not(feature = "27_2"),
not(feature = "27_1"),
not(feature = "27_0"),
not(feature = "26_2"),
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_2"),
))]
#[cfg(not(feature = "0_17_2"))] // Remember: later version features enable earlier ones.
pub use corepc_client::{client_sync::v28::*, types::v28 as vtype};
69 changes: 9 additions & 60 deletions bitcoind/src/versions.rs
Original file line number Diff line number Diff line change
@@ -1,57 +1,25 @@
// An explicit version of Bitcoin Core must be selected by enabling some feature.
// We check this here instead of in `lib.rs` because this file is included in `build.rs`.
#[cfg(all(
not(feature = "30_2"),
not(feature = "30_0"),
not(feature = "29_0"),
not(feature = "28_2"),
not(feature = "28_1"),
not(feature = "28_0"),
not(feature = "27_2"),
not(feature = "27_1"),
not(feature = "27_0"),
not(feature = "26_2"),
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_2")
))]
#[cfg(not(feature = "0_17_2"))] // Remember: later version features enable earlier ones.
compile_error!("enable a feature in order to select the version of Bitcoin Core to use");

#[cfg(feature = "30_2")]
#[cfg(feature = "31_0")]
#[allow(dead_code)] // Triggers in --all-features builds.
pub const VERSION: &str = "30.2";
pub const VERSION: &str = "31.0";

#[cfg(all(feature = "30_0", not(feature = "30_2")))]
pub const VERSION: &str = "30.0";
#[cfg(all(feature = "30_2", not(feature = "31_0")))]
pub const VERSION: &str = "30.2";

#[cfg(all(feature = "29_0", not(feature = "30_0")))]
#[cfg(all(feature = "29_0", not(feature = "30_2")))]
pub const VERSION: &str = "29.0";

#[cfg(all(feature = "28_2", not(feature = "29_0")))]
pub const VERSION: &str = "28.2";

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

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

#[cfg(all(feature = "27_2", not(feature = "28_0")))]
#[cfg(all(feature = "27_2", not(feature = "28_2")))]
pub const VERSION: &str = "27.2";

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

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

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

#[cfg(all(feature = "25_2", not(feature = "26_2")))]
Expand Down Expand Up @@ -83,24 +51,5 @@ pub const VERSION: &str = "0.17.2";

/// This is meaningless but we need it otherwise we can't get far enough into
/// the build process to trigger the `compile_error!` in `./versions.rs`.
#[cfg(all(
not(feature = "30_0"),
not(feature = "29_0"),
not(feature = "28_2"),
not(feature = "28_1"),
not(feature = "28_0"),
not(feature = "27_2"),
not(feature = "27_1"),
not(feature = "27_0"),
not(feature = "26_2"),
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_2")
))]
#[cfg(not(feature = "0_17_2"))] // Remember: later version features enable earlier ones.
pub const VERSION: &str = "never-used";
22 changes: 22 additions & 0 deletions client/src/client_sync/v31/blockchain.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: CC0-1.0

//! Macros for implementing JSON-RPC methods on a client.
//!
//! Specifically this is methods found under the `== Blockchain ==` section of the
//! API docs of Bitcoin Core `v31`.
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `getmempoolcluster`.
#[macro_export]
macro_rules! impl_client_v31__get_mempool_cluster {
() => {
impl Client {
pub fn get_mempool_cluster(&self, txid: Txid) -> Result<GetMempoolCluster> {
self.call("getmempoolcluster", &[into_json(txid)?])
}
}
};
}
Loading
Loading