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

Function test_sendpsbt_crash

tests/test_opening.py:3481–3501  ·  view source on GitHub ↗

Stop sendpsbt, check it eventually opens

(bitcoind, node_factory)

Source from the content-addressed store, hash-verified

3479
3480@pytest.mark.openchannel('v1')
3481def test_sendpsbt_crash(bitcoind, node_factory):
3482 """Stop sendpsbt, check it eventually opens"""
3483 plugin_path = Path(__file__).parent / "plugins" / "stop_sendpsbt.py"
3484 l1, l2 = node_factory.get_nodes(2, opts=[{"plugin": plugin_path, 'may_fail': True, 'start': False}, {}])
3485 # Saving IO can cause JSON errors when we check it, due to partial writes if we
3486 # get lucky when we kill it.
3487 del l1.daemon.opts['dev-save-plugin-io']
3488 l1.start()
3489
3490 l1.fundwallet(3_000_000)
3491 l1.connect(l2)
3492
3493 # signpsbt kills l1.
3494 with pytest.raises(RpcError, match=r'Connection to RPC server lost.'):
3495 l1.rpc.fundchannel(l2.info['id'], "2000000sat")
3496
3497 del l1.daemon.opts['plugin']
3498 l1.start()
3499 bitcoind.generate_block(1, wait_for_mempool=1)
3500
3501 assert l1.daemon.is_in_log('Signed and sent psbt for waiting channel')
3502
3503
3504@pytest.mark.parametrize("stay_withheld", [True, False])

Callers

nothing calls this directly

Calls 7

get_nodesMethod · 0.80
fundwalletMethod · 0.80
generate_blockMethod · 0.80
is_in_logMethod · 0.80
startMethod · 0.45
connectMethod · 0.45
fundchannelMethod · 0.45

Tested by

no test coverage detected