Documentation
¶
Overview ¶
Package validator provides functionality for managing validator information.
Index ¶
- type Validator
- func (val *Validator) AddToStake(amt amount.Amount)
- func (val *Validator) Address() crypto.Address
- func (val *Validator) Bytes() ([]byte, error)
- func (val *Validator) Clone() *Validator
- func (val *Validator) DelegateExpired(height uint32) bool
- func (val *Validator) DelegateExpiry() uint32
- func (val *Validator) DelegateOwner() crypto.Address
- func (val *Validator) DelegateShare() amount.Amount
- func (val *Validator) Hash() hash.Hash
- func (val *Validator) IsDelegated() bool
- func (val *Validator) IsUnbonded() bool
- func (val *Validator) LastBondingHeight() uint32
- func (val *Validator) LastSortitionHeight() uint32
- func (val *Validator) Number() int32
- func (val *Validator) Power() int64
- func (val *Validator) ProtocolVersion() protocol.Version
- func (val *Validator) PublicKey() *bls.PublicKey
- func (val *Validator) SerializeSize() int
- func (val *Validator) SetDelegation(owner crypto.Address, share amount.Amount, expiry uint32)
- func (val *Validator) Stake() amount.Amount
- func (val *Validator) SubtractFromStake(amt amount.Amount)
- func (val *Validator) UnbondingHeight() uint32
- func (val *Validator) UpdateLastBondingHeight(height uint32)
- func (val *Validator) UpdateLastSortitionHeight(height uint32)
- func (val *Validator) UpdateProtocolVersion(ver protocol.Version)
- func (val *Validator) UpdateUnbondingHeight(height uint32)
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
}
The Validator struct represents a validator object.
func NewValidator ¶
NewValidator constructs a new validator from the given public key and number.
func (*Validator) AddToStake ¶
AddToStake adds the given amount to the validator's stake.
func (*Validator) DelegateExpired ¶ added in v1.13.0
DelegateExpired returns true if delegation has expired at the given height.
func (*Validator) DelegateExpiry ¶ added in v1.13.0
DelegateExpiry returns the block height at which delegation expires (0 = no expiry).
func (*Validator) DelegateOwner ¶ added in v1.13.0
DelegateOwner returns the stake owner account address for delegated validators.
func (*Validator) DelegateShare ¶ added in v1.13.0
DelegateShare returns the stake owner's reward share (in nano PAC) for delegated validators.
func (*Validator) IsDelegated ¶ added in v1.13.0
IsDelegated returns true if the validator has delegation (stake owner != operator).
func (*Validator) IsUnbonded ¶ added in v1.10.0
IsUnbonded returns true if the validator is unbonded.
func (*Validator) LastBondingHeight ¶
LastBondingHeight returns the last height in which the validator bonded stake.
func (*Validator) LastSortitionHeight ¶ added in v0.15.0
LastSortitionHeight returns the last height in which the validator evaluated sortition.
func (*Validator) ProtocolVersion ¶ added in v1.9.0
ProtocolVersion returns the protocol version of the validator.
func (*Validator) SerializeSize ¶
SerializeSize returns the size in bytes required to serialize the validator.
func (*Validator) SetDelegation ¶ added in v1.13.0
SetDelegation sets the delegation fields (PIP-49). Use zero owner to clear delegation.
func (*Validator) SubtractFromStake ¶
SubtractFromStake subtracts the given amount from the validator's stake.
func (*Validator) UnbondingHeight ¶
UnbondingHeight returns the last height in which the validator unbonded stake.
func (*Validator) UpdateLastBondingHeight ¶
UpdateLastBondingHeight updates the last height at which the validator bonded some stakes.
func (*Validator) UpdateLastSortitionHeight ¶ added in v0.15.0
UpdateLastSortitionHeight updates the last height at which the validator performed a valid sortition.
func (*Validator) UpdateProtocolVersion ¶ added in v1.9.0
UpdateProtocolVersion updates the protocol version of the validator.
func (*Validator) UpdateUnbondingHeight ¶
UpdateUnbondingHeight updates the unbonding height for the validator.