validator

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Validator

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

func NewValidator

func NewValidator(publicKey crypto.PublicKey, bondingHeight uint64) (*Validator, error)

func ValidatorFromBytes

func ValidatorFromBytes(bs []byte) (*Validator, error)

func ValidatorFromJSON

func ValidatorFromJSON(bs []byte) (*Validator, error)

func (*Validator) AddToStake

func (val *Validator) AddToStake(amt uint64) error

func (*Validator) Address

func (val *Validator) Address() crypto.Address

func (*Validator) BondingHeight

func (val *Validator) BondingHeight() uint64

func (*Validator) Decode

func (val *Validator) Decode(bs []byte) error

func (Validator) Encode

func (val Validator) Encode() ([]byte, error)

func (*Validator) IncSequence

func (val *Validator) IncSequence()

func (*Validator) Marshal added in v0.3.0

func (val *Validator) Marshal() ([]byte, error)

func (Validator) MarshalJSON

func (val Validator) MarshalJSON() ([]byte, error)

func (*Validator) MarshalTo added in v0.3.0

func (val *Validator) MarshalTo(data []byte) (int, error)

func (Validator) MinimumStakeToUnbond

func (val Validator) MinimumStakeToUnbond() uint64

func (Validator) Power

func (val Validator) Power() int64

func (*Validator) PublicKey

func (val *Validator) PublicKey() crypto.PublicKey

func (*Validator) Sequence

func (val *Validator) Sequence() uint64

func (*Validator) Size added in v0.3.0

func (val *Validator) Size() int

func (*Validator) Stake

func (val *Validator) Stake() uint64

func (Validator) String

func (val Validator) String() string

func (*Validator) SubtractFromStake

func (val *Validator) SubtractFromStake(amt uint64) error

func (*Validator) Unmarshal added in v0.3.0

func (val *Validator) Unmarshal(bs []byte) error

func (*Validator) UnmarshalJSON

func (val *Validator) UnmarshalJSON(bs []byte) error

type ValidatorSet

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

func NewValidatorSet

func NewValidatorSet(validators map[crypto.Address]*Validator, maximumPower int) *ValidatorSet

func (*ValidatorSet) AdjustPower

func (set *ValidatorSet) AdjustPower(height int64) error

func (*ValidatorSet) Contains

func (set *ValidatorSet) Contains(addr crypto.Address) bool

func (*ValidatorSet) ForceLeave

func (set *ValidatorSet) ForceLeave(addr crypto.Address) error

func (*ValidatorSet) Join

func (set *ValidatorSet) Join(val *Validator) error

func (*ValidatorSet) Leavers

func (set *ValidatorSet) Leavers() map[crypto.Address]*Validator

func (*ValidatorSet) MaximumPower

func (set *ValidatorSet) MaximumPower() int

func (*ValidatorSet) TotalPower

func (set *ValidatorSet) TotalPower() int

TotalPower equals to the number of validator in the set

func (*ValidatorSet) UpdateMaximumPower

func (set *ValidatorSet) UpdateMaximumPower(maximumPower int)

func (*ValidatorSet) Validators

func (set *ValidatorSet) Validators() map[crypto.Address]*Validator

Jump to

Keyboard shortcuts

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