swap: add lasthop, outgoingchanids to swapinfo

This commit is contained in:
sputn1ck 2022-05-27 11:14:16 +02:00
parent e98d813885
commit efb6f75d60
No known key found for this signature in database
GPG key ID: 671103D881A5F0E4
5 changed files with 50 additions and 3 deletions

View file

@ -52,9 +52,11 @@ func TestLoopOutPaymentParameters(t *testing.T) {
const maxParts = 5
chanSet := loopdb.ChannelSet{2, 3}
// Initiate the swap.
req := *testRequest
req.OutgoingChanSet = loopdb.ChannelSet{2, 3}
req.OutgoingChanSet = chanSet
initResult, err := newLoopOutSwap(
context.Background(), cfg, height, &req,
@ -90,6 +92,12 @@ func TestLoopOutPaymentParameters(t *testing.T) {
t.Fatal("unexpected state")
}
// Check that the SwapInfo contains the outgoing chan set
require.Equal(t, chanSet, state.OutgoingChanSet)
// Check that the SwapInfo does not contain a last hop
require.Nil(t, state.LastHop)
// Intercept the swap and prepay payments. Order is undefined.
payments := []test.RouterPaymentChannelMessage{
<-ctx.Lnd.RouterSendPaymentChannel,