Skip to content

Commit dbb49cf

Browse files
committed
liquidity: test low feeppm case for easyautoloop
1 parent 64d2cbe commit dbb49cf

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

liquidity/autoloop_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,6 +1419,33 @@ func TestEasyAutoloop(t *testing.T) {
14191419

14201420
c.easyautoloop(step, true)
14211421
c.stop()
1422+
1423+
// Restore the local balance to a higher value that will trigger a swap.
1424+
easyChannel2.LocalBalance = btcutil.Amount(95000)
1425+
channels = []lndclient.ChannelInfo{
1426+
easyChannel1, easyChannel2,
1427+
}
1428+
1429+
// Override the feeppm with a lower one.
1430+
params.FeeLimit = NewFeePortion(5)
1431+
1432+
c = newAutoloopTestCtx(t, params, channels, testRestrictions)
1433+
c.start()
1434+
1435+
// Even though there should be a swap dispatched in order to meet the
1436+
// local balance target, we expect no action as the user defined feeppm
1437+
// should not be sufficient for the swap to be dispatched.
1438+
step = &easyAutoloopStep{
1439+
minAmt: 1,
1440+
maxAmt: 50000,
1441+
// Since we have the exact same balance as the first step, we
1442+
// can reuse the quoteOut1 for the expected loop out quote.
1443+
quotesOut: quotesOut1,
1444+
expectedOut: nil,
1445+
}
1446+
1447+
c.easyautoloop(step, false)
1448+
c.stop()
14221449
}
14231450

14241451
// existingSwapFromRequest is a helper function which returns the db

0 commit comments

Comments
 (0)