@@ -1375,11 +1375,7 @@ fn test_add_foreign_utxo() {
13751375 builder
13761376 . add_recipient ( addr. script_pubkey ( ) , Amount :: from_sat ( 60_000 ) )
13771377 . only_witness_utxo ( )
1378- . add_foreign_utxo (
1379- utxo. outpoint ,
1380- psbt_input,
1381- foreign_utxo_satisfaction. to_wu ( ) as usize ,
1382- )
1378+ . add_foreign_utxo ( utxo. outpoint , psbt_input, foreign_utxo_satisfaction)
13831379 . unwrap ( ) ;
13841380 let mut psbt = builder. finish ( ) . unwrap ( ) ;
13851381 wallet1. insert_txout ( utxo. outpoint , utxo. txout ) ;
@@ -1455,11 +1451,7 @@ fn test_calculate_fee_with_missing_foreign_utxo() {
14551451 builder
14561452 . add_recipient ( addr. script_pubkey ( ) , Amount :: from_sat ( 60_000 ) )
14571453 . only_witness_utxo ( )
1458- . add_foreign_utxo (
1459- utxo. outpoint ,
1460- psbt_input,
1461- foreign_utxo_satisfaction. to_wu ( ) as usize ,
1462- )
1454+ . add_foreign_utxo ( utxo. outpoint , psbt_input, foreign_utxo_satisfaction)
14631455 . unwrap ( ) ;
14641456 let psbt = builder. finish ( ) . unwrap ( ) ;
14651457 let tx = psbt. extract_tx ( ) . expect ( "failed to extract tx" ) ;
@@ -1476,11 +1468,8 @@ fn test_add_foreign_utxo_invalid_psbt_input() {
14761468 . unwrap ( ) ;
14771469
14781470 let mut builder = wallet. build_tx ( ) ;
1479- let result = builder. add_foreign_utxo (
1480- outpoint,
1481- psbt:: Input :: default ( ) ,
1482- foreign_utxo_satisfaction. to_wu ( ) as usize ,
1483- ) ;
1471+ let result =
1472+ builder. add_foreign_utxo ( outpoint, psbt:: Input :: default ( ) , foreign_utxo_satisfaction) ;
14841473 assert ! ( matches!( result, Err ( AddForeignUtxoError :: MissingUtxo ) ) ) ;
14851474}
14861475
@@ -1508,7 +1497,7 @@ fn test_add_foreign_utxo_where_outpoint_doesnt_match_psbt_input() {
15081497 non_witness_utxo: Some ( tx1. as_ref( ) . clone( ) ) ,
15091498 ..Default :: default ( )
15101499 } ,
1511- satisfaction_weight. to_wu ( ) as usize
1500+ satisfaction_weight
15121501 )
15131502 . is_err( ) ,
15141503 "should fail when outpoint doesn't match psbt_input"
@@ -1521,7 +1510,7 @@ fn test_add_foreign_utxo_where_outpoint_doesnt_match_psbt_input() {
15211510 non_witness_utxo: Some ( tx2. as_ref( ) . clone( ) ) ,
15221511 ..Default :: default ( )
15231512 } ,
1524- satisfaction_weight. to_wu ( ) as usize
1513+ satisfaction_weight
15251514 )
15261515 . is_ok( ) ,
15271516 "should be ok when outpoint does match psbt_input"
@@ -1553,11 +1542,7 @@ fn test_add_foreign_utxo_only_witness_utxo() {
15531542 ..Default :: default ( )
15541543 } ;
15551544 builder
1556- . add_foreign_utxo (
1557- utxo2. outpoint ,
1558- psbt_input,
1559- satisfaction_weight. to_wu ( ) as usize ,
1560- )
1545+ . add_foreign_utxo ( utxo2. outpoint , psbt_input, satisfaction_weight)
15611546 . unwrap ( ) ;
15621547 assert ! (
15631548 builder. finish( ) . is_err( ) ,
@@ -1573,11 +1558,7 @@ fn test_add_foreign_utxo_only_witness_utxo() {
15731558 } ;
15741559 builder
15751560 . only_witness_utxo ( )
1576- . add_foreign_utxo (
1577- utxo2. outpoint ,
1578- psbt_input,
1579- satisfaction_weight. to_wu ( ) as usize ,
1580- )
1561+ . add_foreign_utxo ( utxo2. outpoint , psbt_input, satisfaction_weight)
15811562 . unwrap ( ) ;
15821563 assert ! (
15831564 builder. finish( ) . is_ok( ) ,
@@ -1593,11 +1574,7 @@ fn test_add_foreign_utxo_only_witness_utxo() {
15931574 ..Default :: default ( )
15941575 } ;
15951576 builder
1596- . add_foreign_utxo (
1597- utxo2. outpoint ,
1598- psbt_input,
1599- satisfaction_weight. to_wu ( ) as usize ,
1600- )
1577+ . add_foreign_utxo ( utxo2. outpoint , psbt_input, satisfaction_weight)
16011578 . unwrap ( ) ;
16021579 assert ! (
16031580 builder. finish( ) . is_ok( ) ,
@@ -3415,11 +3392,7 @@ fn test_taproot_foreign_utxo() {
34153392 let mut builder = wallet1. build_tx ( ) ;
34163393 builder
34173394 . add_recipient ( addr. script_pubkey ( ) , Amount :: from_sat ( 60_000 ) )
3418- . add_foreign_utxo (
3419- utxo. outpoint ,
3420- psbt_input,
3421- foreign_utxo_satisfaction. to_wu ( ) as usize ,
3422- )
3395+ . add_foreign_utxo ( utxo. outpoint , psbt_input, foreign_utxo_satisfaction)
34233396 . unwrap ( ) ;
34243397 let psbt = builder. finish ( ) . unwrap ( ) ;
34253398 let sent_received =
0 commit comments