validator

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package validator provides functionality for managing validator information.

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
}

The Validator struct represents a validator object.

func FromBytes

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

FromBytes constructs a new validator from a byte array.

func NewValidator

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

NewValidator constructs a new validator from the given public key and number.

func (*Validator) AddToStake

func (val *Validator) AddToStake(amt amount.Amount)

AddToStake adds the given amount to the validator's stake.

func (*Validator) Address

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

Address returns the address of the validator.

func (*Validator) Bytes

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

Bytes returns the serialized byte representation of the validator.

func (*Validator) Clone added in v0.12.0

func (val *Validator) Clone() *Validator

Clone creates a deep copy of the validator.

func (*Validator) Hash

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

Hash calculates and returns the hash of the validator.

func (*Validator) LastBondingHeight

func (val *Validator) LastBondingHeight() uint32

LastBondingHeight returns the last height in which the validator bonded stake.

func (*Validator) LastSortitionHeight added in v0.15.0

func (val *Validator) LastSortitionHeight() uint32

LastSortitionHeight returns the last height in which the validator evaluated sortition.

func (*Validator) Number

func (val *Validator) Number() int32

Number returns the number of the validator.

func (Validator) Power

func (val Validator) Power() int64

Power returns the power of the validator.

func (*Validator) PublicKey

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

PublicKey returns the public key of the validator.

func (*Validator) SerializeSize

func (val *Validator) SerializeSize() int

SerializeSize returns the size in bytes required to serialize the validator.

func (*Validator) Stake

func (val *Validator) Stake() amount.Amount

Stake returns the stake of the validator.

func (*Validator) SubtractFromStake

func (val *Validator) SubtractFromStake(amt amount.Amount)

SubtractFromStake subtracts the given amount from the validator's stake.

func (*Validator) UnbondingHeight

func (val *Validator) UnbondingHeight() uint32

UnbondingHeight returns the last height in which the validator unbonded stake.

func (*Validator) UpdateLastBondingHeight

func (val *Validator) UpdateLastBondingHeight(height uint32)

UpdateLastBondingHeight updates the last height at which the validator bonded some stakes.

func (*Validator) UpdateLastSortitionHeight added in v0.15.0

func (val *Validator) UpdateLastSortitionHeight(height uint32)

UpdateLastJoinedHeight updates the last height at which the 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