File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -979,6 +979,26 @@ fn test_create_tx_absolute_fee() {
979
979
) ;
980
980
}
981
981
982
+ #[ test]
983
+ fn test_legacy_create_tx_absolute_fee ( ) {
984
+ let ( mut wallet, _) = get_funded_wallet_single ( get_test_pkh ( ) ) ;
985
+ let addr = wallet. next_unused_address ( KeychainKind :: External ) ;
986
+ let mut builder = wallet. build_tx ( ) ;
987
+ builder
988
+ . drain_to ( addr. script_pubkey ( ) )
989
+ . drain_wallet ( )
990
+ . fee_absolute ( Amount :: from_sat ( 100 ) ) ;
991
+ let psbt = builder. finish ( ) . unwrap ( ) ;
992
+ let fee = check_fee ! ( wallet, psbt) ;
993
+
994
+ assert_eq ! ( fee. unwrap_or( Amount :: ZERO ) , Amount :: from_sat( 100 ) ) ;
995
+ assert_eq ! ( psbt. unsigned_tx. output. len( ) , 1 ) ;
996
+ assert_eq ! (
997
+ psbt. unsigned_tx. output[ 0 ] . value,
998
+ Amount :: from_sat( 50_000 ) - fee. unwrap_or( Amount :: ZERO )
999
+ ) ;
1000
+ }
1001
+
982
1002
#[ test]
983
1003
fn test_create_tx_absolute_zero_fee ( ) {
984
1004
let ( mut wallet, _) = get_funded_wallet_wpkh ( ) ;
You can’t perform that action at this time.
0 commit comments