validator

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: MIT Imports: 6 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 FromBytes

func FromBytes(data []byte) (*Validator, error)

FromBytes constructs a new validator from byte array.

func GenerateTestValidator

func GenerateTestValidator(number int32) (*Validator, crypto.Signer)

GenerateTestValidator generates a validator for testing purpose.

func NewValidator

func NewValidator(publicKey *bls.PublicKey, number int32) *Validator

NewValidator constructs a new validator object.

func (*Validator) AddToStake

func (val *Validator) AddToStake(amt int64)

AddToStake increases the stake by bonding transaction.

func (*Validator) Address

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

func (*Validator) Bytes

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

func (*Validator) Hash

func (val *Validator) Hash() hash.Hash

Hash return the hash of this validator.

func (*Validator) IncSequence

func (val *Validator) IncSequence()

IncSequence increases the sequence anytime this validator signs a transaction.

func (*Validator) LastBondingHeight

func (val *Validator) LastBondingHeight() uint32

LastBondingHeight returns the last height in which validator bonded stake

func (*Validator) LastJoinedHeight

func (val *Validator) LastJoinedHeight() uint32

LastJoinedHeight returns the last height in which validator joined into the committee

func (*Validator) Number

func (val *Validator) Number() int32

func (Validator) Power

func (val Validator) Power() int64

func (*Validator) PublicKey

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

func (*Validator) Sequence

func (val *Validator) Sequence() int32

func (*Validator) SerializeSize

func (val *Validator) SerializeSize() int

func (*Validator) Stake

func (val *Validator) Stake() int64

func (*Validator) SubtractFromStake

func (val *Validator) SubtractFromStake(amt int64)

func (*Validator) UnbondingHeight

func (val *Validator) UnbondingHeight() uint32

UnbondingHeight returns the last height in which validator unbonded stake

func (*Validator) UpdateLastBondingHeight

func (val *Validator) UpdateLastBondingHeight(height uint32)

UpdateLastBondingHeight updates the last height that this validator bonded some stakes.

func (*Validator) UpdateLastJoinedHeight

func (val *Validator) UpdateLastJoinedHeight(height uint32)

UpdateLastJoinedHeight updates the last height that this validator joined the committee.

func (*Validator) UpdateUnbondingHeight

func (val *Validator) UpdateUnbondingHeight(height uint32)

UpdateUnbondingHeight updates the unbonding height for the validator.

Jump to

Keyboard shortcuts

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