committee

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Committee

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

func GenerateTestCommittee

func GenerateTestCommittee() (*Committee, []crypto.Signer)

GenerateTestCommittee generates a validator committee for testing purpose

func NewCommittee

func NewCommittee(validators []*validator.Validator, committeeSize int, proposerAddress crypto.Address) (*Committee, error)

func (*Committee) Committers added in v1.0.0

func (committee *Committee) Committers() []int

func (*Committee) Contains added in v1.0.0

func (committee *Committee) Contains(addr crypto.Address) bool

func (*Committee) IsProposer added in v1.0.0

func (committee *Committee) IsProposer(addr crypto.Address, round int) bool

IsProposer checks if the address is proposer for this run at the given round

func (*Committee) Proposer added in v1.0.0

func (committee *Committee) Proposer(round int) *validator.Validator

Proposer returns proposer info for this run at the given round

func (*Committee) Size added in v1.0.0

func (committee *Committee) Size() int

func (*Committee) TotalPower added in v1.0.0

func (committee *Committee) TotalPower() int64

func (*Committee) TotalStake added in v1.0.0

func (committee *Committee) TotalStake() int64

func (*Committee) Update

func (committee *Committee) Update(lastRound int, joined []*validator.Validator) error

func (*Committee) Validator added in v1.0.0

func (committee *Committee) Validator(addr crypto.Address) *validator.Validator

func (*Committee) Validators added in v1.0.0

func (committee *Committee) Validators() []*validator.Validator

type Reader

type Reader interface {
	Validators() []*validator.Validator
	Contains(addr crypto.Address) bool
	Proposer(round int) *validator.Validator
	IsProposer(addr crypto.Address, round int) bool
	Size() int
	TotalPower() int64
	TotalStake() int64
}

Jump to

Keyboard shortcuts

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