|
|
|
@ -95,12 +95,12 @@ func TestAutoLoopEnabled(t *testing.T) {
|
|
|
|
|
// autoloop budget is set to allow exactly 2 swaps at the prices
|
|
|
|
|
// that we set in our test quotes.
|
|
|
|
|
params = Parameters{
|
|
|
|
|
Autoloop: true,
|
|
|
|
|
AutoFeeBudget: 40066,
|
|
|
|
|
AutoFeeStartDate: testTime,
|
|
|
|
|
MaxAutoInFlight: 2,
|
|
|
|
|
FailureBackOff: time.Hour,
|
|
|
|
|
SweepConfTarget: 10,
|
|
|
|
|
Autoloop: true,
|
|
|
|
|
AutoFeeBudget: 40066,
|
|
|
|
|
AutoFeeRefreshPeriod: testBudgetRefresh,
|
|
|
|
|
MaxAutoInFlight: 2,
|
|
|
|
|
FailureBackOff: time.Hour,
|
|
|
|
|
SweepConfTarget: 10,
|
|
|
|
|
FeeLimit: NewFeeCategoryLimit(
|
|
|
|
|
swapFeePPM, routeFeePPM, prepayFeePPM, maxMiner,
|
|
|
|
|
prepayAmount, 20000,
|
|
|
|
@ -112,6 +112,7 @@ func TestAutoLoopEnabled(t *testing.T) {
|
|
|
|
|
HtlcConfTarget: defaultHtlcConfTarget,
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
c := newAutoloopTestCtx(t, params, channels, testRestrictions)
|
|
|
|
|
c.start()
|
|
|
|
|
|
|
|
|
@ -335,13 +336,13 @@ func TestAutoloopAddress(t *testing.T) {
|
|
|
|
|
// Create some dummy parameters for autoloop and also specify an
|
|
|
|
|
// destination address.
|
|
|
|
|
params = Parameters{
|
|
|
|
|
Autoloop: true,
|
|
|
|
|
AutoFeeBudget: 40066,
|
|
|
|
|
DestAddr: addr,
|
|
|
|
|
AutoFeeStartDate: testTime,
|
|
|
|
|
MaxAutoInFlight: 2,
|
|
|
|
|
FailureBackOff: time.Hour,
|
|
|
|
|
SweepConfTarget: 10,
|
|
|
|
|
Autoloop: true,
|
|
|
|
|
AutoFeeBudget: 40066,
|
|
|
|
|
DestAddr: addr,
|
|
|
|
|
AutoFeeRefreshPeriod: testBudgetRefresh,
|
|
|
|
|
MaxAutoInFlight: 2,
|
|
|
|
|
FailureBackOff: time.Hour,
|
|
|
|
|
SweepConfTarget: 10,
|
|
|
|
|
FeeLimit: NewFeeCategoryLimit(
|
|
|
|
|
swapFeePPM, routeFeePPM, prepayFeePPM, maxMiner,
|
|
|
|
|
prepayAmount, 20000,
|
|
|
|
@ -491,12 +492,12 @@ func TestCompositeRules(t *testing.T) {
|
|
|
|
|
swapFeePPM, routeFeePPM, prepayFeePPM, maxMiner,
|
|
|
|
|
prepayAmount, 20000,
|
|
|
|
|
),
|
|
|
|
|
Autoloop: true,
|
|
|
|
|
AutoFeeBudget: 100000,
|
|
|
|
|
AutoFeeStartDate: testTime,
|
|
|
|
|
MaxAutoInFlight: 2,
|
|
|
|
|
FailureBackOff: time.Hour,
|
|
|
|
|
SweepConfTarget: 10,
|
|
|
|
|
Autoloop: true,
|
|
|
|
|
AutoFeeBudget: 100000,
|
|
|
|
|
AutoFeeRefreshPeriod: testBudgetRefresh,
|
|
|
|
|
MaxAutoInFlight: 2,
|
|
|
|
|
FailureBackOff: time.Hour,
|
|
|
|
|
SweepConfTarget: 10,
|
|
|
|
|
ChannelRules: map[lnwire.ShortChannelID]*SwapRule{
|
|
|
|
|
chanID1: chanRule,
|
|
|
|
|
},
|
|
|
|
@ -670,13 +671,13 @@ func TestAutoLoopInEnabled(t *testing.T) {
|
|
|
|
|
peer2MaxFee = ppmToSat(peer2ExpectedAmt, swapFeePPM)
|
|
|
|
|
|
|
|
|
|
params = Parameters{
|
|
|
|
|
Autoloop: true,
|
|
|
|
|
AutoFeeBudget: peer1MaxFee + peer2MaxFee + 1,
|
|
|
|
|
AutoFeeStartDate: testTime,
|
|
|
|
|
MaxAutoInFlight: 2,
|
|
|
|
|
FailureBackOff: time.Hour,
|
|
|
|
|
FeeLimit: NewFeePortion(swapFeePPM),
|
|
|
|
|
ChannelRules: make(map[lnwire.ShortChannelID]*SwapRule),
|
|
|
|
|
Autoloop: true,
|
|
|
|
|
AutoFeeBudget: peer1MaxFee + peer2MaxFee + 1,
|
|
|
|
|
AutoFeeRefreshPeriod: testBudgetRefresh,
|
|
|
|
|
MaxAutoInFlight: 2,
|
|
|
|
|
FailureBackOff: time.Hour,
|
|
|
|
|
FeeLimit: NewFeePortion(swapFeePPM),
|
|
|
|
|
ChannelRules: make(map[lnwire.ShortChannelID]*SwapRule),
|
|
|
|
|
PeerRules: map[route.Vertex]*SwapRule{
|
|
|
|
|
peer1: rule,
|
|
|
|
|
peer2: rule,
|
|
|
|
@ -853,12 +854,12 @@ func TestAutoloopBothTypes(t *testing.T) {
|
|
|
|
|
loopInMaxFee = ppmToSat(loopInAmount, swapFeePPM)
|
|
|
|
|
|
|
|
|
|
params = Parameters{
|
|
|
|
|
Autoloop: true,
|
|
|
|
|
AutoFeeBudget: loopOutMaxFee + loopInMaxFee + 1,
|
|
|
|
|
AutoFeeStartDate: testTime,
|
|
|
|
|
MaxAutoInFlight: 2,
|
|
|
|
|
FailureBackOff: time.Hour,
|
|
|
|
|
FeeLimit: NewFeePortion(swapFeePPM),
|
|
|
|
|
Autoloop: true,
|
|
|
|
|
AutoFeeBudget: loopOutMaxFee + loopInMaxFee + 1,
|
|
|
|
|
AutoFeeRefreshPeriod: testBudgetRefresh,
|
|
|
|
|
MaxAutoInFlight: 2,
|
|
|
|
|
FailureBackOff: time.Hour,
|
|
|
|
|
FeeLimit: NewFeePortion(swapFeePPM),
|
|
|
|
|
ChannelRules: map[lnwire.ShortChannelID]*SwapRule{
|
|
|
|
|
chanID1: outRule,
|
|
|
|
|
},
|
|
|
|
|