mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 07:34:24 +01:00
coinmvt: don't use msats in fields not called "_msat".
The new msat fields are turned into Millisatoshi, so handle that correctly too in tests too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Deprecated: Plugins: `coin_movement` notification: `balance`, `credit`, `debit` and `fees` (use `balance_msat`, `credit_msat`, `debit_msat` and `fees_msat`)
This commit is contained in:
@@ -852,17 +852,17 @@ def test_channel_lease_post_expiry(node_factory, bitcoind, chainparams):
|
||||
l2.daemon.wait_for_log('Resolved FUNDING_TRANSACTION/FUNDING_OUTPUT by MUTUAL_CLOSE')
|
||||
|
||||
channel_mvts_1 = [
|
||||
{'type': 'chain_mvt', 'credit': 506432000, 'debit': 0, 'tags': ['channel_open', 'opener', 'leased']},
|
||||
{'type': 'channel_mvt', 'credit': 0, 'debit': 6432000, 'tags': ['lease_fee'], 'fees': '0msat'},
|
||||
{'type': 'channel_mvt', 'credit': 0, 'debit': 10000, 'tags': ['invoice'], 'fees': '0msat'},
|
||||
{'type': 'chain_mvt', 'credit': 0, 'debit': 499990000, 'tags': ['channel_close']},
|
||||
{'type': 'chain_mvt', 'credit_msat': 506432000, 'debit_msat': 0, 'tags': ['channel_open', 'opener', 'leased']},
|
||||
{'type': 'channel_mvt', 'credit_msat': 0, 'debit_msat': 6432000, 'tags': ['lease_fee'], 'fees_msat': '0msat'},
|
||||
{'type': 'channel_mvt', 'credit_msat': 0, 'debit_msat': 10000, 'tags': ['invoice'], 'fees_msat': '0msat'},
|
||||
{'type': 'chain_mvt', 'credit_msat': 0, 'debit_msat': 499990000, 'tags': ['channel_close']},
|
||||
]
|
||||
|
||||
channel_mvts_2 = [
|
||||
{'type': 'chain_mvt', 'credit': 500000000, 'debit': 0, 'tags': ['channel_open', 'leased']},
|
||||
{'type': 'channel_mvt', 'credit': 6432000, 'debit': 0, 'tags': ['lease_fee'], 'fees': '0msat'},
|
||||
{'type': 'channel_mvt', 'credit': 10000, 'debit': 0, 'tags': ['invoice'], 'fees': '0msat'},
|
||||
{'type': 'chain_mvt', 'credit': 0, 'debit': 506442000, 'tags': ['channel_close']},
|
||||
{'type': 'chain_mvt', 'credit_msat': 500000000, 'debit_msat': 0, 'tags': ['channel_open', 'leased']},
|
||||
{'type': 'channel_mvt', 'credit_msat': 6432000, 'debit_msat': 0, 'tags': ['lease_fee'], 'fees_msat': '0msat'},
|
||||
{'type': 'channel_mvt', 'credit_msat': 10000, 'debit_msat': 0, 'tags': ['invoice'], 'fees_msat': '0msat'},
|
||||
{'type': 'chain_mvt', 'credit_msat': 0, 'debit_msat': 506442000, 'tags': ['channel_close']},
|
||||
]
|
||||
|
||||
check_coin_moves(l1, channel_id, channel_mvts_1, chainparams)
|
||||
@@ -1285,11 +1285,11 @@ def test_penalty_htlc_tx_fulfill(node_factory, bitcoind, chainparams):
|
||||
if not chainparams['elements']:
|
||||
# Also check snapshots
|
||||
expected_bals_2 = [
|
||||
{'blockheight': 101, 'accounts': [{'balance': '0msat'}]},
|
||||
{'blockheight': 108, 'accounts': [{'balance': '995433000msat'}, {'balance': '500000000msat'}, {'balance': '499994999msat'}]},
|
||||
{'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': '995433000msat'}, {'balance': '500000000msat'}, {'balance': '499994999msat'}]},
|
||||
{'blockheight': 108, 'accounts': [{'balance_msat': '995433000msat'}, {'balance_msat': '500000000msat'}, {'balance_msat': '499994999msat'}]},
|
||||
]
|
||||
check_balance_snaps(l2, expected_bals_2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user