liquidity: add initiator to swap requests

pull/316/head
Oliver Gugger 3 years ago
parent 8758d00862
commit 481839b0fb
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

@ -146,6 +146,7 @@ func TestAutoLoopEnabled(t *testing.T) {
SweepConfTarget: params.SweepConfTarget,
OutgoingChanSet: loopdb.ChannelSet{chanID1.ToUint64()},
Label: labels.AutoOutLabel(),
Initiator: autoloopSwapInitiator,
}
chan2Swap = &loop.OutRequest{
@ -161,6 +162,7 @@ func TestAutoLoopEnabled(t *testing.T) {
SweepConfTarget: params.SweepConfTarget,
OutgoingChanSet: loopdb.ChannelSet{chanID2.ToUint64()},
Label: labels.AutoOutLabel(),
Initiator: autoloopSwapInitiator,
}
loopOuts = []loopOutRequestResp{

@ -99,6 +99,10 @@ const (
// DefaultAutoOutTicker is the default amount of time between automated
// loop out checks.
DefaultAutoOutTicker = time.Minute * 10
// autoloopSwapInitiator is the value we send in the initiator field of
// a swap request when issuing an automatic swap.
autoloopSwapInitiator = "autoloop"
)
var (
@ -704,6 +708,7 @@ func (m *Manager) makeLoopOutRequest(ctx context.Context,
MaxSwapFee: quote.SwapFee,
MaxPrepayAmount: quote.PrepayAmount,
SweepConfTarget: m.params.SweepConfTarget,
Initiator: autoloopSwapInitiator,
}
if autoOut {

@ -68,6 +68,7 @@ var (
MaxSwapFee: testQuote.SwapFee,
MaxPrepayAmount: testQuote.PrepayAmount,
SweepConfTarget: loop.DefaultSweepConfTarget,
Initiator: autoloopSwapInitiator,
}
// chan2Rec is the suggested swap for channel 2 when we use chanRule.
@ -80,6 +81,7 @@ var (
MaxPrepayAmount: testQuote.PrepayAmount,
MaxSwapFee: testQuote.SwapFee,
SweepConfTarget: loop.DefaultSweepConfTarget,
Initiator: autoloopSwapInitiator,
}
// chan1Out is a contract that uses channel 1, used to represent on

Loading…
Cancel
Save