validators

package
v0.0.0-...-abb4387 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsConsAddr

func IsConsAddr(address string) bool

func IsOprAddr

func IsOprAddr(address string) bool

Types

type ValidatorInfo

type ValidatorInfo struct {
	ValidatorRecord        `json:"validator"`
	TotalSignedBlocks      uint64  `json:"total_signed_blocks"`
	FirstSignedBlockHeight uint64  `json:"first_signed_block"`
	UpTime                 float32 `json:"up_time"`     // From the joining block
	UpTimeAll              float32 `json:"up_time_all"` // From  the first block
}

func GetAllValidatorsWithInfo

func GetAllValidatorsWithInfo() ([]ValidatorInfo, error)

func GetAllValidatorsWithInfoByBlockHeightRange

func GetAllValidatorsWithInfoByBlockHeightRange(beginHeight, endHeight uint64) ([]ValidatorInfo, error)

type ValidatorRecord

type ValidatorRecord struct {
	ConsAddr string `json:"cons_address"`
	OprAddr  string `json:"opr_address"`
	AccAddr  string `json:"acc_address"`
	Moniker  string `json:"moniker"`
}

func DBRowToValidatorRecord

func DBRowToValidatorRecord(row database.RowType) ValidatorRecord

func DBRowToValidatorRecords

func DBRowToValidatorRecords(row []database.RowType) []ValidatorRecord

func GetAllValidators

func GetAllValidators() ([]ValidatorRecord, error)

func GetJoinedAfterGenesisValidators

func GetJoinedAfterGenesisValidators() ([]ValidatorRecord, error)

func GetValidatorByConsAddr

func GetValidatorByConsAddr(valConsAddr string) (ValidatorRecord, error)

func GetValidatorByOprAddr

func GetValidatorByOprAddr(valOprAddr string) (ValidatorRecord, error)

func GetValidatorsWithPagination

func GetValidatorsWithPagination(limitOffset types.DBLimitOffset) ([]ValidatorRecord, types.Pagination, error)

func (*ValidatorRecord) GetFirstSignedBlockHeight

func (v *ValidatorRecord) GetFirstSignedBlockHeight() (uint64, error)

func (*ValidatorRecord) GetFirstSignedBlockHeightWithBegin

func (v *ValidatorRecord) GetFirstSignedBlockHeightWithBegin(beginHeight uint64) (uint64, error)

func (*ValidatorRecord) GetLatestSignedBlockHeight

func (v *ValidatorRecord) GetLatestSignedBlockHeight() (uint64, error)

func (*ValidatorRecord) GetLatestSignedBlockHeightWithEnd

func (v *ValidatorRecord) GetLatestSignedBlockHeightWithEnd(endHeight uint64) (uint64, error)

func (*ValidatorRecord) GetTotalSignedBlocks

func (v *ValidatorRecord) GetTotalSignedBlocks() (uint64, error)

func (*ValidatorRecord) GetTotalSignedBlocksWithHeightRange

func (v *ValidatorRecord) GetTotalSignedBlocksWithHeightRange(beginHeight, endHeight uint64) (uint64, error)

func (*ValidatorRecord) GetValidatorInfo

func (v *ValidatorRecord) GetValidatorInfo() (ValidatorInfo, error)

func (*ValidatorRecord) GetValidatorInfoByBlockHeightRange

func (v *ValidatorRecord) GetValidatorInfoByBlockHeightRange(beginHeight, endHeight uint64) (ValidatorInfo, error)

type ValidatorWithTx

type ValidatorWithTx struct {
	ValidatorRecord `json:"validator"`
	TxHash          string    `json:"tx_hash"`
	Height          uint64    `json:"height"`
	Sender          string    `json:"sender"`
	LogTime         time.Time `json:"logtime"`
}

func DBRowToValidatorWithTx

func DBRowToValidatorWithTx(row database.RowType) ValidatorWithTx

func DBRowToValidatorWithTxs

func DBRowToValidatorWithTxs(row []database.RowType) []ValidatorWithTx

func GetUnjailedValidators

func GetUnjailedValidators() ([]ValidatorWithTx, error)

Jump to

Keyboard shortcuts

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