mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
tests: add account_id's and match by acct id, not test ordering
There's no guarantee as to iteration order for accounts/channels, but this test was relying on them. Adding account attribution and comparing by account_ids fixes Fixes: #5869 Reported-By: @rustyrussell
This commit is contained in:
@@ -1301,12 +1301,15 @@ def test_penalty_htlc_tx_fulfill(node_factory, bitcoind, chainparams):
|
||||
if not chainparams['elements']:
|
||||
# Also check snapshots
|
||||
expected_bals_2 = [
|
||||
{'blockheight': 101, 'accounts': [{'balance_msat': '0msat'}]},
|
||||
{'blockheight': 108, 'accounts': [{'balance_msat': '995433000msat'}, {'balance_msat': '500000000msat'}, {'balance_msat': '499994999msat'}]},
|
||||
# There's a duplicate because we stop and restart l2 twice
|
||||
# (both times at block 108)
|
||||
{'blockheight': 108, 'accounts': [{'balance_msat': '995433000msat'}, {'balance_msat': '500000000msat'}, {'balance_msat': '499994999msat'}]},
|
||||
]
|
||||
{'blockheight': 101, 'accounts': [
|
||||
{'balance_msat': '0msat', 'account_id': 'wallet'}
|
||||
]}
|
||||
] + [
|
||||
{'blockheight': 108, 'accounts': [
|
||||
{'balance_msat': '995433000msat', 'account_id': 'wallet'},
|
||||
{'balance_msat': '500000000msat', 'account_id': first_channel_id(l1, l2)},
|
||||
{'balance_msat': '499994999msat', 'account_id': channel_id}]}
|
||||
] * 2 # duplicated; we stop and restart l2 twice (both at block 108)
|
||||
check_balance_snaps(l2, expected_bals_2)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user