votecounter

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Validators

type Validators[A types.Addr] interface {
	// TotalVotingPower represents N which is required to calculate the thresholds.
	TotalVotingPower(types.Height) types.VotingPower

	// ValidatorVotingPower returns the voting power of the a single validator. This is also required to implement
	// various thresholds. The assumption is that a single validator cannot have voting power more than f.
	ValidatorVotingPower(types.Height, *A) types.VotingPower

	// Proposer returns the proposer of the current round and height.
	Proposer(types.Height, types.Round) A
}

type VoteCounter

type VoteCounter[V types.Hashable[H], H types.Hash, A types.Addr] struct {
	// contains filtered or unexported fields
}

func New

func New[V types.Hashable[H], H types.Hash, A types.Addr](validators Validators[A], height types.Height) VoteCounter[V, H, A]

func (*VoteCounter[V, H, A]) AddPrecommit

func (v *VoteCounter[V, H, A]) AddPrecommit(precommit *types.Precommit[H, A]) bool

func (*VoteCounter[V, H, A]) AddPrevote

func (v *VoteCounter[V, H, A]) AddPrevote(prevote *types.Prevote[H, A]) bool

func (*VoteCounter[V, H, A]) AddProposal

func (v *VoteCounter[V, H, A]) AddProposal(proposal *types.Proposal[V, H, A]) bool

func (*VoteCounter[V, H, A]) AssertEmpty

func (v *VoteCounter[V, H, A]) AssertEmpty(t *testing.T)

func (*VoteCounter[V, H, A]) AssertProposal

func (v *VoteCounter[V, H, A]) AssertProposal(t *testing.T, expectedMsg starknet.Proposal)

assertProposal asserts that the proposal message is in the state machine, except when the state machine advanced to the next height.

func (*VoteCounter[V, H, A]) AssertVote

func (v *VoteCounter[V, H, A]) AssertVote(t *testing.T, vote *types.Vote[H, A], voteType VoteType)

func (*VoteCounter[V, H, A]) GetProposal

func (v *VoteCounter[V, H, A]) GetProposal(round types.Round) *types.Proposal[V, H, A]

func (*VoteCounter[V, H, A]) HasFuturePrecommitQuorum added in v0.15.20

func (v *VoteCounter[V, H, A]) HasFuturePrecommitQuorum(
	height types.Height,
	round types.Round,
	id *H,
) bool

func (*VoteCounter[V, H, A]) HasNonFaultyFutureMessage

func (v *VoteCounter[V, H, A]) HasNonFaultyFutureMessage(round types.Round) bool

func (*VoteCounter[V, H, A]) HasQuorumForAny

func (v *VoteCounter[V, H, A]) HasQuorumForAny(round types.Round, voteType VoteType) bool

func (*VoteCounter[V, H, A]) HasQuorumForVote

func (v *VoteCounter[V, H, A]) HasQuorumForVote(round types.Round, voteType VoteType, id *H) bool

func (*VoteCounter[V, H, A]) Proposer

func (v *VoteCounter[V, H, A]) Proposer(round types.Round) A

func (*VoteCounter[V, H, A]) StartNewHeight

func (v *VoteCounter[V, H, A]) StartNewHeight()

type VoteType

type VoteType uint8
const (
	Prevote VoteType = iota
	Precommit
)

Jump to

Keyboard shortcuts

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