voteset

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryVoteSet added in v0.15.0

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

func NewCPDecidedVoteVoteSet added in v0.15.1

func NewCPDecidedVoteVoteSet(round int16, totalPower int64,
	validators map[crypto.Address]*validator.Validator,
) *BinaryVoteSet

func NewCPMainVoteVoteSet added in v0.15.0

func NewCPMainVoteVoteSet(round int16, totalPower int64,
	validators map[crypto.Address]*validator.Validator,
) *BinaryVoteSet

func NewCPPreVoteVoteSet added in v0.15.0

func NewCPPreVoteVoteSet(round int16, totalPower int64,
	validators map[crypto.Address]*validator.Validator,
) *BinaryVoteSet

func (*BinaryVoteSet) AddVote added in v0.15.0

func (vs *BinaryVoteSet) AddVote(v *vote.Vote) (bool, error)

AddVote attempts to add a vote to the VoteSet. Returns an error if the vote is invalid.

func (*BinaryVoteSet) AllVotes added in v0.15.0

func (vs *BinaryVoteSet) AllVotes() []*vote.Vote

AllVotes returns a list of all votes in the VoteSet.

func (*BinaryVoteSet) BinaryVotes added in v0.15.0

func (vs *BinaryVoteSet) BinaryVotes(cpRound int16, cpValue vote.CPValue) map[crypto.Address]*vote.Vote

func (*BinaryVoteSet) GetRandomVote added in v0.15.0

func (vs *BinaryVoteSet) GetRandomVote(cpRound int16, cpValue vote.CPValue) *vote.Vote

func (*BinaryVoteSet) HasAllVotesFor added in v0.15.0

func (vs *BinaryVoteSet) HasAllVotesFor(cpRound int16, cpValue vote.CPValue) bool

func (*BinaryVoteSet) HasAnyVoteFor added in v0.15.0

func (vs *BinaryVoteSet) HasAnyVoteFor(cpRound int16, cpValue vote.CPValue) bool

func (*BinaryVoteSet) HasOneThirdOfTotalPower added in v0.15.0

func (vs *BinaryVoteSet) HasOneThirdOfTotalPower(cpRound int16) bool

func (*BinaryVoteSet) HasQuorumVotesFor added in v0.15.0

func (vs *BinaryVoteSet) HasQuorumVotesFor(cpRound int16, cpValue vote.CPValue) bool

func (*BinaryVoteSet) HasTwoThirdOfTotalPower added in v0.15.0

func (vs *BinaryVoteSet) HasTwoThirdOfTotalPower(cpRound int16) bool

func (BinaryVoteSet) Round added in v0.15.0

func (vs BinaryVoteSet) Round() int16

Round returns the round number for the VoteSet.

type BlockVoteSet added in v0.15.0

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

func NewPrecommitVoteSet added in v0.15.0

func NewPrecommitVoteSet(round int16, totalPower int64,
	validators map[crypto.Address]*validator.Validator,
) *BlockVoteSet

func NewPrepareVoteSet added in v0.15.0

func NewPrepareVoteSet(round int16, totalPower int64,
	validators map[crypto.Address]*validator.Validator,
) *BlockVoteSet

func (*BlockVoteSet) AddVote added in v0.15.0

func (vs *BlockVoteSet) AddVote(v *vote.Vote) (bool, error)

AddVote attempts to add a vote to the VoteSet. Returns an error if the vote is invalid.

func (*BlockVoteSet) AllVotes added in v0.15.0

func (vs *BlockVoteSet) AllVotes() []*vote.Vote

AllVotes returns a list of all votes in the VoteSet.

func (*BlockVoteSet) BlockVotes added in v0.15.0

func (vs *BlockVoteSet) BlockVotes(blockHash hash.Hash) map[crypto.Address]*vote.Vote

func (*BlockVoteSet) HasQuorumHash added in v0.15.0

func (vs *BlockVoteSet) HasQuorumHash() bool

HasQuorumHash checks if there is a block that has received quorum votes (2/3+ of total power).

func (*BlockVoteSet) QuorumHash added in v0.15.0

func (vs *BlockVoteSet) QuorumHash() *hash.Hash

QuorumHash returns the hash of the block that has received quorum votes (2/3+ of total power). If no block has received the quorum threshold (2/3+ of total voting power), it returns nil.

func (BlockVoteSet) Round added in v0.15.0

func (vs BlockVoteSet) Round() int16

Round returns the round number for the VoteSet.

Jump to

Keyboard shortcuts

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