Skip to content

Commit 1ede106

Browse files
committed
Fix remaining verify --tests problems
Adding verify --tests to CI runs it on all versions. This highlighted 2 missed problems: submitpackage is untested for v26 - Add `UNTESTED` label to the types table. abortprivatebroadcast test did not check the model - Fix the test.
1 parent bd129f4 commit 1ede106

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

integration_test/tests/raw_transactions.rs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -717,10 +717,26 @@ fn raw_transactions__get_private_broadcast_info__modelled() {
717717

718718
#[test]
719719
#[cfg(not(feature = "v30_and_below"))]
720-
fn raw_transactions__abort_private_broadcast() {
721-
let node = BitcoinD::with_wallet(Wallet::None, &[]);
720+
fn raw_transactions__abort_private_broadcast__modelled() {
721+
let node =
722+
BitcoinD::with_wallet(Wallet::Default, &["-privatebroadcast=1", "-proxy=127.0.0.1:1"]);
723+
node.fund_wallet();
724+
725+
// Create a signed transaction and send it via private broadcast.
726+
let tx = create_a_raw_transaction(&node);
727+
let signed = node
728+
.client
729+
.sign_raw_transaction_with_wallet(&tx)
730+
.expect("signrawtransactionwithwallet")
731+
.into_model()
732+
.expect("SignRawTransaction into model")
733+
.tx;
734+
let send = node.client.send_raw_transaction(&signed).expect("sendrawtransaction");
735+
736+
let json: AbortPrivateBroadcast =
737+
node.client.abort_private_broadcast(&send.0).expect("abortprivatebroadcast");
738+
let model: Result<mtype::AbortPrivateBroadcast, encode::FromHexError> = json.into_model();
739+
let abort = model.unwrap();
722740

723-
// Aborting a transaction that is not in the private broadcast queue returns an error in regtest.
724-
let txid = "0000000000000000000000000000000000000000000000000000000000000001";
725-
assert!(node.client.abort_private_broadcast(txid).is_err());
741+
assert_eq!(abort.removed_transactions, &[signed]);
726742
}

types/src/v26/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
//! | joinpsbts | version + model | |
135135
//! | sendrawtransaction | version + model | |
136136
//! | signrawtransactionwithkey | version + model | UNTESTED |
137-
//! | submitpackage | version + model | |
137+
//! | submitpackage | version + model | UNTESTED |
138138
//! | testmempoolaccept | version + model | |
139139
//! | utxoupdatepsbt | version + model | |
140140
//!

0 commit comments

Comments
 (0)