Skip to content

Commit 88ddaf1

Browse files
committed
Add template for v30 support
Add all the required files, features and update existing code to support Bitcoin Core v30. New files are coppies of v29.
1 parent c1ac72c commit 88ddaf1

File tree

17 files changed

+995
-7
lines changed

17 files changed

+995
-7
lines changed

client/src/client_sync/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub mod v26;
1616
pub mod v27;
1717
pub mod v28;
1818
pub mod v29;
19+
pub mod v30;
1920

2021
use std::fs::File;
2122
use std::io::{BufRead, BufReader};

client/src/client_sync/v30/mod.rs

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
// SPDX-License-Identifier: CC0-1.0
2+
3+
//! A JSON-RPC client for testing against Bitcoin Core `v30`.
4+
//!
5+
//! We ignore option arguments unless they effect the shape of the returned JSON data.
6+
7+
use std::collections::BTreeMap;
8+
use std::path::Path;
9+
10+
use bitcoin::address::{Address, NetworkChecked};
11+
use bitcoin::{sign_message, Amount, Block, BlockHash, PublicKey, Txid};
12+
use serde_json::json;
13+
14+
use crate::client_sync::into_json;
15+
use crate::types::v30::*;
16+
17+
#[rustfmt::skip] // Keep public re-exports separate.
18+
pub use crate::client_sync::{
19+
v17::{AddNodeCommand, ImportMultiRequest, ImportMultiScriptPubKey, ImportMultiTimestamp, Input, Output, SetBanCommand, WalletCreateFundedPsbtInput,},
20+
v21::ImportDescriptorsRequest,
21+
v23::AddressType,
22+
v29::{TemplateRequest, TemplateRules}
23+
};
24+
25+
crate::define_jsonrpc_minreq_client!("v30");
26+
crate::impl_client_check_expected_server_version!({ [300000] });
27+
28+
// == Blockchain ==
29+
crate::impl_client_v29__dump_tx_out_set!();
30+
crate::impl_client_v17__get_best_block_hash!();
31+
crate::impl_client_v17__get_block!();
32+
crate::impl_client_v17__get_blockchain_info!();
33+
crate::impl_client_v17__get_block_count!();
34+
crate::impl_client_v19__get_block_filter!();
35+
crate::impl_client_v23__get_block_from_peer!();
36+
crate::impl_client_v17__get_block_hash!();
37+
crate::impl_client_v17__get_block_header!();
38+
crate::impl_client_v17__get_block_stats!();
39+
crate::impl_client_v26__get_chain_states!();
40+
crate::impl_client_v17__get_chain_tips!();
41+
crate::impl_client_v17__get_chain_tx_stats!();
42+
crate::impl_client_v23__get_deployment_info!();
43+
crate::impl_client_v29__get_descriptor_activity!();
44+
crate::impl_client_v17__get_difficulty!();
45+
crate::impl_client_v17__get_mempool_ancestors!();
46+
crate::impl_client_v17__get_mempool_descendants!();
47+
crate::impl_client_v17__get_mempool_entry!();
48+
crate::impl_client_v17__get_mempool_info!();
49+
crate::impl_client_v17__get_raw_mempool!();
50+
crate::impl_client_v17__get_tx_out!();
51+
crate::impl_client_v17__get_tx_out_proof!();
52+
crate::impl_client_v26__get_tx_out_set_info!();
53+
crate::impl_client_v24__get_tx_spending_prevout!();
54+
crate::impl_client_v26__import_mempool!();
55+
crate::impl_client_v17__precious_block!();
56+
crate::impl_client_v17__prune_blockchain!();
57+
crate::impl_client_v23__save_mempool!();
58+
crate::impl_client_v25__scan_blocks!();
59+
crate::impl_client_v17__verify_chain!();
60+
crate::impl_client_v17__verify_tx_out_proof!();
61+
62+
// == Control ==
63+
crate::impl_client_v17__get_memory_info!();
64+
crate::impl_client_v18__get_rpc_info!();
65+
crate::impl_client_v17__help!();
66+
crate::impl_client_v17__logging!();
67+
crate::impl_client_v17__stop!();
68+
crate::impl_client_v17__uptime!();
69+
70+
// == Generating ==
71+
crate::impl_client_v25__generate_block!();
72+
crate::impl_client_v17__generate_to_address!();
73+
crate::impl_client_v20__generate_to_descriptor!();
74+
crate::impl_client_v17__invalidate_block!();
75+
76+
// == Hidden ==
77+
crate::impl_client_v21__add_peer_address!();
78+
79+
// == Mining ==
80+
crate::impl_client_v17__get_block_template!();
81+
crate::impl_client_v17__get_mining_info!();
82+
crate::impl_client_v17__get_network_hashes_per_second!();
83+
crate::impl_client_v26__get_prioritised_transactions!();
84+
crate::impl_client_v17__prioritise_transaction!();
85+
crate::impl_client_v17__submit_block!();
86+
crate::impl_client_v18__submit_header!();
87+
88+
// == Network ==
89+
crate::impl_client_v17__add_node!();
90+
crate::impl_client_v17__clear_banned!();
91+
crate::impl_client_v17__disconnect_node!();
92+
crate::impl_client_v17__get_added_node_info!();
93+
crate::impl_client_v26__get_addr_man_info!();
94+
crate::impl_client_v17__get_connection_count!();
95+
crate::impl_client_v17__get_net_totals!();
96+
crate::impl_client_v17__get_network_info!();
97+
crate::impl_client_v18__get_node_addresses!();
98+
crate::impl_client_v17__get_peer_info!();
99+
crate::impl_client_v17__list_banned!();
100+
crate::impl_client_v17__ping!();
101+
crate::impl_client_v17__set_ban!();
102+
crate::impl_client_v17__set_network_active!();
103+
104+
// == Rawtransactions ==
105+
crate::impl_client_v18__analyze_psbt!();
106+
crate::impl_client_v17__combine_psbt!();
107+
crate::impl_client_v17__combine_raw_transaction!();
108+
crate::impl_client_v17__convert_to_psbt!();
109+
crate::impl_client_v17__create_psbt!();
110+
crate::impl_client_v17__create_raw_transaction!();
111+
crate::impl_client_v17__decode_psbt!();
112+
crate::impl_client_v17__decode_raw_transaction!();
113+
crate::impl_client_v17__decode_script!();
114+
crate::impl_client_v17__finalize_psbt!();
115+
crate::impl_client_v17__fund_raw_transaction!();
116+
crate::impl_client_v17__get_raw_transaction!();
117+
crate::impl_client_v18__join_psbts!();
118+
crate::impl_client_v17__send_raw_transaction!();
119+
crate::impl_client_v17__sign_raw_transaction!();
120+
crate::impl_client_v17__sign_raw_transaction_with_key!();
121+
crate::impl_client_v28__submit_package!();
122+
crate::impl_client_v17__test_mempool_accept!();
123+
crate::impl_client_v18__utxo_update_psbt!();
124+
125+
// == Signer ==
126+
crate::impl_client_v22__enumerate_signers!();
127+
128+
// == Util ==
129+
crate::impl_client_v17__create_multisig!();
130+
crate::impl_client_v29__derive_addresses!();
131+
crate::impl_client_v17__estimate_smart_fee!();
132+
crate::impl_client_v18__get_descriptor_info!();
133+
crate::impl_client_v21__get_index_info!();
134+
crate::impl_client_v17__sign_message_with_priv_key!();
135+
crate::impl_client_v17__validate_address!();
136+
crate::impl_client_v17__verify_message!();
137+
138+
// == Wallet ==
139+
crate::impl_client_v17__abandon_transaction!();
140+
crate::impl_client_v17__abort_rescan!();
141+
crate::impl_client_v17__add_multisig_address!();
142+
crate::impl_client_v17__backup_wallet!();
143+
crate::impl_client_v17__bump_fee!();
144+
crate::impl_client_v23__create_wallet!();
145+
crate::impl_client_v28__create_wallet_descriptor!();
146+
crate::impl_client_v17__dump_priv_key!();
147+
crate::impl_client_v17__dump_wallet!();
148+
crate::impl_client_v17__encrypt_wallet!();
149+
crate::impl_client_v17__get_addresses_by_label!();
150+
crate::impl_client_v17__get_address_info!();
151+
crate::impl_client_v17__get_balance!();
152+
crate::impl_client_v19__get_balances!();
153+
crate::impl_client_v28__get_hd_keys!();
154+
crate::impl_client_v18__get_received_by_label!();
155+
crate::impl_client_v17__get_new_address!();
156+
crate::impl_client_v17__get_raw_change_address!();
157+
crate::impl_client_v17__get_received_by_address!();
158+
crate::impl_client_v17__get_transaction!();
159+
crate::impl_client_v17__get_unconfirmed_balance!();
160+
crate::impl_client_v17__get_wallet_info!();
161+
crate::impl_client_v17__import_address!();
162+
crate::impl_client_v21__import_descriptors!();
163+
crate::impl_client_v17__import_multi!();
164+
crate::impl_client_v17__import_privkey!();
165+
crate::impl_client_v17__import_pruned_funds!();
166+
crate::impl_client_v17__import_pubkey!();
167+
crate::impl_client_v17__import_wallet!();
168+
crate::impl_client_v17__key_pool_refill!();
169+
crate::impl_client_v17__list_address_groupings!();
170+
crate::impl_client_v22__list_descriptors!();
171+
crate::impl_client_v18__list_received_by_label!();
172+
crate::impl_client_v17__list_labels!();
173+
crate::impl_client_v17__list_lock_unspent!();
174+
crate::impl_client_v17__list_received_by_address!();
175+
crate::impl_client_v17__list_since_block!();
176+
crate::impl_client_v17__list_transactions!();
177+
crate::impl_client_v17__list_unspent!();
178+
crate::impl_client_v18__list_wallet_dir!();
179+
crate::impl_client_v17__list_wallets!();
180+
crate::impl_client_v22__load_wallet!();
181+
crate::impl_client_v17__lock_unspent!();
182+
crate::impl_client_v24__migrate_wallet!();
183+
crate::impl_client_v23__new_keypool!();
184+
crate::impl_client_v21__psbt_bump_fee!();
185+
crate::impl_client_v17__remove_pruned_funds!();
186+
crate::impl_client_v17__rescan_blockchain!();
187+
crate::impl_client_v23__restore_wallet!();
188+
crate::impl_client_v21__send!();
189+
crate::impl_client_v24__send_all!();
190+
crate::impl_client_v17__send_many!();
191+
crate::impl_client_v21__send_many_verbose!();
192+
crate::impl_client_v17__send_to_address!();
193+
crate::impl_client_v17__set_hd_seed!();
194+
crate::impl_client_v17__set_tx_fee!();
195+
crate::impl_client_v19__set_wallet_flag!();
196+
crate::impl_client_v17__sign_message!();
197+
crate::impl_client_v17__sign_raw_transaction_with_wallet!();
198+
crate::impl_client_v24__simulate_raw_transaction!();
199+
crate::impl_client_v21__unload_wallet!();
200+
crate::impl_client_v21__upgrade_wallet!();
201+
crate::impl_client_v17__wallet_create_funded_psbt!();
202+
crate::impl_client_v22__wallet_display_address!();
203+
crate::impl_client_v17__wallet_lock!();
204+
crate::impl_client_v17__wallet_passphrase!();
205+
crate::impl_client_v17__wallet_passphrase_change!();
206+
crate::impl_client_v17__wallet_process_psbt!();
207+
208+
// == Zmq ==
209+
crate::impl_client_v17__get_zmq_notifications!();

contrib/templates/bitcoind_aliases

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ alias bt26='/opt/bitcoin-26.2/bin/bitcoin-cli -regtest -rpcuser=user -rpcpasswor
1414
alias bt27='/opt/bitcoin-27.2/bin/bitcoin-cli -regtest -rpcuser=user -rpcpassword=password -rpcport=27249'
1515
alias bt28='/opt/bitcoin-28.1/bin/bitcoin-cli -regtest -rpcuser=user -rpcpassword=password -rpcport=28149'
1616
alias bt29='/opt/bitcoin-29.0/bin/bitcoin-cli -regtest -rpcuser=user -rpcpassword=password -rpcport=29049'
17+
alias bt30='/opt/bitcoin-30.0/bin/bitcoin-cli -regtest -rpcuser=user -rpcpassword=password -rpcport=30049'
1718

1819
# Test aliases for different Bitcoin Core versions
1920

@@ -30,3 +31,4 @@ alias test26='BITCOIND_EXE=/opt/bitcoin-26.2/bin/bitcoind cargo test --features=
3031
alias test27='BITCOIND_EXE=/opt/bitcoin-27.2/bin/bitcoind cargo test --features="27_2"'
3132
alias test28='BITCOIND_EXE=/opt/bitcoin-28.1/bin/bitcoind cargo test --features="28_1"'
3233
alias test29='BITCOIND_EXE=/opt/bitcoin-29.0/bin/bitcoind cargo test --features="29_0"'
34+
alias test30='BITCOIND_EXE=/opt/bitcoin-30.0/bin/bitcoind cargo test --features="30_0"'

contrib/templates/run-bitcoind.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ v26 26.2 262 /opt/bitcoin-26.2/bin/bitcoind
1111
v27 27.2 272 /opt/bitcoin-27.2/bin/bitcoind
1212
v28 28.1 281 /opt/bitcoin-28.1/bin/bitcoind
1313
v29 29.0 290 /opt/bitcoin-29.0/bin/bitcoind
14+
v30 30.0 300 /opt/bitcoin-30.0/bin/bitcoind

integration_test/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ edition = "2021"
1414
download = ["node/download"]
1515

1616
# Enable the same feature in `node` and the version feature here.
17-
# All minor releases of the latest three versions.
17+
# All minor releases of the latest four versions.
18+
30_0 = ["v30_and_below", "node/30_0"]
1819
29_0 = ["v29_and_below", "node/29_0"]
1920
28_2 = ["v28_and_below", "node/28_2"]
2021
28_1 = ["v28_and_below", "node/28_1"]
@@ -38,7 +39,8 @@ download = ["node/download"]
3839
# Each major version is tested with the same client.
3940
# A specific range of versions can be specified e.g. for 24-26:
4041
# #[cfg(all(feature = "v26_and_below", not(feature = "v23_and_below")))]
41-
v29_and_below = []
42+
v30_and_below = []
43+
v29_and_below = ["v30_and_below"]
4244
v28_and_below = ["v29_and_below"]
4345
v27_and_below = ["v28_and_below"]
4446
v26_and_below = ["v27_and_below"]

node/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ default = ["0_17_2"]
4444

4545
download = ["anyhow", "bitcoin_hashes", "flate2", "tar", "minreq", "zip"]
4646

47-
# We support all minor releases of the latest three versions.
47+
# We support all minor releases of the latest four versions.
48+
30_0 = ["29_0"]
4849
29_0 = ["28_2"]
4950
28_2 = ["28_1"]
5051
28_1 = ["28_0"]

node/contrib/extra_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
set -euox pipefail
1616

17-
FEATURES=("29_0" "28_2" "28_1" "28_0" "27_1" "27_0" "26_2" "25_2" "24_2" \
17+
FEATURES=("30_0 "29_0" "28_2" "28_1" "28_0" "27_1" "27_0" "26_2" "25_2" "24_2" \
1818
"23_2" "22_1" "0_21_2" "0_20_2" "0_19_1" "0_18_1" "0_17_2")
1919
2020
# Use the current `Cargo.lock` file without updating it.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
d4c91b1fb02708397317a79efa4fc5e1ad5f3b85fab894316e104cc8ebeb17b8 bitcoin-30.0-aarch64-linux-gnu-debug.tar.gz
2+
785f49061ae65fcf31b8323803bbaa284569dc65e7aba68229e2da222a449635 bitcoin-30.0-aarch64-linux-gnu.tar.gz
3+
fe60e9535c13cb58b39e1c82c446ca9afc96970ec309474b9e708e103d9e9e94 bitcoin-30.0-arm-linux-gnueabihf-debug.tar.gz
4+
68eef66e4c18396449450f45626e023dc96023742bb760aafcf4625a59c01c56 bitcoin-30.0-arm-linux-gnueabihf.tar.gz
5+
31c6eef5158c9416b8923adc090b88394421dbee7de0e676a39e43de12051580 bitcoin-30.0-arm64-apple-darwin.tar.gz
6+
f6e2d885027e25500c8b16406c95b0fb7e536a4e2bbaae2cf8b48a476a60abe1 bitcoin-30.0-arm64-apple-darwin.zip
7+
60fcd271f902c1dab821148b46342695cc1ee10366211ccd3ffb844256e4cd2f bitcoin-30.0-arm64-apple-darwin-codesigning.tar.gz
8+
11b8e7acc678eb372bf5f8a8a6ff4705cb3572e573218a1e6833c3abfa2268db bitcoin-30.0-arm64-apple-darwin-unsigned.tar.gz
9+
01c612aee1faa59bf6234aca112097d5799220ba05a020cf997d9993e85aa8ee bitcoin-30.0-arm64-apple-darwin-unsigned.zip
10+
38da8058a2d674f3ed402721178d6e52b1adb9f0a7a9686aaad0c99157ab0512 bitcoin-30.0-codesignatures-30.0.tar.gz
11+
9b472a4d51dfed9aa9d0ded2cb8c7bcb9267f8439a23a98f36eb509c1a5e6974 bitcoin-30.0.tar.gz
12+
d5ea7f1a20da39cec29bc9d8242b835bf0e0bcece2240b986507a9b61ba23501 bitcoin-30.0-powerpc64-linux-gnu-debug.tar.gz
13+
1402808855de1349a4abfdcd4295dd3e793359ceb10b39673542730e353fce63 bitcoin-30.0-powerpc64-linux-gnu.tar.gz
14+
10371a60e8b324f7dbca63381ba317b67ec3c7897c099a1a450232e70632e57c bitcoin-30.0-riscv64-linux-gnu-debug.tar.gz
15+
f720a3a97e69ce08ee6effe7f0830ffbee56833df5aa3acbf8fa159250947513 bitcoin-30.0-riscv64-linux-gnu.tar.gz
16+
4eadf7b06dca695b940ad30f46247aacbd439544a1be25b0ef3baab73777b3d2 bitcoin-30.0-x86_64-apple-darwin.tar.gz
17+
0eb10b714a4f5a0f7c40a9533d0bda141c739e7930c814e392baa99b3bf24790 bitcoin-30.0-x86_64-apple-darwin.zip
18+
84b7de64c8e25bcdfb5ba24f2b4c2d5205b19bf01b406d2e368944e2ebd191df bitcoin-30.0-x86_64-apple-darwin-codesigning.tar.gz
19+
f1dc0fea030dd392ea199c0f3caee13ca2b65a9a992eaf97bf3071ff997d32a1 bitcoin-30.0-x86_64-apple-darwin-unsigned.tar.gz
20+
f2f1362be35c8afcf3250f7badbd0c8060e82ced11ef7d0ebea4c83dca4001d5 bitcoin-30.0-x86_64-apple-darwin-unsigned.zip
21+
bde1cd4652971613fe1766357550e61d7dbe28b1b24c88efa456bc8849ad1221 bitcoin-30.0-x86_64-linux-gnu-debug.tar.gz
22+
00964ae375084113b1162f2f493b9372421608af23539766e315a3cb0ee54248 bitcoin-30.0-x86_64-linux-gnu.tar.gz
23+
3065d43b57f967687399f9c00d424556d16d33997e1653fdb5bf1934b95168e6 bitcoin-30.0-win64-setup.exe
24+
3d6f3af2cbfbeaf1958d0ffd77e04da6b8b82f26bb67aaa9111247620d5c95db bitcoin-30.0-win64.zip
25+
70e7b116cfb171af07b6f1605a6624a8a30c2b4edeba7dbf27766286cebe2a92 bitcoin-30.0-win64-codesigning.tar.gz
26+
8a16d8a1ef2d2c850d2d2d8461a220ba6e30011b689ac2e2ea6158650a676bbd bitcoin-30.0-win64-debug.zip
27+
190a9a979cb161913c1cc2501937a5fe16a8f5d08de034cc00fe9ea769088665 bitcoin-30.0-win64-setup-unsigned.exe
28+
bed46b79d0a5ee0db5ef8d19ce0077b0b6fe642367336447ca7acdc869f2823a bitcoin-30.0-win64-unsigned.zip

node/src/client_versions.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66

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

9-
#[cfg(feature = "29_0")]
9+
#[cfg(feature = "30_0")]
10+
pub use corepc_client::{client_sync::v30::*, types::v30 as vtype};
11+
12+
#[cfg(all(feature = "29_0", not(feature = "30_0")))]
1013
pub use corepc_client::{client_sync::v29::*, types::v29 as vtype};
1114

1215
#[cfg(all(feature = "28_2", not(feature = "29_0")))]
@@ -60,6 +63,7 @@ pub use corepc_client::{client_sync::v17::*, types::v17 as vtype};
6063
/// This is meaningless but we need it otherwise we can't get far enough into
6164
/// the build process to trigger the `compile_error!` in `./versions.rs`.
6265
#[cfg(all(
66+
not(feature = "30_0"),
6367
not(feature = "29_0"),
6468
not(feature = "28_2"),
6569
not(feature = "28_1"),

node/src/versions.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// An explicit version of Bitcoin Core must be selected by enabling some feature.
22
// We check this here instead of in `lib.rs` because this file is included in `build.rs`.
33
#[cfg(all(
4+
not(feature = "30_0"),
45
not(feature = "29_0"),
56
not(feature = "28_2"),
67
not(feature = "28_1"),
@@ -21,8 +22,11 @@
2122
))]
2223
compile_error!("enable a feature in order to select the version of Bitcoin Core to use");
2324

24-
#[cfg(feature = "29_0")]
25+
#[cfg(feature = "30_0")]
2526
#[allow(dead_code)] // Triggers in --all-features builds.
27+
pub const VERSION: &str = "30.0";
28+
29+
#[cfg(all(feature = "29_0", not(feature = "30_0")))]
2630
pub const VERSION: &str = "29.0";
2731

2832
#[cfg(all(feature = "28_2", not(feature = "29_0")))]
@@ -76,6 +80,7 @@ pub const VERSION: &str = "0.17.2";
7680
/// This is meaningless but we need it otherwise we can't get far enough into
7781
/// the build process to trigger the `compile_error!` in `./versions.rs`.
7882
#[cfg(all(
83+
not(feature = "30_0"),
7984
not(feature = "29_0"),
8085
not(feature = "28_2"),
8186
not(feature = "28_1"),

0 commit comments

Comments
 (0)