@@ -2762,77 +2762,6 @@ fn test_keychains_with_overlapping_spks() {
27622762 assert_eq ! ( wallet. balance( ) . confirmed, Amount :: from_sat( 58000 ) ) ;
27632763}
27642764
2765- #[ test]
2766- /// The wallet should re-use previously allocated change addresses when the tx using them is
2767- /// cancelled
2768- fn test_tx_cancellation ( ) {
2769- macro_rules! new_tx {
2770- ( $wallet: expr) => { {
2771- let addr = Address :: from_str( "2N4eQYCbKUHCCTUjBJeHcJp9ok6J2GZsTDt" )
2772- . unwrap( )
2773- . assume_checked( ) ;
2774- let mut builder = $wallet. build_tx( ) ;
2775- builder. add_recipient( addr. script_pubkey( ) , Amount :: from_sat( 10_000 ) ) ;
2776-
2777- let psbt = builder. finish( ) . unwrap( ) ;
2778-
2779- psbt
2780- } } ;
2781- }
2782-
2783- let ( mut wallet, _) = get_funded_wallet ( get_test_wpkh ( ) , get_test_tr_single_sig_xprv ( ) ) ;
2784-
2785- let psbt1 = new_tx ! ( wallet) ;
2786- let change_derivation_1 = psbt1
2787- . unsigned_tx
2788- . output
2789- . iter ( )
2790- . find_map ( |txout| wallet. derivation_of_spk ( txout. script_pubkey . clone ( ) ) )
2791- . unwrap ( ) ;
2792- assert_eq ! ( change_derivation_1, ( KeychainKind :: Internal , 0 ) ) ;
2793-
2794- let psbt2 = new_tx ! ( wallet) ;
2795-
2796- let change_derivation_2 = psbt2
2797- . unsigned_tx
2798- . output
2799- . iter ( )
2800- . find_map ( |txout| wallet. derivation_of_spk ( txout. script_pubkey . clone ( ) ) )
2801- . unwrap ( ) ;
2802- assert_eq ! ( change_derivation_2, ( KeychainKind :: Internal , 1 ) ) ;
2803-
2804- wallet. cancel_tx ( & psbt1. extract_tx ( ) . expect ( "failed to extract tx" ) ) ;
2805-
2806- let psbt3 = new_tx ! ( wallet) ;
2807- let change_derivation_3 = psbt3
2808- . unsigned_tx
2809- . output
2810- . iter ( )
2811- . find_map ( |txout| wallet. derivation_of_spk ( txout. script_pubkey . clone ( ) ) )
2812- . unwrap ( ) ;
2813- assert_eq ! ( change_derivation_3, ( KeychainKind :: Internal , 0 ) ) ;
2814-
2815- let psbt3 = new_tx ! ( wallet) ;
2816- let change_derivation_3 = psbt3
2817- . unsigned_tx
2818- . output
2819- . iter ( )
2820- . find_map ( |txout| wallet. derivation_of_spk ( txout. script_pubkey . clone ( ) ) )
2821- . unwrap ( ) ;
2822- assert_eq ! ( change_derivation_3, ( KeychainKind :: Internal , 2 ) ) ;
2823-
2824- wallet. cancel_tx ( & psbt3. extract_tx ( ) . expect ( "failed to extract tx" ) ) ;
2825-
2826- let psbt3 = new_tx ! ( wallet) ;
2827- let change_derivation_4 = psbt3
2828- . unsigned_tx
2829- . output
2830- . iter ( )
2831- . find_map ( |txout| wallet. derivation_of_spk ( txout. script_pubkey . clone ( ) ) )
2832- . unwrap ( ) ;
2833- assert_eq ! ( change_derivation_4, ( KeychainKind :: Internal , 2 ) ) ;
2834- }
2835-
28362765#[ test]
28372766fn test_thread_safety ( ) {
28382767 fn thread_safe < T : Send + Sync > ( ) { }
0 commit comments