|
|
@ -66,7 +66,7 @@ var (
|
|
|
|
MaxMinerFee: scaleMinerFee(testQuote.MinerFee),
|
|
|
|
MaxMinerFee: scaleMinerFee(testQuote.MinerFee),
|
|
|
|
MaxSwapFee: testQuote.SwapFee,
|
|
|
|
MaxSwapFee: testQuote.SwapFee,
|
|
|
|
MaxPrepayAmount: testQuote.PrepayAmount,
|
|
|
|
MaxPrepayAmount: testQuote.PrepayAmount,
|
|
|
|
SweepConfTarget: loop.DefaultSweepConfTarget,
|
|
|
|
SweepConfTarget: defaultConfTarget,
|
|
|
|
Initiator: autoloopSwapInitiator,
|
|
|
|
Initiator: autoloopSwapInitiator,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -79,7 +79,7 @@ var (
|
|
|
|
MaxMinerFee: scaleMinerFee(testQuote.MinerFee),
|
|
|
|
MaxMinerFee: scaleMinerFee(testQuote.MinerFee),
|
|
|
|
MaxPrepayAmount: testQuote.PrepayAmount,
|
|
|
|
MaxPrepayAmount: testQuote.PrepayAmount,
|
|
|
|
MaxSwapFee: testQuote.SwapFee,
|
|
|
|
MaxSwapFee: testQuote.SwapFee,
|
|
|
|
SweepConfTarget: loop.DefaultSweepConfTarget,
|
|
|
|
SweepConfTarget: defaultConfTarget,
|
|
|
|
Initiator: autoloopSwapInitiator,
|
|
|
|
Initiator: autoloopSwapInitiator,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -612,7 +612,7 @@ func TestSweepFeeLimit(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
|
|
// Set our test case's fee rate for our mock lnd.
|
|
|
|
// Set our test case's fee rate for our mock lnd.
|
|
|
|
lnd.SetFeeEstimate(
|
|
|
|
lnd.SetFeeEstimate(
|
|
|
|
loop.DefaultSweepConfTarget, testCase.feeRate,
|
|
|
|
defaultConfTarget, testCase.feeRate,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
lnd.Channels = []lndclient.ChannelInfo{
|
|
|
|
lnd.Channels = []lndclient.ChannelInfo{
|
|
|
@ -622,6 +622,13 @@ func TestSweepFeeLimit(t *testing.T) {
|
|
|
|
params := defaultParameters
|
|
|
|
params := defaultParameters
|
|
|
|
params.FeeLimit = defaultFeeCategoryLimit()
|
|
|
|
params.FeeLimit = defaultFeeCategoryLimit()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set our budget to cover a single swap with these
|
|
|
|
|
|
|
|
// parameters.
|
|
|
|
|
|
|
|
params.AutoFeeBudget = defaultMaximumMinerFee +
|
|
|
|
|
|
|
|
ppmToSat(7500, defaultSwapFeePPM) +
|
|
|
|
|
|
|
|
ppmToSat(7500, defaultPrepayRoutingFeePPM) +
|
|
|
|
|
|
|
|
ppmToSat(7500, defaultRoutingFeePPM)
|
|
|
|
|
|
|
|
|
|
|
|
params.ChannelRules = map[lnwire.ShortChannelID]*ThresholdRule{
|
|
|
|
params.ChannelRules = map[lnwire.ShortChannelID]*ThresholdRule{
|
|
|
|
chanID1: chanRule,
|
|
|
|
chanID1: chanRule,
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -725,7 +732,7 @@ func TestSuggestSwaps(t *testing.T) {
|
|
|
|
MaxMinerFee: scaleMinerFee(testQuote.MinerFee),
|
|
|
|
MaxMinerFee: scaleMinerFee(testQuote.MinerFee),
|
|
|
|
MaxSwapFee: testQuote.SwapFee,
|
|
|
|
MaxSwapFee: testQuote.SwapFee,
|
|
|
|
MaxPrepayAmount: testQuote.PrepayAmount,
|
|
|
|
MaxPrepayAmount: testQuote.PrepayAmount,
|
|
|
|
SweepConfTarget: loop.DefaultSweepConfTarget,
|
|
|
|
SweepConfTarget: defaultConfTarget,
|
|
|
|
Initiator: autoloopSwapInitiator,
|
|
|
|
Initiator: autoloopSwapInitiator,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -855,6 +862,13 @@ func TestFeeLimits(t *testing.T) {
|
|
|
|
params := defaultParameters
|
|
|
|
params := defaultParameters
|
|
|
|
params.FeeLimit = defaultFeeCategoryLimit()
|
|
|
|
params.FeeLimit = defaultFeeCategoryLimit()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set our budget to cover a single swap with these
|
|
|
|
|
|
|
|
// parameters.
|
|
|
|
|
|
|
|
params.AutoFeeBudget = defaultMaximumMinerFee +
|
|
|
|
|
|
|
|
ppmToSat(7500, defaultSwapFeePPM) +
|
|
|
|
|
|
|
|
ppmToSat(7500, defaultPrepayRoutingFeePPM) +
|
|
|
|
|
|
|
|
ppmToSat(7500, defaultRoutingFeePPM)
|
|
|
|
|
|
|
|
|
|
|
|
params.ChannelRules = map[lnwire.ShortChannelID]*ThresholdRule{
|
|
|
|
params.ChannelRules = map[lnwire.ShortChannelID]*ThresholdRule{
|
|
|
|
chanID1: chanRule,
|
|
|
|
chanID1: chanRule,
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1213,7 +1227,7 @@ func TestSizeRestrictions(t *testing.T) {
|
|
|
|
MaxMinerFee: scaleMinerFee(testQuote.MinerFee),
|
|
|
|
MaxMinerFee: scaleMinerFee(testQuote.MinerFee),
|
|
|
|
MaxSwapFee: testQuote.SwapFee,
|
|
|
|
MaxSwapFee: testQuote.SwapFee,
|
|
|
|
MaxPrepayAmount: testQuote.PrepayAmount,
|
|
|
|
MaxPrepayAmount: testQuote.PrepayAmount,
|
|
|
|
SweepConfTarget: loop.DefaultSweepConfTarget,
|
|
|
|
SweepConfTarget: defaultConfTarget,
|
|
|
|
Initiator: autoloopSwapInitiator,
|
|
|
|
Initiator: autoloopSwapInitiator,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -1362,7 +1376,7 @@ func TestFeePercentage(t *testing.T) {
|
|
|
|
MaxMinerFee: scaleMinerFee(okQuote.MinerFee),
|
|
|
|
MaxMinerFee: scaleMinerFee(okQuote.MinerFee),
|
|
|
|
MaxSwapFee: okQuote.SwapFee,
|
|
|
|
MaxSwapFee: okQuote.SwapFee,
|
|
|
|
MaxPrepayAmount: okQuote.PrepayAmount,
|
|
|
|
MaxPrepayAmount: okQuote.PrepayAmount,
|
|
|
|
SweepConfTarget: loop.DefaultSweepConfTarget,
|
|
|
|
SweepConfTarget: defaultConfTarget,
|
|
|
|
Initiator: autoloopSwapInitiator,
|
|
|
|
Initiator: autoloopSwapInitiator,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|