@@ -769,13 +769,13 @@ fn test_create_tx_change_policy() {
769
769
#[ test]
770
770
fn test_create_tx_confirmation_policy ( ) {
771
771
let ( mut wallet, funding_txid) = get_funded_wallet_wpkh ( ) ;
772
- // confirm the funding tx
772
+ // confirm the funding tx
773
773
let anchor = ConfirmationBlockTime {
774
774
block_id : wallet. latest_checkpoint ( ) . get ( 2000 ) . unwrap ( ) . block_id ( ) ,
775
775
confirmation_time : 200 ,
776
776
} ;
777
777
insert_anchor ( & mut wallet, funding_txid, anchor) ;
778
- assert_eq ! ( wallet. balance( ) . confirmed, Amount :: from_sat( 50_000 ) ) ;
778
+ assert_eq ! ( wallet. balance( ) . confirmed, Amount :: from_sat( 50_000 ) ) ;
779
779
780
780
let confirmed_tx = Transaction {
781
781
input : vec ! [ ] ,
@@ -816,18 +816,38 @@ fn test_create_tx_confirmation_policy() {
816
816
. add_recipient ( addr. script_pubkey ( ) , Amount :: from_sat ( 51_000 ) )
817
817
. only_spend_confirmed ( ) ;
818
818
let ret = builder. finish ( ) . unwrap ( ) ;
819
- assert_eq ! ( ret. unsigned_tx. input. len( ) , 2 ) ;
820
- assert ! ( ret. unsigned_tx. input. iter( ) . find( |i| i. previous_output. txid == confirmed_txid) . is_some( ) ) ;
821
- assert ! ( ret. unsigned_tx. input. iter( ) . find( |i| i. previous_output. txid == unconfirmed_txid) . is_none( ) ) ;
819
+ assert_eq ! ( ret. unsigned_tx. input. len( ) , 2 ) ;
820
+ assert ! ( ret
821
+ . unsigned_tx
822
+ . input
823
+ . iter( )
824
+ . find( |i| i. previous_output. txid == confirmed_txid)
825
+ . is_some( ) ) ;
826
+ assert ! ( ret
827
+ . unsigned_tx
828
+ . input
829
+ . iter( )
830
+ . find( |i| i. previous_output. txid == unconfirmed_txid)
831
+ . is_none( ) ) ;
822
832
823
833
let mut builder = wallet. build_tx ( ) ;
824
834
builder
825
835
. add_recipient ( addr. script_pubkey ( ) , Amount :: from_sat ( 24_000 ) )
826
836
. only_spend_unconfirmed ( ) ;
827
837
let ret = builder. finish ( ) . unwrap ( ) ;
828
- assert_eq ! ( ret. unsigned_tx. input. len( ) , 1 ) ;
829
- assert ! ( ret. unsigned_tx. input. iter( ) . find( |i| i. previous_output. txid == unconfirmed_txid) . is_some( ) ) ;
830
- assert ! ( ret. unsigned_tx. input. iter( ) . find( |i| i. previous_output. txid == confirmed_txid) . is_none( ) ) ;
838
+ assert_eq ! ( ret. unsigned_tx. input. len( ) , 1 ) ;
839
+ assert ! ( ret
840
+ . unsigned_tx
841
+ . input
842
+ . iter( )
843
+ . find( |i| i. previous_output. txid == unconfirmed_txid)
844
+ . is_some( ) ) ;
845
+ assert ! ( ret
846
+ . unsigned_tx
847
+ . input
848
+ . iter( )
849
+ . find( |i| i. previous_output. txid == confirmed_txid)
850
+ . is_none( ) ) ;
831
851
832
852
let mut builder = wallet. build_tx ( ) ;
833
853
builder
0 commit comments