2020-11-18 19:53:52 +00:00
|
|
|
package types
|
2020-10-20 18:18:36 +00:00
|
|
|
|
2020-11-15 13:46:58 +00:00
|
|
|
import (
|
2020-11-27 16:16:08 +00:00
|
|
|
"github.com/Secured-Finance/dione/types"
|
2020-11-15 13:46:58 +00:00
|
|
|
"github.com/libp2p/go-libp2p-core/peer"
|
|
|
|
)
|
|
|
|
|
|
|
|
type MessageType uint8
|
|
|
|
|
|
|
|
const (
|
|
|
|
MessageTypeUnknown = MessageType(iota)
|
|
|
|
|
|
|
|
MessageTypePrePrepare
|
|
|
|
MessageTypePrepare
|
|
|
|
MessageTypeCommit
|
|
|
|
)
|
|
|
|
|
|
|
|
type ConsensusMessage struct {
|
2021-03-15 20:39:52 +00:00
|
|
|
Task types.DioneTask
|
2020-11-15 13:46:58 +00:00
|
|
|
}
|
|
|
|
|
2020-10-20 18:18:36 +00:00
|
|
|
type Message struct {
|
2020-12-04 18:30:03 +00:00
|
|
|
Type MessageType
|
|
|
|
Payload ConsensusMessage
|
|
|
|
From peer.ID `cbor:"-"`
|
2020-10-20 18:18:36 +00:00
|
|
|
}
|