-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
mock_peer.go
81 lines (63 loc) · 1.74 KB
/
mock_peer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package lnpeer
import (
"net"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/wire"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/stretchr/testify/mock"
)
// MockPeer implements the `lnpeer.Peer` interface.
type MockPeer struct {
mock.Mock
}
// Compile time assertion that MockPeer implements lnpeer.Peer.
var _ Peer = (*MockPeer)(nil)
func (m *MockPeer) SendMessage(sync bool, msgs ...lnwire.Message) error {
args := m.Called(sync, msgs)
return args.Error(0)
}
func (m *MockPeer) SendMessageLazy(sync bool, msgs ...lnwire.Message) error {
args := m.Called(sync, msgs)
return args.Error(0)
}
func (m *MockPeer) AddNewChannel(channel *NewChannel,
cancel <-chan struct{}) error {
args := m.Called(channel, cancel)
return args.Error(0)
}
func (m *MockPeer) AddPendingChannel(cid lnwire.ChannelID,
cancel <-chan struct{}) error {
args := m.Called(cid, cancel)
return args.Error(0)
}
func (m *MockPeer) RemovePendingChannel(cid lnwire.ChannelID) error {
args := m.Called(cid)
return args.Error(0)
}
func (m *MockPeer) WipeChannel(op *wire.OutPoint) {
m.Called(op)
}
func (m *MockPeer) PubKey() [33]byte {
args := m.Called()
return args.Get(0).([33]byte)
}
func (m *MockPeer) IdentityKey() *btcec.PublicKey {
args := m.Called()
return args.Get(0).(*btcec.PublicKey)
}
func (m *MockPeer) Address() net.Addr {
args := m.Called()
return args.Get(0).(net.Addr)
}
func (m *MockPeer) QuitSignal() <-chan struct{} {
args := m.Called()
return args.Get(0).(<-chan struct{})
}
func (m *MockPeer) LocalFeatures() *lnwire.FeatureVector {
args := m.Called()
return args.Get(0).(*lnwire.FeatureVector)
}
func (m *MockPeer) RemoteFeatures() *lnwire.FeatureVector {
args := m.Called()
return args.Get(0).(*lnwire.FeatureVector)
}