From 19552b0dbfa8d91e676a734d3b346886525d6739 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 25 Aug 2018 17:11:40 -0700 Subject: [PATCH] htlcswitch+funding+discovery: update mock peers to add new QuitSignal method --- discovery/gossiper_test.go | 3 +++ fundingmanager_test.go | 4 ++++ htlcswitch/link_test.go | 4 ++++ htlcswitch/mock.go | 4 ++++ 4 files changed, 15 insertions(+) diff --git a/discovery/gossiper_test.go b/discovery/gossiper_test.go index 7d98c558..bc3642fd 100644 --- a/discovery/gossiper_test.go +++ b/discovery/gossiper_test.go @@ -2181,3 +2181,6 @@ func (p *mockPeer) PubKey() [33]byte { return pubkey } func (p *mockPeer) Address() net.Addr { return nil } +func (p *mockPeer) QuitSignal() <-chan struct{} { + return p.quit +} diff --git a/fundingmanager_test.go b/fundingmanager_test.go index 88253877..752f3b53 100644 --- a/fundingmanager_test.go +++ b/fundingmanager_test.go @@ -174,6 +174,10 @@ func (n *testNode) WipeChannel(_ *wire.OutPoint) error { return nil } +func (n *testNode) QuitSignal() <-chan struct{} { + return n.shutdownChannel +} + func (n *testNode) AddNewChannel(channel *lnwallet.LightningChannel, quit <-chan struct{}) error { diff --git a/htlcswitch/link_test.go b/htlcswitch/link_test.go index 1bb1fc95..f9b72405 100644 --- a/htlcswitch/link_test.go +++ b/htlcswitch/link_test.go @@ -1459,6 +1459,10 @@ type mockPeer struct { quit chan struct{} } +func (m *mockPeer) QuitSignal() <-chan struct{} { + return m.quit +} + var _ lnpeer.Peer = (*mockPeer)(nil) func (m *mockPeer) SendMessage(sync bool, msgs ...lnwire.Message) error { diff --git a/htlcswitch/mock.go b/htlcswitch/mock.go index e2539fac..617229b6 100644 --- a/htlcswitch/mock.go +++ b/htlcswitch/mock.go @@ -238,6 +238,10 @@ func (s *mockServer) Start() error { return nil } +func (s *mockServer) QuitSignal() <-chan struct{} { + return s.quit +} + // mockHopIterator represents the test version of hop iterator which instead // of encrypting the path in onion blob just stores the path as a list of hops. type mockHopIterator struct {