Skip to content

Commit 755c807

Browse files
ddustinendothermicdev
authored andcommitted
splice: Test for missing user signatures
1 parent 5818b52 commit 755c807

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/test_splicing.py

+24
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,30 @@ def test_splice(node_factory, bitcoind):
4949
assert l1.db_query("SELECT count(*) as c FROM channeltxs;")[0]['c'] == 0
5050

5151

52+
@pytest.mark.openchannel('v1')
53+
@pytest.mark.openchannel('v2')
54+
@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
55+
def test_splice_nosign(node_factory, bitcoind):
56+
l1, l2 = node_factory.line_graph(2, fundamount=1000000, wait_for_announce=True, opts={'experimental-splicing': None})
57+
58+
chan_id = l1.get_channel_id(l2)
59+
60+
# add extra sats to pay fee
61+
funds_result = l1.rpc.fundpsbt("109000sat", "slow", 166, excess_as_change=True)
62+
63+
result = l1.rpc.splice_init(chan_id, 100000, funds_result['psbt'])
64+
result = l1.rpc.splice_update(chan_id, result['psbt'])
65+
assert(result['commitments_secured'] is False)
66+
result = l1.rpc.splice_update(chan_id, result['psbt'])
67+
assert(result['commitments_secured'] is True)
68+
try:
69+
l1.rpc.splice_signed(chan_id, result['psbt'])
70+
assert(False)
71+
except RpcError as e:
72+
assert(e.error['code'] == 358)
73+
assert(e.error['message'] == "The PSBT is missing a signature. Have you signed it with `signpsbt`?")
74+
75+
5276
@pytest.mark.openchannel('v1')
5377
@pytest.mark.openchannel('v2')
5478
@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')

0 commit comments

Comments
 (0)