This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Add support for Bitcoin Core v28
Add support and testing for Bitcoin Core versions `28.0`
- Loading branch information
Showing
13 changed files
with
503 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,6 +178,7 @@ jobs: | |
matrix: | ||
feature: | ||
[ | ||
"28_0", | ||
"27_1", | ||
"27_0", | ||
"26_2", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// SPDX-License-Identifier: CC0-1.0 | ||
|
||
//! A JSON-RPC client for testing against Bitcoin Core `v27`. | ||
//! | ||
//! We ignore option arguments unless they effect the shape of the returned JSON data. | ||
use bitcoin::address::{Address, NetworkChecked}; | ||
use bitcoin::{Amount, Block, BlockHash, Txid}; | ||
|
||
use crate::client_sync::{handle_defaults, into_json}; | ||
use crate::json::v28::*; | ||
|
||
crate::define_jsonrpc_minreq_client!("v27"); | ||
|
||
// == Blockchain == | ||
crate::impl_client_v17__getblockchaininfo!(); | ||
crate::impl_client_v17__getbestblockhash!(); | ||
crate::impl_client_v17__getblock!(); | ||
crate::impl_client_v17__gettxout!(); | ||
|
||
// == Control == | ||
crate::impl_client_v17__stop!(); | ||
|
||
// == Generating == | ||
crate::impl_client_v17__generatetoaddress!(); | ||
|
||
// == Network == | ||
crate::impl_client_v17__getnetworkinfo!(); | ||
crate::impl_client_check_expected_server_version!({ [270000, 270100] }); | ||
|
||
// == Rawtransactions == | ||
crate::impl_client_v17__sendrawtransaction!(); | ||
|
||
// == Wallet == | ||
crate::impl_client_v17__createwallet!(); | ||
crate::impl_client_v22__unloadwallet!(); | ||
crate::impl_client_v22__loadwallet!(); | ||
crate::impl_client_v17__getbalance!(); | ||
crate::impl_client_v19__getbalances!(); | ||
crate::impl_client_v17__getnewaddress!(); | ||
crate::impl_client_v17__sendtoaddress!(); | ||
crate::impl_client_v17__gettransaction!(); | ||
|
||
pub use crate::client_sync::v23::AddressType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
//! Test the JSON-RPC API against `bitcoind v28.0`. | ||
#![cfg(feature = "v28")] | ||
|
||
use integration_test::*; | ||
|
||
// == Blockchain == | ||
mod blockchain { | ||
use super::*; | ||
|
||
impl_test_v17__getblockchaininfo!(); | ||
impl_test_v17__getbestblockhash!(); | ||
impl_test_v17__getblock_verbosity_0!(); | ||
impl_test_v17__getblock_verbosity_1!(); | ||
} | ||
|
||
// == Control == | ||
mod control { | ||
use super::*; | ||
|
||
impl_test_v17__stop!(); | ||
} | ||
|
||
// == Generating == | ||
mod generating { | ||
use super::*; | ||
|
||
impl_test_v17__generatetoaddress!(); | ||
} | ||
|
||
// == Network == | ||
mod network { | ||
use super::*; | ||
|
||
impl_test_v17__getnetworkinfo!(); | ||
} | ||
|
||
// == Rawtransactions == | ||
mod raw_transactions { | ||
use super::*; | ||
|
||
impl_test_v17__sendrawtransaction!(); | ||
} | ||
|
||
// == Wallet == | ||
mod wallet { | ||
use super::*; | ||
|
||
impl_test_v17__createwallet!(); | ||
impl_test_v17__loadwallet!(); | ||
|
||
impl_test_v17__getnewaddress!(); | ||
impl_test_v17__getbalance!(); | ||
impl_test_v19__getbalances!(); | ||
impl_test_v17__sendtoaddress!(); | ||
impl_test_v17__gettransaction!(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,197 @@ | ||
// SPDX-License-Identifier: CC0-1.0 | ||
|
||
//! Structs with standard types. | ||
//! | ||
//! These structs model the types returned by the JSON-RPC API and use stdlib types (or custom | ||
//! types) and are specific to a specific to Bitcoin Core `v26`. | ||
//! | ||
//! **== Blockchain ==** | ||
//! - [ ] `dumptxoutset "path"` | ||
//! - [x] `getbestblockhash` | ||
//! - [x] `getblock "blockhash" ( verbosity )` | ||
//! - [x] `getblockchaininfo` | ||
//! - [ ] `getblockcount` | ||
//! - [ ] `getblockfilter "blockhash" ( "filtertype" )` | ||
//! - [ ] `getblockfrompeer "blockhash" peer_id` | ||
//! - [ ] `getblockhash height` | ||
//! - [ ] `getblockheader "blockhash" ( verbose )` | ||
//! - [ ] `getblockstats hash_or_height ( stats )` | ||
//! - [ ] `getchainstates` | ||
//! - [ ] `getchaintips` | ||
//! - [ ] `getchaintxstats ( nblocks "blockhash" )` | ||
//! - [ ] `getdeploymentinfo ( "blockhash" )` | ||
//! - [ ] `getdifficulty` | ||
//! - [ ] `getmempoolancestors "txid" ( verbose )` | ||
//! - [ ] `getmempooldescendants "txid" ( verbose )` | ||
//! - [ ] `getmempoolentry "txid"` | ||
//! - [ ] `getmempoolinfo` | ||
//! - [ ] `getrawmempool ( verbose mempool_sequence )` | ||
//! - [ ] `gettxout "txid" n ( include_mempool )` | ||
//! - [ ] `gettxoutproof ["txid",...] ( "blockhash" )` | ||
//! - [ ] `gettxoutsetinfo ( "hash_type" hash_or_height use_index )` | ||
//! - [ ] `gettxspendingprevout [{"txid":"hex","vout":n},...]` | ||
//! - [ ] `importmempool "filepath" ( options )` | ||
//! - [ ] `loadtxoutset "path"` | ||
//! - [ ] `preciousblock "blockhash"` | ||
//! - [ ] `pruneblockchain height` | ||
//! - [ ] `savemempool` | ||
//! - [ ] `scanblocks "action" ( [scanobjects,...] start_height stop_height "filtertype" options )` | ||
//! - [ ] `scantxoutset "action" ( [scanobjects,...] )` | ||
//! - [ ] `verifychain ( checklevel nblocks )` | ||
//! - [ ] `verifytxoutproof "proof"` | ||
//! | ||
//! **== Control ==** | ||
//! - [ ] `getmemoryinfo ( "mode" )` | ||
//! - [ ] `getrpcinfo` | ||
//! - [ ] `help ( "command" )` | ||
//! - [ ] `logging ( ["include_category",...] ["exclude_category",...] )` | ||
//! - [x] `stop` | ||
//! - [ ] `uptime` | ||
//! | ||
//! **== Mining ==** | ||
//! - [ ] `getblocktemplate {"mode":"str","capabilities":["str",...],"rules":["segwit","str",...],"longpollid":"str","data":"hex"}` | ||
//! - [ ] `getmininginfo` | ||
//! - [ ] `getnetworkhashps ( nblocks height )` | ||
//! - [ ] `getprioritisedtransactions` | ||
//! - [ ] `prioritisetransaction "txid" ( dummy ) fee_delta` | ||
//! - [ ] `submitblock "hexdata" ( "dummy" )` | ||
//! - [ ] `submitheader "hexdata"` | ||
//! - [ ] `//!` | ||
//! - [ ] `//! **== Network ==**` | ||
//! - [ ] `addnode "node" "command" ( v2transport )` | ||
//! - [ ] `clearbanned` | ||
//! - [ ] `disconnectnode ( "address" nodeid )` | ||
//! - [ ] `getaddednodeinfo ( "node" )` | ||
//! - [ ] `getaddrmaninfo` | ||
//! - [ ] `getconnectioncount` | ||
//! - [ ] `getnettotals` | ||
//! - [ ] `getnetworkinfo` | ||
//! - [ ] `getnodeaddresses ( count "network" )` | ||
//! - [ ] `getpeerinfo` | ||
//! - [ ] `listbanned` | ||
//! - [ ] `ping` | ||
//! - [ ] `setban "subnet" "command" ( bantime absolute )` | ||
//! - [ ] `setnetworkactive state` | ||
//! | ||
//! **== Rawtransactions ==** | ||
//! - [ ] `analyzepsbt "psbt"` | ||
//! - [ ] `combinepsbt ["psbt",...]` | ||
//! - [ ] `combinerawtransaction ["hexstring",...]` | ||
//! - [ ] `converttopsbt "hexstring" ( permitsigdata iswitness )` | ||
//! - [ ] `createpsbt [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount,...},{"data":"hex"},...] ( locktime replaceable )` | ||
//! - [ ] `createrawtransaction [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount,...},{"data":"hex"},...] ( locktime replaceable )` | ||
//! - [ ] `decodepsbt "psbt"` | ||
//! - [ ] `decoderawtransaction "hexstring" ( iswitness )` | ||
//! - [ ] `decodescript "hexstring"` | ||
//! - [ ] `descriptorprocesspsbt "psbt" ["",{"desc":"str","range":n or [n,n]},...] ( "sighashtype" bip32derivs finalize )` | ||
//! - [ ] `finalizepsbt "psbt" ( extract )` | ||
//! - [ ] `fundrawtransaction "hexstring" ( options iswitness )` | ||
//! - [ ] `getrawtransaction "txid" ( verbosity "blockhash" )` | ||
//! - [ ] `joinpsbts ["psbt",...]` | ||
//! - [ ] `sendrawtransaction "hexstring" ( maxfeerate maxburnamount )` | ||
//! - [ ] `signrawtransactionwithkey "hexstring" ["privatekey",...] ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )` | ||
//! - [ ] `submitpackage ["rawtx",...] ( maxfeerate maxburnamount )` | ||
//! - [ ] `testmempoolaccept ["rawtx",...] ( maxfeerate )` | ||
//! - [ ] `utxoupdatepsbt "psbt" ( ["",{"desc":"str","range":n or [n,n]},...] )` | ||
//! | ||
//! **== Signer ==** | ||
//! - [ ] `enumeratesigners` | ||
//! | ||
//! **== Util ==** | ||
//! - [ ] `createmultisig nrequired ["key",...] ( "address_type" )` | ||
//! - [ ] `deriveaddresses "descriptor" ( range )` | ||
//! - [ ] `estimatesmartfee conf_target ( "estimate_mode" )` | ||
//! - [ ] `getdescriptorinfo "descriptor"` | ||
//! - [ ] `getindexinfo ( "index_name" )` | ||
//! - [ ] `signmessagewithprivkey "privkey" "message"` | ||
//! - [ ] `validateaddress "address"` | ||
//! - [ ] `verifymessage "address" "signature" "message"` | ||
//! | ||
//! **== Wallet ==** | ||
//! - [ ] `abandontransaction "txid"` | ||
//! - [ ] `abortrescan` | ||
//! - [ ] `addmultisigaddress nrequired ["key",...] ( "label" "address_type" )` | ||
//! - [ ] `backupwallet "destination"` | ||
//! - [ ] `bumpfee "txid" ( options )` | ||
//! - [x] `createwallet "wallet_name" ( disable_private_keys blank "passphrase" avoid_reuse descriptors load_on_startup external_signer )` | ||
//! - [ ] `createwalletdescriptor "type" ( {"internal":bool,"hdkey":"str",...} )` | ||
//! - [ ] `dumpprivkey "address"` | ||
//! - [ ] `dumpwallet "filename"` | ||
//! - [ ] `encryptwallet "passphrase"` | ||
//! - [ ] `getaddressesbylabel "label"` | ||
//! - [ ] `getaddressinfo "address"` | ||
//! - [x] `getbalance ( "dummy" minconf include_watchonly avoid_reuse )` | ||
//! - [x] `getbalances` | ||
//! - [ ] `gethdkeys ( {"active_only":bool,"private":bool,...} )` | ||
//! - [x] `getnewaddress ( "label" "address_type" )` | ||
//! - [ ] `getrawchangeaddress ( "address_type" )` | ||
//! - [ ] `getreceivedbyaddress "address" ( minconf include_immature_coinbase )` | ||
//! - [ ] `getreceivedbylabel "label" ( minconf include_immature_coinbase )` | ||
//! - [x] `gettransaction "txid" ( include_watchonly verbose )` | ||
//! - [ ] `getunconfirmedbalance` | ||
//! - [ ] `getwalletinfo` | ||
//! - [ ] `importaddress "address" ( "label" rescan p2sh )` | ||
//! - [ ] `importdescriptors requests` | ||
//! - [ ] `importmulti requests ( options )` | ||
//! - [ ] `importprivkey "privkey" ( "label" rescan )` | ||
//! - [ ] `importprunedfunds "rawtransaction" "txoutproof"` | ||
//! - [ ] `importpubkey "pubkey" ( "label" rescan )` | ||
//! - [ ] `importwallet "filename"` | ||
//! - [ ] `keypoolrefill ( newsize )` | ||
//! - [ ] `listaddressgroupings` | ||
//! - [ ] `listdescriptors ( private )` | ||
//! - [ ] `listlabels ( "purpose" )` | ||
//! - [ ] `listlockunspent` | ||
//! - [ ] `listreceivedbyaddress ( minconf include_empty include_watchonly "address_filter" include_immature_coinbase )` | ||
//! - [ ] `listreceivedbylabel ( minconf include_empty include_watchonly include_immature_coinbase )` | ||
//! - [ ] `listsinceblock ( "blockhash" target_confirmations include_watchonly include_removed include_change "label" )` | ||
//! - [ ] `listtransactions ( "label" count skip include_watchonly )` | ||
//! - [ ] `listunspent ( minconf maxconf ["address",...] include_unsafe query_options )` | ||
//! - [ ] `listwalletdir` | ||
//! - [ ] `listwallets` | ||
//! - [x] `loadwallet "filename" ( load_on_startup )` | ||
//! - [ ] `lockunspent unlock ( [{"txid":"hex","vout":n},...] persistent )` | ||
//! - [ ] `migratewallet ( "wallet_name" "passphrase" )` | ||
//! - [ ] `newkeypool` | ||
//! - [ ] `psbtbumpfee "txid" ( options )` | ||
//! - [ ] `removeprunedfunds "txid"` | ||
//! - [ ] `rescanblockchain ( start_height stop_height )` | ||
//! - [ ] `restorewallet "wallet_name" "backup_file" ( load_on_startup )` | ||
//! - [ ] `send [{"address":amount,...},{"data":"hex"},...] ( conf_target "estimate_mode" fee_rate options )` | ||
//! - [ ] `sendall ["address",{"address":amount,...},...] ( conf_target "estimate_mode" fee_rate options )` | ||
//! - [ ] `sendmany ( "" ) {"address":amount,...} ( minconf "comment" ["address",...] replaceable conf_target "estimate_mode" fee_rate verbose )` | ||
//! - [x] `sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount replaceable conf_target "estimate_mode" avoid_reuse fee_rate verbose )` | ||
//! - [ ] `sethdseed ( newkeypool "seed" )` | ||
//! - [ ] `setlabel "address" "label"` | ||
//! - [ ] `settxfee amount` | ||
//! - [ ] `setwalletflag "flag" ( value )` | ||
//! - [ ] `signmessage "address" "message"` | ||
//! - [ ] `signrawtransactionwithwallet "hexstring" ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )` | ||
//! - [ ] `simulaterawtransaction ( ["rawtx",...] {"include_watchonly":bool,...} )` | ||
//! - [ ] `unloadwallet ( "wallet_name" load_on_startup )` | ||
//! - [ ] `upgradewallet ( version )` | ||
//! - [ ] `walletcreatefundedpsbt ( [{"txid":"hex","vout":n,"sequence":n,"weight":n},...] ) [{"address":amount,...},{"data":"hex"},...] ( locktime options bip32derivs )` | ||
//! - [ ] `walletdisplayaddress "address"` | ||
//! - [ ] `walletlock` | ||
//! - [ ] `walletpassphrase "passphrase" timeout` | ||
//! - [ ] `walletpassphrasechange "oldpassphrase" "newpassphrase"` | ||
//! - [ ] `walletprocesspsbt "psbt" ( sign "sighashtype" bip32derivs finalize )` | ||
//! | ||
//! **== Zmq ==** | ||
//! - [ ] `getzmqnotifications` | ||
#[doc(inline)] | ||
pub use crate::{ | ||
v17::{ | ||
GenerateToAddress, GetBalance, GetBestBlockHash, GetBlockVerbosityOne, | ||
GetBlockVerbosityZero, GetNetworkInfo, GetNetworkInfoAddress, GetNetworkInfoNetwork, | ||
GetNewAddress, GetTransaction, GetTransactionDetail, GetTransactionDetailCategory, | ||
GetTxOut, SendRawTransaction, | ||
}, | ||
v19::{ | ||
Bip9SoftforkInfo, Bip9SoftforkStatistics, Bip9SoftforkStatus, GetBalances, GetBalancesMine, | ||
GetBalancesWatchOnly, GetBlockchainInfo, Softfork, SoftforkType, | ||
}, | ||
v22::{SendToAddress, UnloadWallet}, | ||
v25::{CreateWallet, LoadWallet}, | ||
}; |
Oops, something went wrong.