@@ -328,7 +328,7 @@ def test_txprepare(node_factory, bitcoind, chainparams):
328
328
assert len (decode ['vin' ]) == 4
329
329
assert len (decode ['vout' ]) == 2 if not chainparams ['feeoutput' ] else 3
330
330
if not chainparams ['elements' ]: # FIXME
331
- check_feerate (l1 , feerate_from_psbt (chainparams , bitcoind , l1 , prep ['psbt' ]), normal_feerate_perkw )
331
+ check_feerate ([ l1 ] , feerate_from_psbt (chainparams , bitcoind , l1 , prep ['psbt' ]), normal_feerate_perkw )
332
332
333
333
# One output will be correct.
334
334
outnum = [i for i , o in enumerate (decode ['vout' ]) if o ['value' ] == Decimal (amount * 3 ) / 10 ** 8 ][0 ]
@@ -357,7 +357,7 @@ def test_txprepare(node_factory, bitcoind, chainparams):
357
357
assert decode ['vout' ][0 ]['scriptPubKey' ]['type' ] == 'witness_v0_keyhash'
358
358
assert scriptpubkey_addr (decode ['vout' ][0 ]['scriptPubKey' ]) == addr
359
359
if not chainparams ['elements' ]: # FIXME
360
- check_feerate (l1 , feerate_from_psbt (chainparams , bitcoind , l1 , prep2 ['psbt' ]), normal_feerate_perkw )
360
+ check_feerate ([ l1 ] , feerate_from_psbt (chainparams , bitcoind , l1 , prep2 ['psbt' ]), normal_feerate_perkw )
361
361
362
362
# If I cancel the first one, I can get those first 4 outputs.
363
363
discard = l1 .rpc .txdiscard (prep ['txid' ])
@@ -377,7 +377,7 @@ def test_txprepare(node_factory, bitcoind, chainparams):
377
377
assert decode ['vout' ][0 ]['scriptPubKey' ]['type' ] == 'witness_v0_keyhash'
378
378
assert scriptpubkey_addr (decode ['vout' ][0 ]['scriptPubKey' ]) == addr
379
379
if not chainparams ['elements' ]: # FIXME
380
- check_feerate (l1 , feerate_from_psbt (chainparams , bitcoind , l1 , prep3 ['psbt' ]), normal_feerate_perkw )
380
+ check_feerate ([ l1 ] , feerate_from_psbt (chainparams , bitcoind , l1 , prep3 ['psbt' ]), normal_feerate_perkw )
381
381
382
382
# Cannot discard twice.
383
383
with pytest .raises (RpcError , match = r'not an unreleased txid' ):
@@ -399,7 +399,7 @@ def test_txprepare(node_factory, bitcoind, chainparams):
399
399
assert decode ['vout' ][0 ]['scriptPubKey' ]['type' ] == 'witness_v0_keyhash'
400
400
assert scriptpubkey_addr (decode ['vout' ][0 ]['scriptPubKey' ]) == addr
401
401
if not chainparams ['elements' ]: # FIXME
402
- check_feerate (l1 , feerate_from_psbt (chainparams , bitcoind , l1 , prep4 ['psbt' ]), normal_feerate_perkw )
402
+ check_feerate ([ l1 ] , feerate_from_psbt (chainparams , bitcoind , l1 , prep4 ['psbt' ]), normal_feerate_perkw )
403
403
l1 .rpc .txdiscard (prep4 ['txid' ])
404
404
405
405
# Try passing in a utxo set
@@ -408,7 +408,7 @@ def test_txprepare(node_factory, bitcoind, chainparams):
408
408
prep5 = l1 .rpc .txprepare ([{addr :
409
409
Millisatoshi (amount * 3.5 * 1000 )}], utxos = utxos )
410
410
if not chainparams ['elements' ]: # FIXME
411
- check_feerate (l1 , feerate_from_psbt (chainparams , bitcoind , l1 , prep3 ['psbt' ]), normal_feerate_perkw )
411
+ check_feerate ([ l1 ] , feerate_from_psbt (chainparams , bitcoind , l1 , prep3 ['psbt' ]), normal_feerate_perkw )
412
412
413
413
# Try passing unconfirmed utxos
414
414
unconfirmed_utxo = l1 .rpc .withdraw (l1 .rpc .newaddr ()["bech32" ], 10 ** 5 )
@@ -420,7 +420,7 @@ def test_txprepare(node_factory, bitcoind, chainparams):
420
420
unconfirmed_tx = bitcoind .rpc .getrawmempool (True )[unconfirmed_utxo ["txid" ]]
421
421
feerate_perkw = int (unconfirmed_tx ['fees' ]['base' ] * 100_000_000 ) * 1000 / unconfirmed_tx ['weight' ]
422
422
if not chainparams ['elements' ]: # FIXME
423
- check_feerate (l1 , feerate_perkw , normal_feerate_perkw )
423
+ check_feerate ([ l1 ] , feerate_perkw , normal_feerate_perkw )
424
424
425
425
decode = bitcoind .rpc .decoderawtransaction (prep5 ['unsigned_tx' ])
426
426
assert decode ['txid' ] == prep5 ['txid' ]
@@ -451,7 +451,7 @@ def test_txprepare(node_factory, bitcoind, chainparams):
451
451
{addr : 'all' }])
452
452
# Feerate should be ~ as we asked for
453
453
if not chainparams ['elements' ]: # FIXME
454
- check_feerate (l1 , feerate_from_psbt (chainparams , bitcoind , l1 , prep5 ['psbt' ]), normal_feerate_perkw )
454
+ check_feerate ([ l1 ] , feerate_from_psbt (chainparams , bitcoind , l1 , prep5 ['psbt' ]), normal_feerate_perkw )
455
455
l1 .rpc .txdiscard (prep5 ['txid' ])
456
456
with pytest .raises (RpcError , match = r"'all'" ):
457
457
prep5 = l1 .rpc .txprepare ([{addr : 'all' }, {addr : 'all' }])
@@ -460,7 +460,7 @@ def test_txprepare(node_factory, bitcoind, chainparams):
460
460
{addr : Millisatoshi (amount * 3 * 500 - 100000 )}])
461
461
# Feerate should be ~ as we asked for
462
462
if not chainparams ['elements' ]: # FIXME
463
- check_feerate (l1 , feerate_from_psbt (chainparams , bitcoind , l1 , prep5 ['psbt' ]), normal_feerate_perkw )
463
+ check_feerate ([ l1 ] , feerate_from_psbt (chainparams , bitcoind , l1 , prep5 ['psbt' ]), normal_feerate_perkw )
464
464
decode = bitcoind .rpc .decoderawtransaction (prep5 ['unsigned_tx' ])
465
465
assert decode ['txid' ] == prep5 ['txid' ]
466
466
# 4 inputs, 3 outputs(include change).
@@ -574,7 +574,7 @@ def test_fundpsbt_feerates(node_factory, bitcoind, chainparams, addrtype):
574
574
# We never actually added that `amount` output to PSBT, so that appears as "fee"
575
575
fee = int (txinfo ['fees' ]['base' ] * 100_000_000 ) - amount
576
576
actual_feerate = fee / (txinfo ['weight' ] / 1000 )
577
- check_feerate (l1 , actual_feerate , feerate )
577
+ check_feerate ([ l1 ] , actual_feerate , feerate )
578
578
579
579
580
580
def test_reserveinputs (node_factory , bitcoind , chainparams ):
0 commit comments