validators

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValidatorMaxAbsentWindow = 24
	ValidatorMaxAbsentTimes  = 12
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Validator

type Validator struct {
	PubKey      types.Pubkey
	AbsentTimes *types.BitArray
	// contains filtered or unexported fields
}

func NewValidator

func NewValidator(pubKey types.Pubkey, absentTimes *types.BitArray, totalStake *big.Int, accumReward *big.Int, isDirty bool, isTotalStakeDirty bool, isAccumRewardDirty bool, bus *bus.Bus) *Validator

func (*Validator) AddAccumReward

func (v *Validator) AddAccumReward(amount *big.Int)

func (*Validator) CountAbsentTimes

func (v *Validator) CountAbsentTimes() int

func (*Validator) GetAccumReward

func (v *Validator) GetAccumReward() *big.Int

func (*Validator) GetAddress

func (v *Validator) GetAddress() types.TmAddress

func (*Validator) GetTotalBipStake

func (v *Validator) GetTotalBipStake() *big.Int

func (*Validator) IsToDrop

func (v *Validator) IsToDrop() bool

func (*Validator) SetAbsent

func (v *Validator) SetAbsent(height uint64)

func (*Validator) SetAccumReward

func (v *Validator) SetAccumReward(value *big.Int)

func (*Validator) SetPresent

func (v *Validator) SetPresent(height uint64)

func (*Validator) SetTotalBipStake

func (v *Validator) SetTotalBipStake(value *big.Int)

type Validators

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

func NewValidators

func NewValidators(bus *bus.Bus, iavl tree.Tree) (*Validators, error)

func (*Validators) Commit

func (v *Validators) Commit() error

func (*Validators) Create

func (v *Validators) Create(pubkey types.Pubkey, stake *big.Int)

func (*Validators) Export

func (v *Validators) Export(state *types.AppState)

func (*Validators) GetByPublicKey added in v1.1.6

func (v *Validators) GetByPublicKey(pubKey types.Pubkey) *Validator

func (*Validators) GetByTmAddress added in v1.1.6

func (v *Validators) GetByTmAddress(address types.TmAddress) *Validator

func (*Validators) GetValidators

func (v *Validators) GetValidators() []*Validator

func (*Validators) LoadValidators

func (v *Validators) LoadValidators()

func (*Validators) PayRewards

func (v *Validators) PayRewards(height uint64)

func (*Validators) PunishByzantineValidator

func (v *Validators) PunishByzantineValidator(tmAddress [20]byte)

func (*Validators) SetNewValidators

func (v *Validators) SetNewValidators(candidates []candidates.Candidate)

func (*Validators) SetToDrop

func (v *Validators) SetToDrop(pubkey types.Pubkey)

func (*Validators) SetValidatorAbsent

func (v *Validators) SetValidatorAbsent(height uint64, address types.TmAddress)

func (*Validators) SetValidatorPresent

func (v *Validators) SetValidatorPresent(height uint64, address types.TmAddress)

func (*Validators) SetValidators

func (v *Validators) SetValidators(vals []*Validator)

Jump to

Keyboard shortcuts

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