mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-24 00:24:19 +01:00
feeadjuster: misc cleanups in imbalance test
Be sure to catch the actual line we want to catch (one per scid), and remove an unused variable. Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
This commit is contained in:
committed by
Christian Decker
parent
00fe0c209e
commit
b9f321d586
@@ -172,16 +172,20 @@ def test_feeadjuster_imbalance(node_factory):
|
|||||||
# we force feeadjust initially to test this method and check if it applies
|
# we force feeadjust initially to test this method and check if it applies
|
||||||
# default fees when balancing the channel below
|
# default fees when balancing the channel below
|
||||||
l2.rpc.feeadjust()
|
l2.rpc.feeadjust()
|
||||||
l2.daemon.wait_for_log("Adjusted fees")
|
l2.daemon.wait_for_logs([
|
||||||
l2.daemon.wait_for_log("Adjusted fees")
|
f"Adjusted fees.*{scid_A}",
|
||||||
|
f"Adjusted fees.*{scid_B}"
|
||||||
|
])
|
||||||
log_offset = len(l2.daemon.logs)
|
log_offset = len(l2.daemon.logs)
|
||||||
wait_for_not_fees(l2, scids, default_fees[0])
|
wait_for_not_fees(l2, scids, default_fees[0])
|
||||||
|
|
||||||
# First bring channel to somewhat of a blanance
|
# First bring channel to somewhat of a blanance
|
||||||
amount = int(chan_total * 0.5)
|
amount = int(chan_total * 0.5)
|
||||||
pay(l1, l3, amount)
|
pay(l1, l3, amount)
|
||||||
l2.daemon.wait_for_log('Set default fees as imbalance is too low')
|
l2.daemon.wait_for_logs([
|
||||||
l2.daemon.wait_for_log('Set default fees as imbalance is too low')
|
f'Set default fees as imbalance is too low: {scid_A}',
|
||||||
|
f'Set default fees as imbalance is too low: {scid_B}'
|
||||||
|
])
|
||||||
wait_for_fees(l2, scids, default_fees[0])
|
wait_for_fees(l2, scids, default_fees[0])
|
||||||
|
|
||||||
# Because of the 70/30 imbalance limiter, a 15% payment must not yet trigger
|
# Because of the 70/30 imbalance limiter, a 15% payment must not yet trigger
|
||||||
@@ -192,12 +196,16 @@ def test_feeadjuster_imbalance(node_factory):
|
|||||||
|
|
||||||
# Sending another 20% must now trigger because the imbalance
|
# Sending another 20% must now trigger because the imbalance
|
||||||
pay(l1, l3, amount)
|
pay(l1, l3, amount)
|
||||||
l2.daemon.wait_for_log("Adjusted fees")
|
l2.daemon.wait_for_logs([
|
||||||
l2.daemon.wait_for_log("Adjusted fees")
|
f"Adjusted fees.*{scid_A}",
|
||||||
|
f"Adjusted fees.*{scid_B}"
|
||||||
|
])
|
||||||
wait_for_not_fees(l2, scids, default_fees[0])
|
wait_for_not_fees(l2, scids, default_fees[0])
|
||||||
|
|
||||||
# Bringing it back must cause default fees
|
# Bringing it back must cause default fees
|
||||||
pay(l3, l1, amount)
|
pay(l3, l1, amount)
|
||||||
l2.daemon.wait_for_log('Set default fees as imbalance is too low')
|
l2.daemon.wait_for_logs([
|
||||||
l2.daemon.wait_for_log('Set default fees as imbalance is too low')
|
f'Set default fees as imbalance is too low: {scid_A}',
|
||||||
|
f'Set default fees as imbalance is too low: {scid_B}'
|
||||||
|
])
|
||||||
wait_for_fees(l2, scids, default_fees[0])
|
wait_for_fees(l2, scids, default_fees[0])
|
||||||
|
|||||||
Reference in New Issue
Block a user