From dff9516cad07e3a5ffc3c3053511b9a469d34316 Mon Sep 17 00:00:00 2001 From: niftynei Date: Wed, 19 May 2021 19:16:49 -0500 Subject: [PATCH] rbf-tests: check every inflight has signed commitment produced Little check to make sure that we can produce a signed commitment tx for every inflight we've got saved. --- tests/test_opening.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_opening.py b/tests/test_opening.py index d2bcd30a2..fe82311fc 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -696,6 +696,7 @@ def test_rbf_no_overlap(node_factory, bitcoind, chainparams): @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') @pytest.mark.openchannel('v2') +@pytest.mark.developer("uses dev-sign-last-tx") def test_rbf_fails_to_broadcast(node_factory, bitcoind, chainparams): l1, l2 = node_factory.get_nodes(2, opts={'allow_warning': True, @@ -731,6 +732,9 @@ def test_rbf_fails_to_broadcast(node_factory, bitcoind, chainparams): l1.rpc.connect(l2.info['id'], 'localhost', l2.port) bump = l1.rpc.openchannel_bump(chan_id, chan_amount, initpsbt['psbt']) + # We should be able to call this with while an open is progress + # but not yet committed + l1.rpc.dev_sign_last_tx(l2.info['id']) update = l1.rpc.openchannel_update(chan_id, bump['psbt']) assert update['commitments_secured'] @@ -778,6 +782,13 @@ def test_rbf_fails_to_broadcast(node_factory, bitcoind, chainparams): assert prev_inflights == inflights assert inflights[-1]['funding_txid'] in bitcoind.rpc.getrawmempool() + # Produce a signature for every inflight + last_txs = l1.rpc.dev_sign_last_tx(l2.info['id']) + assert len(last_txs['inflights']) == len(inflights) + for last_tx, inflight in zip(last_txs['inflights'], inflights): + assert last_tx['funding_txid'] == inflight['funding_txid'] + assert last_txs['tx'] + @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') @pytest.mark.openchannel('v2')