Help us shape the future of Go! Take the 2026 Go Developer Survey

validator

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetValidatorPartAndStake

func GetValidatorPartAndStake(validator models.Validator, totalStake string, validators []uint64) (*string, *string)

return validator stake and part of the total (%)

Types

type Params

type Params struct {
	TotalStake          string // total stake of current active validator ids (by last block)
	ActiveValidatorsIDs []uint64
}

type Repository

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

func NewRepository

func NewRepository(db *pg.DB) *Repository

func (Repository) GetActiveCandidatesCount

func (repository Repository) GetActiveCandidatesCount() int

Get active candidates count

func (Repository) GetActiveValidatorIds

func (repository Repository) GetActiveValidatorIds() []uint64

func (Repository) GetByPublicKey

func (repository Repository) GetByPublicKey(publicKey string) *models.Validator

func (Repository) GetTotalStakeByActiveValidators

func (repository Repository) GetTotalStakeByActiveValidators(ids []uint64) string

func (Repository) GetValidators

func (repository Repository) GetValidators() []models.Validator

Get validators

func (Repository) GetValidatorsBySymbol

func (repository Repository) GetValidatorsBySymbol(coinSymbol string, pagination *tools.Pagination) []models.Validator

func (Repository) GetValidatorsWithPagination

func (repository Repository) GetValidatorsWithPagination(pagination *tools.Pagination, field *string, orderBy *string) []models.Validator

type Resource

type Resource struct {
	PublicKey       string                `json:"public_key"`
	Status          *uint8                `json:"status"`
	Meta            resource.Interface    `json:"meta"`
	Stake           *string               `json:"stake"`
	Commission      uint64                `json:"commission"`
	Part            *string               `json:"part"`
	Uptime          *float64              `json:"uptime"`
	CountDelegators *uint64               `json:"count_delegators"`
	DelegatorCount  *int                  `json:"delegator_count,omitempty"`
	DelegatorList   *[]resource.Interface `json:"delegator_list,omitempty"`
	CreatedAt       string                `json:"created_at"`
}

func (Resource) Transform

Required extra params: object type of Params.

type ResourceAggregator

type ResourceAggregator struct {
	PublicKey       string             `json:"public_key"`
	Stake           *string            `json:"stake"`
	Part            *string            `json:"part"`
	Uptime          *float64           `json:"uptime"`
	Commission      uint64             `json:"commission"`
	Status          *uint8             `json:"status"`
	CreatedAt       string             `json:"created_at"`
	CountDelegators *uint64            `json:"count_delegators"`
	Meta            resource.Interface `json:"meta"`
}

func (ResourceAggregator) Transform

type ResourceWithValidators

type ResourceWithValidators struct {
	PublicKey   string `json:"public_key"`
	Name        string `json:"name"`
	SiteUrl     string `json:"site_url"`
	IconUrl     string `json:"icon_url"`
	Description string `json:"description"`
}

func (ResourceWithValidators) Transform

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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