From b4d7aab322fdc96ef05e3fdc31c633cee25ccb3e Mon Sep 17 00:00:00 2001 From: enaples Date: Mon, 13 Apr 2026 17:15:38 +0200 Subject: [PATCH 1/3] pytest: test utxopsbt with multiple taproot inputs does not crash the node --- tests/test_opening.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/test_opening.py b/tests/test_opening.py index 4954c31b87b4..2128c1c45bc9 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -1,3 +1,5 @@ +from itertools import count + from fixtures import * # noqa: F401,F403 from fixtures import TEST_NETWORK from pyln.client import RpcError, Millisatoshi @@ -3018,3 +3020,34 @@ def test_zeroconf_withhold_htlc_failback(node_factory, bitcoind): # l1's channel to l2 is still normal — no force-close assert only_one(l1.rpc.listpeerchannels(l2.info['id'])['channels'])['state'] == 'CHANNELD_NORMAL' + + +@pytest.mark.openchannel('v1') +@pytest.mark.openchannel('v2') +@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') +def test_signpsbt_multiple_taproot_inputs(node_factory, bitcoind): + """Test signpsbt when a PSBT has a multiple taproot input""" + l1 = node_factory.get_node(opts=[{'experimental-dual-fund': None}]) + + amount = 200000 + + bitcoind.rpc.sendmany("", + {l1.rpc.newaddr('all')['p2tr']: amount / 10 ** 8, + l1.rpc.newaddr('all')['p2tr']: amount / 10 ** 8}) + + bitcoind.generate_block(1) + + wait_for(lambda: len(l1.rpc.listfunds()['outputs']) == 2) + + bitcoind.generate_block(6) + outputs = l1.rpc.listfunds()['outputs'] + + tx_list = [] + for o in outputs: + txid = o['txid'] + vout = o['output'] + tx_list.append(f"{txid}:{vout}") + + psbt = l1.rpc.utxopsbt("all", "300perkw", 1000, tx_list)['psbt'] + + result = l1.rpc.signpsbt(psbt) From 8999a6a52a4de8423c48756d309d0212d63d5f42 Mon Sep 17 00:00:00 2001 From: enaples Date: Fri, 17 Apr 2026 10:50:23 +0200 Subject: [PATCH 2/3] pytest: make flake8 to pass. Fixing test format --- tests/test_opening.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_opening.py b/tests/test_opening.py index 2128c1c45bc9..94dd3056082e 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -3031,10 +3031,10 @@ def test_signpsbt_multiple_taproot_inputs(node_factory, bitcoind): amount = 200000 - bitcoind.rpc.sendmany("", + bitcoind.rpc.sendmany("", {l1.rpc.newaddr('all')['p2tr']: amount / 10 ** 8, l1.rpc.newaddr('all')['p2tr']: amount / 10 ** 8}) - + bitcoind.generate_block(1) wait_for(lambda: len(l1.rpc.listfunds()['outputs']) == 2) From 0dafe72878c964064c10171da207e518b7e124b9 Mon Sep 17 00:00:00 2001 From: enaples Date: Fri, 17 Apr 2026 11:00:20 +0200 Subject: [PATCH 3/3] pytest: fixing style enforcement flake8 --- tests/test_opening.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/test_opening.py b/tests/test_opening.py index 94dd3056082e..1d84f767f507 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -1,5 +1,3 @@ -from itertools import count - from fixtures import * # noqa: F401,F403 from fixtures import TEST_NETWORK from pyln.client import RpcError, Millisatoshi @@ -3050,4 +3048,4 @@ def test_signpsbt_multiple_taproot_inputs(node_factory, bitcoind): psbt = l1.rpc.utxopsbt("all", "300perkw", 1000, tx_list)['psbt'] - result = l1.rpc.signpsbt(psbt) + l1.rpc.signpsbt(psbt)