@@ -11,6 +11,7 @@ import (
1111 "github.com/lightninglabs/loop/test"
1212 "github.com/lightningnetwork/lnd/chainntnfs"
1313 "github.com/lightningnetwork/lnd/channeldb"
14+ "github.com/lightningnetwork/lnd/routing/route"
1415 "github.com/stretchr/testify/require"
1516)
1617
@@ -34,9 +35,14 @@ func TestLoopInSuccess(t *testing.T) {
3435
3536 cfg := newSwapConfig (& ctx .lnd .LndServices , ctx .store , ctx .server )
3637
38+ expectedLastHop := & route.Vertex {0x02 }
39+
40+ req := & testLoopInRequest
41+ req .LastHop = expectedLastHop
42+
3743 initResult , err := newLoopInSwap (
3844 context .Background (), cfg ,
39- height , & testLoopInRequest ,
45+ height , req ,
4046 )
4147 if err != nil {
4248 t .Fatal (err )
@@ -54,7 +60,14 @@ func TestLoopInSuccess(t *testing.T) {
5460 errChan <- err
5561 }()
5662
57- ctx .assertState (loopdb .StateInitiated )
63+ swapInfo := <- ctx .statusChan
64+ require .Equal (t , loopdb .StateInitiated , swapInfo .State )
65+
66+ // Check that the SwapInfo contains the provided last hop.
67+ require .Equal (t , expectedLastHop , swapInfo .LastHop )
68+
69+ // Check that the SwapInfo does not contain an outgoing chan set.
70+ require .Nil (t , swapInfo .OutgoingChanSet )
5871
5972 ctx .assertState (loopdb .StateHtlcPublished )
6073 ctx .store .assertLoopInState (loopdb .StateHtlcPublished )
0 commit comments