htlcswitch+funding+discovery: update mock peers to add new QuitSignal method

This commit is contained in:
Olaoluwa Osuntokun 2018-08-25 17:11:40 -07:00
parent 7f480f723c
commit 19552b0dbf
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21
4 changed files with 15 additions and 0 deletions

@ -2181,3 +2181,6 @@ func (p *mockPeer) PubKey() [33]byte {
return pubkey return pubkey
} }
func (p *mockPeer) Address() net.Addr { return nil } func (p *mockPeer) Address() net.Addr { return nil }
func (p *mockPeer) QuitSignal() <-chan struct{} {
return p.quit
}

@ -174,6 +174,10 @@ func (n *testNode) WipeChannel(_ *wire.OutPoint) error {
return nil return nil
} }
func (n *testNode) QuitSignal() <-chan struct{} {
return n.shutdownChannel
}
func (n *testNode) AddNewChannel(channel *lnwallet.LightningChannel, func (n *testNode) AddNewChannel(channel *lnwallet.LightningChannel,
quit <-chan struct{}) error { quit <-chan struct{}) error {

@ -1459,6 +1459,10 @@ type mockPeer struct {
quit chan struct{} quit chan struct{}
} }
func (m *mockPeer) QuitSignal() <-chan struct{} {
return m.quit
}
var _ lnpeer.Peer = (*mockPeer)(nil) var _ lnpeer.Peer = (*mockPeer)(nil)
func (m *mockPeer) SendMessage(sync bool, msgs ...lnwire.Message) error { func (m *mockPeer) SendMessage(sync bool, msgs ...lnwire.Message) error {

@ -238,6 +238,10 @@ func (s *mockServer) Start() error {
return nil return nil
} }
func (s *mockServer) QuitSignal() <-chan struct{} {
return s.quit
}
// mockHopIterator represents the test version of hop iterator which instead // 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. // of encrypting the path in onion blob just stores the path as a list of hops.
type mockHopIterator struct { type mockHopIterator struct {