diff --git a/lndclient/lightning_client.go b/lndclient/lightning_client.go index c7e6356..8a09871 100644 --- a/lndclient/lightning_client.go +++ b/lndclient/lightning_client.go @@ -44,6 +44,7 @@ type Info struct { IdentityPubkey [33]byte Alias string Network string + Uris []string } var ( @@ -145,6 +146,7 @@ func (s *lightningClient) GetInfo(ctx context.Context) (*Info, error) { IdentityPubkey: pubKeyArray, Alias: resp.Alias, Network: resp.Chains[0].Network, + Uris: resp.Uris, }, nil } diff --git a/test/lightning_client_mock.go b/test/lightning_client_mock.go index 07bf19e..afa39e1 100644 --- a/test/lightning_client_mock.go +++ b/test/lightning_client_mock.go @@ -2,6 +2,7 @@ package test import ( "crypto/rand" + "encoding/hex" "fmt" "sync" "time" @@ -48,10 +49,16 @@ func (h *mockLightningClient) ConfirmedWalletBalance(ctx context.Context) ( func (h *mockLightningClient) GetInfo(ctx context.Context) (*lndclient.Info, error) { + pubKeyBytes, err := hex.DecodeString(h.lnd.NodePubkey) + if err != nil { + return nil, err + } var pubKey [33]byte + copy(pubKey[:], pubKeyBytes) return &lndclient.Info{ BlockHeight: 600, IdentityPubkey: pubKey, + Uris: []string{h.lnd.NodePubkey + "@127.0.0.1:9735"}, }, nil } diff --git a/test/lnd_services_mock.go b/test/lnd_services_mock.go index bd6ff70..0cef215 100644 --- a/test/lnd_services_mock.go +++ b/test/lnd_services_mock.go @@ -14,7 +14,11 @@ import ( "github.com/lightningnetwork/lnd/zpay32" ) -var testStartingHeight = int32(600) +var ( + testStartingHeight = int32(600) + testNodePubkey = "03f5374b16f0b1f1b49101de1b9d89e0b460bc57ce9c2f9" + + "132b73dfc76d3704daa" +) // NewMockLnd returns a new instance of LndMockServices that can be used in unit // tests. @@ -54,6 +58,7 @@ func NewMockLnd() *LndMockServices { FailInvoiceChannel: make(chan lntypes.Hash, 2), epochChannel: make(chan int32), Height: testStartingHeight, + NodePubkey: testNodePubkey, } lightningClient.lnd = &lnd @@ -120,7 +125,8 @@ type LndMockServices struct { RouterSendPaymentChannel chan RouterPaymentChannelMessage TrackPaymentChannel chan TrackPaymentMessage - Height int32 + Height int32 + NodePubkey string WaitForFinished func()