mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
pytest: test for bad 'tx' result from close.
We print it without the witness! Reported-by: https://github.com/wtogami Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
aa2f4a1fa0
commit
673d81adde
@ -3870,3 +3870,32 @@ def test_htlc_no_force_close(node_factory, bitcoind, anchors):
|
||||
sync_blockheight(bitcoind, [l1, l2, l3])
|
||||
|
||||
# FIXME: l2 should complain!
|
||||
|
||||
|
||||
@pytest.mark.xfail(strict=True)
|
||||
@pytest.mark.developer("needs dev-no-reconnect")
|
||||
def test_closing_tx_valid(node_factory, bitcoind):
|
||||
l1, l2 = node_factory.line_graph(2, opts={'may_reconnect': True,
|
||||
'dev-no-reconnect': None})
|
||||
|
||||
# First, mutual close.
|
||||
close = l1.rpc.close(l2.info['id'])
|
||||
|
||||
wait_for(lambda: len(bitcoind.rpc.getrawmempool()) == 1)
|
||||
assert only_one(bitcoind.rpc.getrawmempool()) == close['txid']
|
||||
assert bitcoind.rpc.getrawtransaction(close['txid']) == close['tx']
|
||||
bitcoind.generate_block(1)
|
||||
# Change output and the closed channel output.
|
||||
wait_for(lambda: len(l1.rpc.listfunds()['outputs']) == 2)
|
||||
|
||||
# Now, unilateral close.
|
||||
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
|
||||
l1.rpc.fundchannel(l2.info['id'], 10**6)
|
||||
bitcoind.generate_block(1, wait_for_mempool=1)
|
||||
|
||||
l1.rpc.disconnect(l2.info['id'], force=True)
|
||||
close = l1.rpc.close(l2.info['id'], 1)
|
||||
|
||||
wait_for(lambda: len(bitcoind.rpc.getrawmempool()) == 1)
|
||||
assert only_one(bitcoind.rpc.getrawmempool()) == close['txid']
|
||||
assert bitcoind.rpc.getrawtransaction(close['txid']) == close['tx']
|
||||
|
Loading…
Reference in New Issue
Block a user