mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
pytest: test txprepare with unconfirmed utxos
This commit is contained in:
committed by
Christian Decker
parent
a754e4c6aa
commit
9e9e23c81a
@@ -280,6 +280,7 @@ def test_txprepare_multi(node_factory, bitcoind):
|
||||
l1.rpc.txdiscard(prep['txid'])
|
||||
|
||||
|
||||
@pytest.mark.xfail(strict=True)
|
||||
def test_txprepare(node_factory, bitcoind, chainparams):
|
||||
amount = 1000000
|
||||
l1 = node_factory.get_node(random_hsm=True)
|
||||
@@ -366,11 +367,16 @@ def test_txprepare(node_factory, bitcoind, chainparams):
|
||||
l1.rpc.txdiscard(prep4['txid'])
|
||||
|
||||
# Try passing in a utxo set
|
||||
utxos = [utxo["txid"] + ":" + str(utxo["output"]) for utxo in l1.rpc.listfunds()["outputs"]][:4]
|
||||
|
||||
utxos = [utxo["txid"] + ":" + str(utxo["output"])
|
||||
for utxo in l1.rpc.listfunds()["outputs"]][:4]
|
||||
prep5 = l1.rpc.txprepare([{addr:
|
||||
Millisatoshi(amount * 3.5 * 1000)}], utxos=utxos)
|
||||
|
||||
# Try passing unconfirmed utxos
|
||||
unconfirmed_utxo = l1.rpc.withdraw(l1.rpc.newaddr()["bech32"], 10**5)
|
||||
utxos = [unconfirmed_utxo["txid"] + ":0"]
|
||||
l1.rpc.txprepare([{addr: Millisatoshi(amount * 3.5 * 1000)}], utxos=utxos)
|
||||
|
||||
decode = bitcoind.rpc.decoderawtransaction(prep5['unsigned_tx'])
|
||||
assert decode['txid'] == prep5['txid']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user