-
Notifications
You must be signed in to change notification settings - Fork 199
/
p2pMessageMock.go
51 lines (41 loc) · 937 Bytes
/
p2pMessageMock.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
package mock
import (
"github.com/ElrondNetwork/elrond-go/p2p"
)
type P2PMessageMock struct {
FromField []byte
DataField []byte
SeqNoField []byte
TopicIDsField []string
SignatureField []byte
KeyField []byte
PeerField p2p.PeerID
}
func (msg *P2PMessageMock) From() []byte {
return msg.FromField
}
func (msg *P2PMessageMock) Data() []byte {
return msg.DataField
}
func (msg *P2PMessageMock) SeqNo() []byte {
return msg.SeqNo()
}
func (msg *P2PMessageMock) TopicIDs() []string {
return msg.TopicIDsField
}
func (msg *P2PMessageMock) Signature() []byte {
return msg.SignatureField
}
func (msg *P2PMessageMock) Key() []byte {
return msg.KeyField
}
func (msg *P2PMessageMock) Peer() p2p.PeerID {
return msg.PeerField
}
// IsInterfaceNil returns true if there is no value under the interface
func (msg *P2PMessageMock) IsInterfaceNil() bool {
if msg == nil {
return true
}
return false
}