dione/consensus/types/message.go

31 lines
557 B
Go
Raw Normal View History

package types
2020-11-15 13:46:58 +00:00
import (
"github.com/libp2p/go-libp2p-core/peer"
)
type MessageType uint8
const (
MessageTypeUnknown = MessageType(iota)
MessageTypePrePrepare
MessageTypePrepare
MessageTypeCommit
)
type ConsensusMessage struct {
_ struct{} `cbor:",toarray"`
2020-11-15 13:46:58 +00:00
ConsensusID string
2020-11-18 18:14:56 +00:00
Signature []byte
2020-11-15 13:46:58 +00:00
RequestID string
CallbackAddress string
Data string
}
type Message struct {
Type MessageType `cbor:"1,keyasint"`
Payload ConsensusMessage `cbor:"2,keyasint"`
From peer.ID `cbor:"-"`
}