forked from multiversx/mx-chain-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
message.go
40 lines (37 loc) · 1.07 KB
/
message.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
//go:generate protoc -I=proto -I=$GOPATH/src -I=$GOPATH/src/github.com/ElrondNetwork/protobuf/protobuf --gogoslick_out=. message.proto
package consensus
import "github.com/ElrondNetwork/elrond-go/core"
// MessageType specifies what type of message was received
type MessageType int
// NewConsensusMessage creates a new Message object
func NewConsensusMessage(
blHeaderHash []byte,
signatureShare []byte,
body []byte,
header []byte,
pubKey []byte,
sig []byte,
msg int,
roundIndex int64,
chainID []byte,
pubKeysBitmap []byte,
aggregateSignature []byte,
leaderSignature []byte,
currentPid core.PeerID,
) *Message {
return &Message{
BlockHeaderHash: blHeaderHash,
SignatureShare: signatureShare,
Body: body,
Header: header,
PubKey: pubKey,
Signature: sig,
MsgType: int64(msg),
RoundIndex: roundIndex,
ChainID: chainID,
PubKeysBitmap: pubKeysBitmap,
AggregateSignature: aggregateSignature,
LeaderSignature: leaderSignature,
OriginatorPid: currentPid.Bytes(),
}
}