liquidity: test low feeppm case for easyautoloop

pull/595/head
George Tsagkarelis 11 months ago
parent 64d2cbe5d6
commit dbb49cfa05
No known key found for this signature in database
GPG Key ID: 0807D1013F48208A

@ -1419,6 +1419,33 @@ func TestEasyAutoloop(t *testing.T) {
c.easyautoloop(step, true)
c.stop()
// Restore the local balance to a higher value that will trigger a swap.
easyChannel2.LocalBalance = btcutil.Amount(95000)
channels = []lndclient.ChannelInfo{
easyChannel1, easyChannel2,
}
// Override the feeppm with a lower one.
params.FeeLimit = NewFeePortion(5)
c = newAutoloopTestCtx(t, params, channels, testRestrictions)
c.start()
// Even though there should be a swap dispatched in order to meet the
// local balance target, we expect no action as the user defined feeppm
// should not be sufficient for the swap to be dispatched.
step = &easyAutoloopStep{
minAmt: 1,
maxAmt: 50000,
// Since we have the exact same balance as the first step, we
// can reuse the quoteOut1 for the expected loop out quote.
quotesOut: quotesOut1,
expectedOut: nil,
}
c.easyautoloop(step, false)
c.stop()
}
// existingSwapFromRequest is a helper function which returns the db

Loading…
Cancel
Save