You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
440 B

  1. package types
  2. // SignedMsgType is a type of signed message in the consensus.
  3. type SignedMsgType byte
  4. const (
  5. // Votes
  6. PrevoteType SignedMsgType = 0x01
  7. PrecommitType SignedMsgType = 0x02
  8. // Proposals
  9. ProposalType SignedMsgType = 0x20
  10. )
  11. // IsVoteTypeValid returns true if t is a valid vote type.
  12. func IsVoteTypeValid(t SignedMsgType) bool {
  13. switch t {
  14. case PrevoteType, PrecommitType:
  15. return true
  16. default:
  17. return false
  18. }
  19. }