From 9e9e23c81a079f969082f106a44d0fdb3a1a65cb Mon Sep 17 00:00:00 2001 From: darosior Date: Mon, 17 Feb 2020 16:09:35 +0100 Subject: [PATCH] pytest: test txprepare with unconfirmed utxos --- tests/test_wallet.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_wallet.py b/tests/test_wallet.py index 8a9e11dd8..9c5093bbf 100644 --- a/tests/test_wallet.py +++ b/tests/test_wallet.py @@ -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']