Skip to content

Commit

Permalink
pytest: test for correct wallet balances, re-enable penalty test.
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Jul 27, 2018
1 parent ae8b459 commit f73ea5d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tests/test_lightningd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2041,10 +2041,15 @@ def test_penalty_inhtlc(self):
# 100 blocks later, all resolved.
bitcoind.generate_block(100)

# FIXME: Test wallet balance...
l2.daemon.wait_for_log('onchaind complete, forgetting peer')

@unittest.skip("flaky test causing CI fails too often")
outputs = l2.rpc.listfunds()['outputs']
assert [o['status'] for o in outputs] == ['confirmed'] * 2
# Allow some lossage for fees.
assert sum(o['value'] for o in outputs) < 10**6
assert sum(o['value'] for o in outputs) > 10**6 - 15000

@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1")
def test_penalty_outhtlc(self):
"""Test penalty transaction with an outgoing HTLC"""
# First we need to get funds to l2, so suppress after second.
Expand Down Expand Up @@ -2104,9 +2109,14 @@ def test_penalty_outhtlc(self):
# 100 blocks later, all resolved.
bitcoind.generate_block(100)

# FIXME: Test wallet balance...
wait_forget_channels(l2)

outputs = l2.rpc.listfunds()['outputs']
assert [o['status'] for o in outputs] == ['confirmed'] * 3
# Allow some lossage for fees.
assert sum(o['value'] for o in outputs) < 10**6
assert sum(o['value'] for o in outputs) > 10**6 - 15000

@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1")
def test_onchain_feechange(self):
"""Onchain handling when we restart with different fees"""
Expand Down

0 comments on commit f73ea5d

Please sign in to comment.