Documentation
¶
Index ¶
- type Validators
- type VoteCounter
- func (v *VoteCounter[V, H, A]) AddPrecommit(precommit *types.Precommit[H, A]) bool
- func (v *VoteCounter[V, H, A]) AddPrevote(prevote *types.Prevote[H, A]) bool
- func (v *VoteCounter[V, H, A]) AddProposal(proposal *types.Proposal[V, H, A]) bool
- func (v *VoteCounter[V, H, A]) AssertEmpty(t *testing.T)
- func (v *VoteCounter[V, H, A]) AssertProposal(t *testing.T, expectedMsg starknet.Proposal)
- func (v *VoteCounter[V, H, A]) AssertVote(t *testing.T, vote *types.Vote[H, A], voteType VoteType)
- func (v *VoteCounter[V, H, A]) GetProposal(round types.Round) *types.Proposal[V, H, A]
- func (v *VoteCounter[V, H, A]) HasNonFaultyFutureMessage(round types.Round) bool
- func (v *VoteCounter[V, H, A]) HasQuorumForAny(round types.Round, voteType VoteType) bool
- func (v *VoteCounter[V, H, A]) HasQuorumForVote(round types.Round, voteType VoteType, id *H) bool
- func (v *VoteCounter[V, H, A]) LoadFromMessages(messages iter.Seq2[types.Message[V, H, A], error]) error
- func (v *VoteCounter[V, H, A]) Proposer(round types.Round) A
- func (v *VoteCounter[V, H, A]) StartNewHeight()
- type VoteType
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 (*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]) 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]) LoadFromMessages ¶
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()
Click to show internal directories.
Click to hide internal directories.