Revision 7f607d0ce23d5c578325b2d2a6bfe2273191cf9b authored by Mauricio Serna on 11 January 2019, 22:41:02 UTC, committed by Ethan Buchman on 11 January 2019, 22:41:02 UTC
1 parent 81c51cd
Raw File
signed_msg_type.go
package types

// SignedMsgType is a type of signed message in the consensus.
type SignedMsgType byte

const (
	// Votes
	PrevoteType   SignedMsgType = 0x01
	PrecommitType SignedMsgType = 0x02

	// Proposals
	ProposalType SignedMsgType = 0x20
)

// IsVoteTypeValid returns true if t is a valid vote type.
func IsVoteTypeValid(t SignedMsgType) bool {
	switch t {
	case PrevoteType, PrecommitType:
		return true
	default:
		return false
	}
}
back to top