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