vote

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VoteTypePrepare        = Type(1)
	VoteTypePrecommit      = Type(2)
	VoteTypeChangeProposer = Type(3)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Type

type Type int

func (Type) IsValid

func (t Type) IsValid() bool

func (Type) String

func (t Type) String() string

type Vote

type Vote struct {
	// contains filtered or unexported fields
}

Vote represents a prepare, precommit, or commit vote from validators for consensus.

func GenerateTestChangeProposerVote

func GenerateTestChangeProposerVote(height uint32, round int16) (*Vote, crypto.Signer)

GenerateTestChangeProposerVote generates a proposer-change vote for testing.

func GenerateTestPrecommitVote

func GenerateTestPrecommitVote(height uint32, round int16) (*Vote, crypto.Signer)

GenerateTestPrecommitVote generates a precommit vote for testing.

func GenerateTestPrepareVote

func GenerateTestPrepareVote(height uint32, round int16) (*Vote, crypto.Signer)

GenerateTestPrepareVote generates a prepare vote for testing.

func NewVote

func NewVote(voteType Type, height uint32, round int16, blockHash hash.Hash, signer crypto.Address) *Vote

func (*Vote) BlockHash

func (v *Vote) BlockHash() hash.Hash

func (*Vote) Fingerprint

func (v *Vote) Fingerprint() string

func (*Vote) Hash

func (v *Vote) Hash() hash.Hash

func (*Vote) Height

func (v *Vote) Height() uint32

func (*Vote) MarshalCBOR

func (v *Vote) MarshalCBOR() ([]byte, error)

func (*Vote) Round

func (v *Vote) Round() int16

func (*Vote) SanityCheck

func (v *Vote) SanityCheck() error

func (*Vote) SetPublicKey

func (v *Vote) SetPublicKey(crypto.PublicKey)

SetPublicKey is doing nothing and just satisfies SignableMsg interface.

func (*Vote) SetSignature

func (v *Vote) SetSignature(sig crypto.Signature)

func (*Vote) SignBytes

func (v *Vote) SignBytes() []byte

func (*Vote) Signature

func (v *Vote) Signature() *bls.Signature

func (*Vote) Signer

func (v *Vote) Signer() crypto.Address

func (*Vote) Type

func (v *Vote) Type() Type

func (*Vote) UnmarshalCBOR

func (v *Vote) UnmarshalCBOR(bs []byte) error

func (*Vote) Verify

func (v *Vote) Verify(pubKey *bls.PublicKey) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL