-
Notifications
You must be signed in to change notification settings - Fork 672
/
message.go
40 lines (32 loc) · 960 Bytes
/
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
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package common
import (
"fmt"
)
// TODO: Consider renaming Message to, say, VMMessage
// Message is an enum of the message types that vms can send to consensus
type Message uint32
const (
// PendingTxs notifies a consensus engine that
// its VM has pending transactions
// (i.e. it would like to add a new block/vertex to consensus)
PendingTxs Message = iota
// StateSyncDone notifies the state syncer engine that the VM has finishing
// syncing the requested state summary.
StateSyncDone
// StopVertex notifies a consensus that it has a pending stop vertex
StopVertex
)
func (msg Message) String() string {
switch msg {
case PendingTxs:
return "Pending Transactions"
case StateSyncDone:
return "State Sync Done"
case StopVertex:
return "Pending Stop Vertex"
default:
return fmt.Sprintf("Unknown Message: %d", msg)
}
}