Documentation ¶
Index ¶
- type BinaryVoteSet
- func (vs *BinaryVoteSet) AddVote(v *vote.Vote) (bool, error)
- func (vs *BinaryVoteSet) AllVotes() []*vote.Vote
- func (vs *BinaryVoteSet) BinaryVotes(cpRound int16, cpValue vote.CPValue) map[crypto.Address]*vote.Vote
- func (vs *BinaryVoteSet) GetRandomVote(cpRound int16, cpValue vote.CPValue) *vote.Vote
- func (vs *BinaryVoteSet) HasAllVotesFor(cpRound int16, cpValue vote.CPValue) bool
- func (vs *BinaryVoteSet) HasAnyVoteFor(cpRound int16, cpValue vote.CPValue) bool
- func (vs *BinaryVoteSet) HasOneThirdOfTotalPower(cpRound int16) bool
- func (vs *BinaryVoteSet) HasQuorumVotesFor(cpRound int16, cpValue vote.CPValue) bool
- func (vs *BinaryVoteSet) HasTwoThirdOfTotalPower(cpRound int16) bool
- func (vs BinaryVoteSet) Round() int16
- type BlockVoteSet
- func (vs *BlockVoteSet) AddVote(v *vote.Vote) (bool, error)
- func (vs *BlockVoteSet) AllVotes() []*vote.Vote
- func (vs *BlockVoteSet) BlockVotes(blockHash hash.Hash) map[crypto.Address]*vote.Vote
- func (vs *BlockVoteSet) HasQuorumHash() bool
- func (vs *BlockVoteSet) QuorumHash() *hash.Hash
- func (vs BlockVoteSet) Round() int16
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 NewCPMainVoteVoteSet ¶ added in v0.15.0
func NewCPPreVoteVoteSet ¶ added in v0.15.0
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 (*BinaryVoteSet) GetRandomVote ¶ added in v0.15.0
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
type BlockVoteSet ¶ added in v0.15.0
type BlockVoteSet struct {
// contains filtered or unexported fields
}
func NewPrecommitVoteSet ¶ added in v0.15.0
func NewPrepareVoteSet ¶ added in v0.15.0
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 (*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.
Click to show internal directories.
Click to hide internal directories.