Skip to content
Merged
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
1 change: 1 addition & 0 deletions client/src/client_sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub mod v26;
pub mod v27;
pub mod v28;
pub mod v29;
pub mod v30;

use std::fs::File;
use std::io::{BufRead, BufReader};
Expand Down
197 changes: 197 additions & 0 deletions client/src/client_sync/v30/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
// SPDX-License-Identifier: CC0-1.0

//! A JSON-RPC client for testing against Bitcoin Core `v30`.
//!
//! We ignore option arguments unless they effect the shape of the returned JSON data.

use std::collections::BTreeMap;
use std::path::Path;

use bitcoin::address::{Address, NetworkChecked};
use bitcoin::{sign_message, Amount, Block, BlockHash, PublicKey, Txid};
use serde_json::json;

use crate::client_sync::into_json;
use crate::types::v30::*;

#[rustfmt::skip] // Keep public re-exports separate.
pub use crate::client_sync::{
v17::{AddNodeCommand, ImportMultiRequest, ImportMultiScriptPubKey, ImportMultiTimestamp, Input, Output, SetBanCommand, WalletCreateFundedPsbtInput,},
v21::ImportDescriptorsRequest,
v23::AddressType,
v29::{TemplateRequest, TemplateRules}
};

crate::define_jsonrpc_minreq_client!("v30");
crate::impl_client_check_expected_server_version!({ [300000] });

// == Blockchain ==
crate::impl_client_v29__dump_tx_out_set!();
crate::impl_client_v17__get_best_block_hash!();
crate::impl_client_v17__get_block!();
crate::impl_client_v17__get_blockchain_info!();
crate::impl_client_v17__get_block_count!();
crate::impl_client_v19__get_block_filter!();
crate::impl_client_v23__get_block_from_peer!();
crate::impl_client_v17__get_block_hash!();
crate::impl_client_v17__get_block_header!();
crate::impl_client_v17__get_block_stats!();
crate::impl_client_v26__get_chain_states!();
crate::impl_client_v17__get_chain_tips!();
crate::impl_client_v17__get_chain_tx_stats!();
crate::impl_client_v23__get_deployment_info!();
crate::impl_client_v29__get_descriptor_activity!();
crate::impl_client_v17__get_difficulty!();
crate::impl_client_v17__get_mempool_ancestors!();
crate::impl_client_v17__get_mempool_descendants!();
crate::impl_client_v17__get_mempool_entry!();
crate::impl_client_v17__get_mempool_info!();
crate::impl_client_v17__get_raw_mempool!();
crate::impl_client_v17__get_tx_out!();
crate::impl_client_v17__get_tx_out_proof!();
crate::impl_client_v26__get_tx_out_set_info!();
crate::impl_client_v24__get_tx_spending_prevout!();
crate::impl_client_v26__import_mempool!();
crate::impl_client_v17__precious_block!();
crate::impl_client_v17__prune_blockchain!();
crate::impl_client_v23__save_mempool!();
crate::impl_client_v25__scan_blocks!();
crate::impl_client_v17__verify_chain!();
crate::impl_client_v17__verify_tx_out_proof!();

// == Control ==
crate::impl_client_v17__get_memory_info!();
crate::impl_client_v18__get_rpc_info!();
crate::impl_client_v17__help!();
crate::impl_client_v17__logging!();
crate::impl_client_v17__stop!();
crate::impl_client_v17__uptime!();

// == Generating ==
crate::impl_client_v25__generate_block!();
crate::impl_client_v17__generate_to_address!();
crate::impl_client_v20__generate_to_descriptor!();
crate::impl_client_v17__invalidate_block!();

// == Hidden ==
crate::impl_client_v21__add_peer_address!();

// == Mining ==
crate::impl_client_v17__get_block_template!();
crate::impl_client_v17__get_mining_info!();
crate::impl_client_v17__get_network_hashes_per_second!();
crate::impl_client_v26__get_prioritised_transactions!();
crate::impl_client_v17__prioritise_transaction!();
crate::impl_client_v17__submit_block!();
crate::impl_client_v18__submit_header!();

// == Network ==
crate::impl_client_v17__add_node!();
crate::impl_client_v17__clear_banned!();
crate::impl_client_v17__disconnect_node!();
crate::impl_client_v17__get_added_node_info!();
crate::impl_client_v26__get_addr_man_info!();
crate::impl_client_v17__get_connection_count!();
crate::impl_client_v17__get_net_totals!();
crate::impl_client_v17__get_network_info!();
crate::impl_client_v18__get_node_addresses!();
crate::impl_client_v17__get_peer_info!();
crate::impl_client_v17__list_banned!();
crate::impl_client_v17__ping!();
crate::impl_client_v17__set_ban!();
crate::impl_client_v17__set_network_active!();

// == Rawtransactions ==
crate::impl_client_v18__analyze_psbt!();
crate::impl_client_v17__combine_psbt!();
crate::impl_client_v17__combine_raw_transaction!();
crate::impl_client_v17__convert_to_psbt!();
crate::impl_client_v17__create_psbt!();
crate::impl_client_v17__create_raw_transaction!();
crate::impl_client_v17__decode_psbt!();
crate::impl_client_v17__decode_raw_transaction!();
crate::impl_client_v17__decode_script!();
crate::impl_client_v17__finalize_psbt!();
crate::impl_client_v17__fund_raw_transaction!();
crate::impl_client_v17__get_raw_transaction!();
crate::impl_client_v18__join_psbts!();
crate::impl_client_v17__send_raw_transaction!();
crate::impl_client_v17__sign_raw_transaction!();
crate::impl_client_v17__sign_raw_transaction_with_key!();
crate::impl_client_v28__submit_package!();
crate::impl_client_v17__test_mempool_accept!();
crate::impl_client_v18__utxo_update_psbt!();

// == Signer ==
crate::impl_client_v22__enumerate_signers!();

// == Util ==
crate::impl_client_v17__create_multisig!();
crate::impl_client_v29__derive_addresses!();
crate::impl_client_v17__estimate_smart_fee!();
crate::impl_client_v18__get_descriptor_info!();
crate::impl_client_v21__get_index_info!();
crate::impl_client_v17__sign_message_with_priv_key!();
crate::impl_client_v17__validate_address!();
crate::impl_client_v17__verify_message!();

// == Wallet ==
crate::impl_client_v17__abandon_transaction!();
crate::impl_client_v17__abort_rescan!();
crate::impl_client_v17__backup_wallet!();
crate::impl_client_v17__bump_fee!();
crate::impl_client_v23__create_wallet!();
crate::impl_client_v28__create_wallet_descriptor!();
crate::impl_client_v17__encrypt_wallet!();
crate::impl_client_v17__get_addresses_by_label!();
crate::impl_client_v17__get_address_info!();
crate::impl_client_v17__get_balance!();
crate::impl_client_v19__get_balances!();
crate::impl_client_v28__get_hd_keys!();
crate::impl_client_v18__get_received_by_label!();
crate::impl_client_v17__get_new_address!();
crate::impl_client_v17__get_raw_change_address!();
crate::impl_client_v17__get_received_by_address!();
crate::impl_client_v17__get_transaction!();
crate::impl_client_v17__get_wallet_info!();
crate::impl_client_v21__import_descriptors!();
crate::impl_client_v17__import_pruned_funds!();
crate::impl_client_v17__key_pool_refill!();
crate::impl_client_v17__list_address_groupings!();
crate::impl_client_v22__list_descriptors!();
crate::impl_client_v18__list_received_by_label!();
crate::impl_client_v17__list_labels!();
crate::impl_client_v17__list_lock_unspent!();
crate::impl_client_v17__list_received_by_address!();
crate::impl_client_v17__list_since_block!();
crate::impl_client_v17__list_transactions!();
crate::impl_client_v17__list_unspent!();
crate::impl_client_v18__list_wallet_dir!();
crate::impl_client_v17__list_wallets!();
crate::impl_client_v22__load_wallet!();
crate::impl_client_v17__lock_unspent!();
crate::impl_client_v24__migrate_wallet!();
crate::impl_client_v21__psbt_bump_fee!();
crate::impl_client_v17__remove_pruned_funds!();
crate::impl_client_v17__rescan_blockchain!();
crate::impl_client_v23__restore_wallet!();
crate::impl_client_v21__send!();
crate::impl_client_v24__send_all!();
crate::impl_client_v17__send_many!();
crate::impl_client_v21__send_many_verbose!();
crate::impl_client_v17__send_to_address!();
crate::impl_client_v17__set_tx_fee!();
crate::impl_client_v19__set_wallet_flag!();
crate::impl_client_v17__sign_message!();
crate::impl_client_v17__sign_raw_transaction_with_wallet!();
crate::impl_client_v24__simulate_raw_transaction!();
crate::impl_client_v21__unload_wallet!();
crate::impl_client_v17__wallet_create_funded_psbt!();
crate::impl_client_v22__wallet_display_address!();
crate::impl_client_v17__wallet_lock!();
crate::impl_client_v17__wallet_passphrase!();
crate::impl_client_v17__wallet_passphrase_change!();
crate::impl_client_v17__wallet_process_psbt!();

// == Zmq ==
crate::impl_client_v17__get_zmq_notifications!();
2 changes: 2 additions & 0 deletions contrib/templates/bitcoind_aliases
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ alias bt26='/opt/bitcoin-26.2/bin/bitcoin-cli -regtest -rpcuser=user -rpcpasswor
alias bt27='/opt/bitcoin-27.2/bin/bitcoin-cli -regtest -rpcuser=user -rpcpassword=password -rpcport=27249'
alias bt28='/opt/bitcoin-28.1/bin/bitcoin-cli -regtest -rpcuser=user -rpcpassword=password -rpcport=28149'
alias bt29='/opt/bitcoin-29.0/bin/bitcoin-cli -regtest -rpcuser=user -rpcpassword=password -rpcport=29049'
alias bt30='/opt/bitcoin-30.0/bin/bitcoin-cli -regtest -rpcuser=user -rpcpassword=password -rpcport=30049'

# Test aliases for different Bitcoin Core versions

Expand All @@ -30,3 +31,4 @@ alias test26='BITCOIND_EXE=/opt/bitcoin-26.2/bin/bitcoind cargo test --features=
alias test27='BITCOIND_EXE=/opt/bitcoin-27.2/bin/bitcoind cargo test --features="27_2"'
alias test28='BITCOIND_EXE=/opt/bitcoin-28.1/bin/bitcoind cargo test --features="28_1"'
alias test29='BITCOIND_EXE=/opt/bitcoin-29.0/bin/bitcoind cargo test --features="29_0"'
alias test30='BITCOIND_EXE=/opt/bitcoin-30.0/bin/bitcoind cargo test --features="30_0"'
1 change: 1 addition & 0 deletions contrib/templates/run-bitcoind.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ v26 26.2 262 /opt/bitcoin-26.2/bin/bitcoind
v27 27.2 272 /opt/bitcoin-27.2/bin/bitcoind
v28 28.1 281 /opt/bitcoin-28.1/bin/bitcoind
v29 29.0 290 /opt/bitcoin-29.0/bin/bitcoind
v30 30.0 300 /opt/bitcoin-30.0/bin/bitcoind
6 changes: 4 additions & 2 deletions integration_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ edition = "2021"
download = ["node/download"]

# Enable the same feature in `node` and the version feature here.
# All minor releases of the latest three versions.
# All minor releases of the latest four versions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Novel idea, increase this number so as not to have to make changes to the 4th oldest release. Are you planning on dropping this back to 3 or do you think we leave it as is for now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see the reason to remove them? No effort to keep

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a policy thing, if we keep this and 27.x comes out we have to add support for it. Although this moving window has something annoying about it for downstream but I can't remember right now what it is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I'm a goose, we have to anyway because we say we support the latest. hmmm not sure what to do, lets leave it until we think of something better?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wasn't sure what effect removing 27.0 and 27.1 was on downstream. Mostly why I left them in.

Copy link
Collaborator Author

@jamillambert jamillambert Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a policy thing, if we keep this and 27.x comes out we have to add support for it.

The comment below says # Only the latest minor version for older versions. which would suggest we have to anyway. I guess we don't want this for the older versions and should change the wording.

EDIT: 😊 I see you wrote the same thing above.

30_0 = ["v30_and_below", "node/30_0"]
29_0 = ["v29_and_below", "node/29_0"]
28_2 = ["v28_and_below", "node/28_2"]
28_1 = ["v28_and_below", "node/28_1"]
Expand All @@ -38,7 +39,8 @@ download = ["node/download"]
# Each major version is tested with the same client.
# A specific range of versions can be specified e.g. for 24-26:
# #[cfg(all(feature = "v26_and_below", not(feature = "v23_and_below")))]
v29_and_below = []
v30_and_below = []
v29_and_below = ["v30_and_below"]
v28_and_below = ["v29_and_below"]
v27_and_below = ["v28_and_below"]
v26_and_below = ["v27_and_below"]
Expand Down
1 change: 1 addition & 0 deletions integration_test/tests/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ fn blockchain__get_mempool_entry__modelled() {
}

#[test]
#[cfg(feature = "v29_and_below")]
fn blockchain__get_mempool_info__modelled() {
let node = Node::with_wallet(Wallet::Default, &[]);
node.fund_wallet();
Expand Down
1 change: 1 addition & 0 deletions integration_test/tests/mining.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ fn mining__get_block_template__modelled() {
}

#[test]
#[cfg(feature = "v29_and_below")]
fn mining__get_mining_info() {
let node = Node::with_wallet(Wallet::Default, &[]);

Expand Down
20 changes: 16 additions & 4 deletions integration_test/tests/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ fn wallet__abort_rescan() {
}

#[test]
#[cfg(feature = "v29_and_below")]
fn wallet__add_multisig_address__modelled() {
let nrequired = 2;

Expand Down Expand Up @@ -168,6 +169,7 @@ fn wallet__create_wallet_descriptor() {
}

#[test]
#[cfg(feature = "v29_and_below")]
fn wallet__dump_priv_key__modelled() {
// As of Core v23 the default wallet is an native descriptor wallet which does not
// support dumping private keys. Legacy wallets are supported upto v25 it seems.
Expand Down Expand Up @@ -200,6 +202,7 @@ fn wallet__dump_priv_key__modelled() {
}

#[test]
#[cfg(feature = "v29_and_below")]
fn wallet__dump_wallet() {
// As of Core v23 the default wallet is an native descriptor wallet which does not
// support dumping private keys. Legacy wallets are supported upto v25 it seems.
Expand Down Expand Up @@ -398,6 +401,7 @@ fn wallet__get_transaction__modelled() {
}

#[test]
#[cfg(feature = "v29_and_below")]
fn wallet__get_unconfirmed_balance__modelled() {
let node = Node::with_wallet(Wallet::Default, &[]);
let json: GetUnconfirmedBalance =
Expand All @@ -407,6 +411,7 @@ fn wallet__get_unconfirmed_balance__modelled() {
}

#[test]
#[cfg(feature = "v29_and_below")]
fn wallet__get_wallet_info__modelled() {
let node = Node::with_wallet(Wallet::Default, &[]);
node.mine_a_block();
Expand All @@ -433,6 +438,7 @@ fn wallet__get_wallet_info__modelled() {
}

#[test]
#[cfg(feature = "v29_and_below")]
fn wallet__import_address() {
let node = match () {
#[cfg(feature = "v22_and_below")]
Expand Down Expand Up @@ -517,6 +523,7 @@ fn wallet__import_pruned_funds() {
}

#[test]
#[cfg(feature = "v29_and_below")]
fn wallet__import_wallet() {
let node = match () {
#[cfg(feature = "v22_and_below")]
Expand Down Expand Up @@ -648,6 +655,7 @@ fn wallet__list_transactions__modelled() {
}

#[test]
#[cfg(feature = "v29_and_below")]
fn wallet__import_multi() {
let node = match () {
#[cfg(feature = "v22_and_below")]
Expand Down Expand Up @@ -711,6 +719,7 @@ fn wallet__import_multi() {
}

#[test]
#[cfg(feature = "v29_and_below")]
fn wallet__import_privkey() {
let node = match () {
#[cfg(feature = "v22_and_below")]
Expand All @@ -730,6 +739,7 @@ fn wallet__import_privkey() {
}

#[test]
#[cfg(feature = "v29_and_below")]
fn wallet__import_pubkey() {
let node = match () {
#[cfg(feature = "v22_and_below")]
Expand Down Expand Up @@ -805,7 +815,7 @@ fn wallet__list_unspent__modelled() {
}

#[test]
#[cfg(not(feature = "v17"))]
#[cfg(all(feature = "v29_and_below", not(feature = "v17")))]
fn wallet__list_wallet_dir() {
let wallet_name = "test-wallet";
let node = Node::with_wallet(Wallet::None, &[]);
Expand Down Expand Up @@ -853,7 +863,7 @@ fn wallet__lock_unspent() {
}

#[test]
#[cfg(not(feature = "v23_and_below"))]
#[cfg(all(feature = "v29_and_below", not(feature = "v23_and_below")))]
fn wallet__migrate_wallet() {
let node = Node::with_wallet(Wallet::None, &["-deprecatedrpc=create_bdb"]);
let wallet_name = "legacy_wallet";
Expand All @@ -865,7 +875,7 @@ fn wallet__migrate_wallet() {
}

#[test]
#[cfg(not(feature = "v22_and_below"))]
#[cfg(all(feature = "v29_and_below", not(feature = "v22_and_below")))]
fn wallet__new_keypool() {
let node = Node::with_wallet(Wallet::None, &["-deprecatedrpc=create_bdb"]);
node.client.create_legacy_wallet("legacy_wallet").expect("createlegacywallet");
Expand Down Expand Up @@ -1002,6 +1012,7 @@ fn wallet__send_to_address__modelled() {
}

#[test]
#[cfg(feature = "v29_and_below")]
fn wallet__set_tx_fee() {
let node = Node::with_wallet(Wallet::Default, &[]);
let fee_rate = FeeRate::from_sat_per_vb(2).expect("2 sat/vb is valid");
Expand All @@ -1021,6 +1032,7 @@ fn wallet__set_wallet_flag() {
}

#[test]
#[cfg(feature = "v29_and_below")]
fn wallet__set_hd_seed() {
let node = match () {
#[cfg(feature = "v22_and_below")]
Expand Down Expand Up @@ -1181,7 +1193,7 @@ fn create_load_unload_wallet() {
}

#[test]
#[cfg(not(feature = "v20_and_below"))]
#[cfg(all(feature = "v29_and_below", not(feature = "v20_and_below")))]
fn wallet__upgrade_wallet() {
let node = Node::with_wallet(Wallet::Default, &[]);

Expand Down
Loading