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

Commit ad04577

Browse files
committed
Add support for Bitcoin Core v27
Add support and testing for Bitcoin Core versions `27.0` and `27.1`.
1 parent ef0fc39 commit ad04577

File tree

14 files changed

+561
-8
lines changed

14 files changed

+561
-8
lines changed

.github/workflows/rust.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ jobs:
178178
matrix:
179179
feature:
180180
[
181+
"27_1",
182+
"27_0",
181183
"26_2",
182184
"26_1",
183185
"26_0",

client/src/client_sync/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub mod v23;
1313
pub mod v24;
1414
pub mod v25;
1515
pub mod v26;
16+
pub mod v27;
1617

1718
use std::fs::File;
1819
use std::io::{BufRead, BufReader};

client/src/client_sync/v27.rs

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// SPDX-License-Identifier: CC0-1.0
2+
3+
//! A JSON-RPC client for testing against Bitcoin Core `v27`.
4+
//!
5+
//! We ignore option arguments unless they effect the shape of the returned JSON data.
6+
7+
use bitcoin::address::{Address, NetworkChecked};
8+
use bitcoin::{Amount, Block, BlockHash, Txid};
9+
10+
use crate::client_sync::{handle_defaults, into_json};
11+
use crate::json::v27::*;
12+
13+
crate::define_jsonrpc_minreq_client!("v27");
14+
15+
// == Blockchain ==
16+
crate::impl_client_v17__getblockchaininfo!();
17+
crate::impl_client_v17__getbestblockhash!();
18+
crate::impl_client_v17__getblock!();
19+
crate::impl_client_v17__gettxout!();
20+
21+
// == Control ==
22+
crate::impl_client_v17__stop!();
23+
24+
// == Generating ==
25+
crate::impl_client_v17__generatetoaddress!();
26+
27+
// == Network ==
28+
crate::impl_client_v17__getnetworkinfo!();
29+
crate::impl_client_check_expected_server_version!({ [270000, 270100] });
30+
31+
// == Rawtransactions ==
32+
crate::impl_client_v17__sendrawtransaction!();
33+
34+
// == Wallet ==
35+
crate::impl_client_v17__createwallet!();
36+
crate::impl_client_v22__unloadwallet!();
37+
crate::impl_client_v22__loadwallet!();
38+
crate::impl_client_v17__getbalance!();
39+
crate::impl_client_v19__getbalances!();
40+
crate::impl_client_v17__getnewaddress!();
41+
crate::impl_client_v17__sendtoaddress!();
42+
crate::impl_client_v17__gettransaction!();
43+
44+
pub use crate::client_sync::v23::AddressType;

contrib/run_bitcoind.sh

+7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ COMMAND
2323
- stop Kill all bitcoind nodes using 'pkill bitcoind'.
2424
2525
KNOWN_VERSION
26+
- v27 Bitcoin Core v27.1
2627
- v26 Bitcoin Core v26.2
2728
- v25 Bitcoin Core v25.2
2829
- v24 Bitcoin Core v24.2
@@ -48,6 +49,7 @@ main() {
4849

4950
case $cmd in
5051
all)
52+
start "v27" # 27.1
5153
start "v26" # 26.2
5254
start "v25" # 25.2
5355
start "v24" # 24.2
@@ -82,6 +84,11 @@ start() {
8284
local version="$1"
8385

8486
case $version in
87+
v27)
88+
local version_number="27.1"
89+
local version_id="271"
90+
;;
91+
8592
v26)
8693
local version_number="26.2"
8794
local version_id="262"

integration_test/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ edition = "2021"
1313
[features]
1414
# Enable the same feature in `bitcoind` and the version feature here.
1515
# All minor releases (but only the latest patch release).
16+
"27_1" = ["v27", "bitcoind/27_1"]
17+
"27_0" = ["v27", "bitcoind/27_0"]
1618
"26_2" = ["v26", "bitcoind/26_2"]
1719
"26_1" = ["v26", "bitcoind/26_1"]
1820
"26_0" = ["v26", "bitcoind/26_0"]
@@ -35,6 +37,7 @@ edition = "2021"
3537
"0_17_1" = ["v17", "bitcoind/0_17_1"]
3638

3739
# Each minor version is tested with the same client.
40+
"v27" = []
3841
"v26" = []
3942
"v25" = []
4043
"v24" = []

integration_test/tests/v27_api.rs

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
//! Test the JSON-RPC API against `bitcoind v27.1`.
2+
3+
#![cfg(feature = "v27")]
4+
5+
use integration_test::*;
6+
7+
// == Blockchain ==
8+
mod blockchain {
9+
use super::*;
10+
11+
impl_test_v17__getblockchaininfo!();
12+
impl_test_v17__getbestblockhash!();
13+
impl_test_v17__getblock_verbosity_0!();
14+
impl_test_v17__getblock_verbosity_1!();
15+
}
16+
17+
// == Control ==
18+
mod control {
19+
use super::*;
20+
21+
impl_test_v17__stop!();
22+
}
23+
24+
// == Generating ==
25+
mod generating {
26+
use super::*;
27+
28+
impl_test_v17__generatetoaddress!();
29+
}
30+
31+
// == Network ==
32+
mod network {
33+
use super::*;
34+
35+
impl_test_v17__getnetworkinfo!();
36+
}
37+
38+
// == Rawtransactions ==
39+
mod raw_transactions {
40+
use super::*;
41+
42+
impl_test_v17__sendrawtransaction!();
43+
}
44+
45+
// == Wallet ==
46+
mod wallet {
47+
use super::*;
48+
49+
impl_test_v17__createwallet!();
50+
impl_test_v17__loadwallet!();
51+
52+
impl_test_v17__getnewaddress!();
53+
impl_test_v17__getbalance!();
54+
impl_test_v19__getbalances!();
55+
impl_test_v17__sendtoaddress!();
56+
impl_test_v17__gettransaction!();
57+
}

json/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub mod v23;
1818
pub mod v24;
1919
pub mod v25;
2020
pub mod v26;
21+
pub mod v27;
2122

2223
// JSON types that model _all_ `bitcoind` versions.
2324
pub mod model;

json/src/v27/mod.rs

+195
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
// SPDX-License-Identifier: CC0-1.0
2+
3+
//! Structs with standard types.
4+
//!
5+
//! These structs model the types returned by the JSON-RPC API and use stdlib types (or custom
6+
//! types) and are specific to a specific to Bitcoin Core `v27`.
7+
//!
8+
//! **== Blockchain ==**
9+
//! - [ ] `dumptxoutset "path"`
10+
//! - [x] `getbestblockhash`
11+
//! - [x] `getblock "blockhash" ( verbosity )`
12+
//! - [x] `getblockchaininfo`
13+
//! - [ ] `getblockcount`
14+
//! - [ ] `getblockfilter "blockhash" ( "filtertype" )`
15+
//! - [ ] `getblockfrompeer "blockhash" peer_id`
16+
//! - [ ] `getblockhash height`
17+
//! - [ ] `getblockheader "blockhash" ( verbose )`
18+
//! - [ ] `getblockstats hash_or_height ( stats )`
19+
//! - [ ] `getchainstates`
20+
//! - [ ] `getchaintips`
21+
//! - [ ] `getchaintxstats ( nblocks "blockhash" )`
22+
//! - [ ] `getdeploymentinfo ( "blockhash" )`
23+
//! - [ ] `getdifficulty`
24+
//! - [ ] `getmempoolancestors "txid" ( verbose )`
25+
//! - [ ] `getmempooldescendants "txid" ( verbose )`
26+
//! - [ ] `getmempoolentry "txid"`
27+
//! - [ ] `getmempoolinfo`
28+
//! - [ ] `getrawmempool ( verbose mempool_sequence )`
29+
//! - [ ] `gettxout "txid" n ( include_mempool )`
30+
//! - [ ] `gettxoutproof ["txid",...] ( "blockhash" )`
31+
//! - [ ] `gettxoutsetinfo ( "hash_type" hash_or_height use_index )`
32+
//! - [ ] `gettxspendingprevout [{"txid":"hex","vout":n},...]`
33+
//! - [ ] `importmempool "filepath" ( options )`
34+
//! - [ ] `loadtxoutset "path"`
35+
//! - [ ] `preciousblock "blockhash"`
36+
//! - [ ] `pruneblockchain height`
37+
//! - [ ] `savemempool`
38+
//! - [ ] `scanblocks "action" ( [scanobjects,...] start_height stop_height "filtertype" options )`
39+
//! - [ ] `scantxoutset "action" ( [scanobjects,...] )`
40+
//! - [ ] `verifychain ( checklevel nblocks )`
41+
//! - [ ] `verifytxoutproof "proof"`
42+
//!
43+
//! **== Control ==**
44+
//! - [ ] `getmemoryinfo ( "mode" )`
45+
//! - [ ] `getrpcinfo`
46+
//! - [ ] `help ( "command" )`
47+
//! - [ ] `logging ( ["include_category",...] ["exclude_category",...] )`
48+
//! - [x] `stop`
49+
//! - [ ] `uptime`
50+
//!
51+
//! **== Mining ==**
52+
//! - [ ] `getblocktemplate {"mode":"str","capabilities":["str",...],"rules":["segwit","str",...],"longpollid":"str","data":"hex"}`
53+
//! - [ ] `getmininginfo`
54+
//! - [ ] `getnetworkhashps ( nblocks height )`
55+
//! - [ ] `getprioritisedtransactions`
56+
//! - [ ] `prioritisetransaction "txid" ( dummy ) fee_delta`
57+
//! - [ ] `submitblock "hexdata" ( "dummy" )`
58+
//! - [ ] `submitheader "hexdata"`
59+
//!
60+
//! **== Network ==**
61+
//! - [ ] `addnode "node" "command" ( v2transport )`
62+
//! - [ ] `clearbanned`
63+
//! - [ ] `disconnectnode ( "address" nodeid )`
64+
//! - [ ] `getaddednodeinfo ( "node" )`
65+
//! - [ ] `getaddrmaninfo`
66+
//! - [ ] `getconnectioncount`
67+
//! - [ ] `getnettotals`
68+
//! - [ ] `getnetworkinfo`
69+
//! - [ ] `getnodeaddresses ( count "network" )`
70+
//! - [ ] `getpeerinfo`
71+
//! - [ ] `listbanned`
72+
//! - [ ] `ping`
73+
//! - [ ] `setban "subnet" "command" ( bantime absolute )`
74+
//! - [ ] `setnetworkactive state`
75+
//!
76+
//! **== Rawtransactions ==**
77+
//! - [ ] `analyzepsbt "psbt"`
78+
//! - [ ] `combinepsbt ["psbt",...]`
79+
//! - [ ] `combinerawtransaction ["hexstring",...]`
80+
//! - [ ] `converttopsbt "hexstring" ( permitsigdata iswitness )`
81+
//! - [ ] `createpsbt [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount,...},{"data":"hex"},...] ( locktime replaceable )`
82+
//! - [ ] `createrawtransaction [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount,...},{"data":"hex"},...] ( locktime replaceable )`
83+
//! - [ ] `decodepsbt "psbt"`
84+
//! - [ ] `decoderawtransaction "hexstring" ( iswitness )`
85+
//! - [ ] `decodescript "hexstring"`
86+
//! - [ ] `descriptorprocesspsbt "psbt" ["",{"desc":"str","range":n or [n,n]},...] ( "sighashtype" bip32derivs finalize )`
87+
//! - [ ] `finalizepsbt "psbt" ( extract )`
88+
//! - [ ] `fundrawtransaction "hexstring" ( options iswitness )`
89+
//! - [ ] `getrawtransaction "txid" ( verbosity "blockhash" )`
90+
//! - [ ] `joinpsbts ["psbt",...]`
91+
//! - [ ] `sendrawtransaction "hexstring" ( maxfeerate maxburnamount )`
92+
//! - [ ] `signrawtransactionwithkey "hexstring" ["privatekey",...] ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )`
93+
//! - [ ] `submitpackage ["rawtx",...]`
94+
//! - [ ] `testmempoolaccept ["rawtx",...] ( maxfeerate )`
95+
//! - [ ] `utxoupdatepsbt "psbt" ( ["",{"desc":"str","range":n or [n,n]},...] )`
96+
//!
97+
//! **== Signer ==**
98+
//! - [ ] `enumeratesigners`
99+
//!
100+
//! **== Util ==**
101+
//! - [ ] `createmultisig nrequired ["key",...] ( "address_type" )`
102+
//! - [ ] `deriveaddresses "descriptor" ( range )`
103+
//! - [ ] `estimatesmartfee conf_target ( "estimate_mode" )`
104+
//! - [ ] `getdescriptorinfo "descriptor"`
105+
//! - [ ] `getindexinfo ( "index_name" )`
106+
//! - [ ] `signmessagewithprivkey "privkey" "message"`
107+
//! - [ ] `validateaddress "address"`
108+
//! - [ ] `verifymessage "address" "signature" "message"`
109+
//!
110+
//! **== Wallet ==**
111+
//! - [ ] `abandontransaction "txid"`
112+
//! - [ ] `abortrescan`
113+
//! - [ ] `addmultisigaddress nrequired ["key",...] ( "label" "address_type" )`
114+
//! - [ ] `backupwallet "destination"`
115+
//! - [ ] `bumpfee "txid" ( options )`
116+
//! - [ ] `createwallet "wallet_name" ( disable_private_keys blank "passphrase" avoid_reuse descriptors load_on_startup external_signer )`
117+
//! - [ ] `dumpprivkey "address"`
118+
//! - [ ] `dumpwallet "filename"`
119+
//! - [ ] `encryptwallet "passphrase"`
120+
//! - [ ] `getaddressesbylabel "label"`
121+
//! - [ ] `getaddressinfo "address"`
122+
//! - [x] `getbalance ( "dummy" minconf include_watchonly avoid_reuse )`
123+
//! - [x] `getbalances`
124+
//! - [x] `getnewaddress ( "label" "address_type" )`
125+
//! - [ ] `getrawchangeaddress ( "address_type" )`
126+
//! - [ ] `getreceivedbyaddress "address" ( minconf include_immature_coinbase )`
127+
//! - [ ] `getreceivedbylabel "label" ( minconf include_immature_coinbase )`
128+
//! - [x] `gettransaction "txid" ( include_watchonly verbose )`
129+
//! - [ ] `getunconfirmedbalance`
130+
//! - [ ] `getwalletinfo`
131+
//! - [ ] `importaddress "address" ( "label" rescan p2sh )`
132+
//! - [ ] `importdescriptors requests`
133+
//! - [ ] `importmulti requests ( options )`
134+
//! - [ ] `importprivkey "privkey" ( "label" rescan )`
135+
//! - [ ] `importprunedfunds "rawtransaction" "txoutproof"`
136+
//! - [ ] `importpubkey "pubkey" ( "label" rescan )`
137+
//! - [ ] `importwallet "filename"`
138+
//! - [ ] `keypoolrefill ( newsize )`
139+
//! - [ ] `listaddressgroupings`
140+
//! - [ ] `listdescriptors ( private )`
141+
//! - [ ] `listlabels ( "purpose" )`
142+
//! - [ ] `listlockunspent`
143+
//! - [ ] `listreceivedbyaddress ( minconf include_empty include_watchonly "address_filter" include_immature_coinbase )`
144+
//! - [ ] `listreceivedbylabel ( minconf include_empty include_watchonly include_immature_coinbase )`
145+
//! - [ ] `listsinceblock ( "blockhash" target_confirmations include_watchonly include_removed include_change "label" )`
146+
//! - [ ] `listtransactions ( "label" count skip include_watchonly )`
147+
//! - [ ] `listunspent ( minconf maxconf ["address",...] include_unsafe query_options )`
148+
//! - [ ] `listwalletdir`
149+
//! - [ ] `listwallets`
150+
//! - [x] `loadwallet "filename" ( load_on_startup )`
151+
//! - [ ] `lockunspent unlock ( [{"txid":"hex","vout":n},...] persistent )`
152+
//! - [ ] `migratewallet ( "wallet_name" "passphrase" )`
153+
//! - [ ] `newkeypool`
154+
//! - [ ] `psbtbumpfee "txid" ( options )`
155+
//! - [ ] `removeprunedfunds "txid"`
156+
//! - [ ] `rescanblockchain ( start_height stop_height )`
157+
//! - [ ] `restorewallet "wallet_name" "backup_file" ( load_on_startup )`
158+
//! - [ ] `send [{"address":amount,...},{"data":"hex"},...] ( conf_target "estimate_mode" fee_rate options )`
159+
//! - [ ] `sendall ["address",{"address":amount,...},...] ( conf_target "estimate_mode" fee_rate options )`
160+
//! - [ ] `sendmany ( "" ) {"address":amount,...} ( minconf "comment" ["address",...] replaceable conf_target "estimate_mode" fee_rate verbose )`
161+
//! - [x] `sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount replaceable conf_target "estimate_mode" avoid_reuse fee_rate verbose )`
162+
//! - [ ] `sethdseed ( newkeypool "seed" )`
163+
//! - [ ] `setlabel "address" "label"`
164+
//! - [ ] `settxfee amount`
165+
//! - [ ] `setwalletflag "flag" ( value )`
166+
//! - [ ] `signmessage "address" "message"`
167+
//! - [ ] `signrawtransactionwithwallet "hexstring" ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )`
168+
//! - [ ] `simulaterawtransaction ( ["rawtx",...] {"include_watchonly":bool,...} )`
169+
//! - [ ] `unloadwallet ( "wallet_name" load_on_startup )`
170+
//! - [ ] `upgradewallet ( version )`
171+
//! - [ ] `walletcreatefundedpsbt ( [{"txid":"hex","vout":n,"sequence":n,"weight":n},...] ) [{"address":amount,...},{"data":"hex"},...] ( locktime options bip32derivs )`
172+
//! - [ ] `walletdisplayaddress "address"`
173+
//! - [ ] `walletlock`
174+
//! - [ ] `walletpassphrase "passphrase" timeout`
175+
//! - [ ] `walletpassphrasechange "oldpassphrase" "newpassphrase"`
176+
//! - [ ] `walletprocesspsbt "psbt" ( sign "sighashtype" bip32derivs finalize )`
177+
//!
178+
//! **== Zmq ==**
179+
//! - [ ] `getzmqnotifications`
180+
181+
#[doc(inline)]
182+
pub use crate::{
183+
v17::{
184+
GenerateToAddress, GetBalance, GetBestBlockHash, GetBlockVerbosityOne,
185+
GetBlockVerbosityZero, GetNetworkInfo, GetNetworkInfoAddress, GetNetworkInfoNetwork,
186+
GetNewAddress, GetTransaction, GetTransactionDetail, GetTransactionDetailCategory,
187+
GetTxOut, SendRawTransaction,
188+
},
189+
v19::{
190+
Bip9SoftforkInfo, Bip9SoftforkStatistics, Bip9SoftforkStatus, GetBalances, GetBalancesMine,
191+
GetBalancesWatchOnly, GetBlockchainInfo, Softfork, SoftforkType,
192+
},
193+
v22::{SendToAddress, UnloadWallet},
194+
v25::{CreateWallet, LoadWallet},
195+
};

0 commit comments

Comments
 (0)