MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_splice_nosign

Function test_splice_nosign

tests/test_splicing.py:358–376  ·  view source on GitHub ↗
(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

356@pytest.mark.openchannel('v2')
357@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
358def test_splice_nosign(node_factory, bitcoind):
359 l1, l2 = node_factory.line_graph(2, fundamount=1000000, wait_for_announce=True)
360
361 chan_id = l1.get_channel_id(l2)
362
363 # add extra sats to pay fee
364 funds_result = l1.rpc.fundpsbt("111722sat", 0, 0, excess_as_change=True)
365
366 result = l1.rpc.splice_init(chan_id, 100000, funds_result['psbt'])
367 result = l1.rpc.splice_update(chan_id, result['psbt'])
368 assert(result['commitments_secured'] is False)
369 result = l1.rpc.splice_update(chan_id, result['psbt'])
370 assert(result['commitments_secured'] is True)
371 try:
372 l1.rpc.splice_signed(chan_id, result['psbt'])
373 assert(False)
374 except RpcError as e:
375 assert(e.error['code'] == 358)
376 assert(e.error['message'] == "The PSBT is missing a signature. Have you signed it with `signpsbt`?")
377
378
379@pytest.mark.openchannel('v1')

Callers

nothing calls this directly

Calls 6

line_graphMethod · 0.80
get_channel_idMethod · 0.80
fundpsbtMethod · 0.80
splice_initMethod · 0.45
splice_updateMethod · 0.45
splice_signedMethod · 0.45

Tested by

no test coverage detected