validator

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcMaxFaultyNodes added in v1.2.1

func CalcMaxFaultyNodes(s Validators) int

CalcMaxFaultyNodes returns the maximum number of allowed faulty nodes (F), based on the current validator set

Types

type Validators

type Validators []types.Address

func (*Validators) Add

func (v *Validators) Add(addr types.Address)

Add adds a new address to the validator set

func (*Validators) CalcProposer

func (v *Validators) CalcProposer(round uint64, lastProposer types.Address) types.Address

CalcProposer calculates the address of the next proposer, from the validator set

func (*Validators) Del

func (v *Validators) Del(addr types.Address)

Del removes an address from the validator set

func (*Validators) Equal

func (v *Validators) Equal(vv *Validators) bool

Equal checks if 2 validator sets are equal

func (*Validators) Includes

func (v *Validators) Includes(addr types.Address) bool

Includes checks if the address is in the validator set

func (*Validators) Index

func (v *Validators) Index(addr types.Address) int

Index returns the index of the passed in address in the validator set. Returns -1 if not found

func (*Validators) Len

func (v *Validators) Len() int

Len returns the size of the validator set

Jump to

Keyboard shortcuts

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