github.com/evdatsion/aphelion-dpos-bft@v0.32.1/types/signed_msg_type.go (about)

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