From 10ec3205dd4d017318dfb034d174b648a9c2978b Mon Sep 17 00:00:00 2001 From: Nikita Neznaemov Date: Tue, 26 Mar 2024 17:44:54 +0300 Subject: [PATCH 1/3] 1 --- observer/channel_peer.go | 6 ++++++ observer/channel_peer_fetcher_mock.go | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/observer/channel_peer.go b/observer/channel_peer.go index 0fdb553..85bcb56 100644 --- a/observer/channel_peer.go +++ b/observer/channel_peer.go @@ -42,11 +42,13 @@ type ( } PeerChannelsFetcher interface { + Uri() string api.ChannelListGetter api.ChainInfoGetter } PeerChannels interface { + Uri() string Channels() map[string]*ChannelInfo } @@ -135,6 +137,10 @@ func (cp *ChannelPeer) Observe(ctx context.Context) { }() } +func (cp *ChannelPeer) Host() string { + return cp.channelFetcher.Uri() +} + func (cp *ChannelPeer) Channels() map[string]*ChannelInfo { cp.mu.Lock() defer cp.mu.Unlock() diff --git a/observer/channel_peer_fetcher_mock.go b/observer/channel_peer_fetcher_mock.go index 2dc28a6..ba7c1a1 100644 --- a/observer/channel_peer_fetcher_mock.go +++ b/observer/channel_peer_fetcher_mock.go @@ -18,6 +18,10 @@ func NewChannelPeerFetcherMock(channels map[string]uint64) *ChannelPeerFetcherMo } } +func (c *ChannelPeerFetcherMock) Uri() string { + return "mock" +} + func (c *ChannelPeerFetcherMock) GetChannels(context.Context) (*peer.ChannelQueryResponse, error) { var channels []*peer.ChannelInfo for channelName := range c.channels { From 9e46cc946f3d11a04d0d924b38a2aea74db9138f Mon Sep 17 00:00:00 2001 From: Nikita Neznaemov Date: Tue, 26 Mar 2024 17:46:28 +0300 Subject: [PATCH 2/3] 2 --- observer/channel_peer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/observer/channel_peer.go b/observer/channel_peer.go index 85bcb56..28aee14 100644 --- a/observer/channel_peer.go +++ b/observer/channel_peer.go @@ -137,7 +137,7 @@ func (cp *ChannelPeer) Observe(ctx context.Context) { }() } -func (cp *ChannelPeer) Host() string { +func (cp *ChannelPeer) Uri() string { return cp.channelFetcher.Uri() } From a1e8d07293ed61c47ec0a90f31e49ebab7d7f9c6 Mon Sep 17 00:00:00 2001 From: Nikita Neznaemov Date: Wed, 27 Mar 2024 12:45:44 +0300 Subject: [PATCH 3/3] 3 --- observer/channel_peer_mock.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/observer/channel_peer_mock.go b/observer/channel_peer_mock.go index a641fa5..db86bb8 100644 --- a/observer/channel_peer_mock.go +++ b/observer/channel_peer_mock.go @@ -9,6 +9,10 @@ type ChannelPeerMock struct { channelsInfo map[string]*ChannelInfo } +func (m *ChannelPeerMock) Uri() string { + return "mock" +} + func NewChannelPeerMock(channelsInfo ...*ChannelInfo) *ChannelPeerMock { channels := make(map[string]*ChannelInfo, len(channelsInfo)) for _, channelInfo := range channelsInfo {