File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff line change 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//!
You can’t perform that action at this time.
0 commit comments