Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions tests/test_opening.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Loading