validator

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidFile = errors.New("unexpected file format")
	ErrMissingFile = errors.New("missing file path")
)
View Source
var (
	ErrInvalidIntervalPeriod = errors.New("invalid interval and/or period")
)

Functions

func NewDecorateUseCase added in v0.5.0

func NewDecorateUseCase(cfg *config.Config, db DecorateStore) *decorateUseCase

NewDecorateUseCase decorate validators based on file data. It parses a csv file containing logos, entity names and entity addresses for a validator, then updates the logo_url and entity_name for each entry

func NewGetByAddressHttpHandler added in v0.4.2

func NewGetByAddressHttpHandler(db *store.Store, c *client.Client) *getByAddressHttpHandler

func NewGetByAddressUseCase added in v0.4.2

func NewGetByAddressUseCase(db *store.Store) *getByAddressUseCase

func NewGetByHeightHttpHandler

func NewGetByHeightHttpHandler(cfg *config.Config, db *store.Store, c *client.Client) *getByHeightHttpHandler

func NewGetByHeightUseCase

func NewGetByHeightUseCase(cfg *config.Config, db *store.Store, client *client.Client) *getByHeightUseCase

func NewGetForMinHeightHttpHandler

func NewGetForMinHeightHttpHandler(db *store.Store, c *client.Client) *getForMinHeightHttpHandler

func NewGetForMinHeightUseCase

func NewGetForMinHeightUseCase(db *store.Store) *getForMinHeightUseCase

func NewGetSummaryHttpHandler added in v0.4.0

func NewGetSummaryHttpHandler(db *store.Store, c *client.Client) *getSummaryHttpHandler

func NewGetSummaryUseCase added in v0.4.0

func NewGetSummaryUseCase(db *store.Store) *getSummaryUseCase

Types

type AggDetailsView

type AggDetailsView struct {
	*model.Model
	*model.Aggregate

	Address                   string         `json:"address"`
	EntityUID                 string         `json:"entity_uid"`
	RecentTendermintAddress   string         `json:"recent_tendermint_address"`
	RecentVotingPower         int64          `json:"recent_voting_power"`
	RecentTotalShares         types.Quantity `json:"recent_total_shares"`
	RecentActiveEscrowBalance types.Quantity `json:"recent_active_escrow_balance"`
	RecentCommission          types.Quantity `json:"recent_commission"`
	RecentAsValidatorHeight   int64          `json:"recent_as_validator_height"`
	RecentProposedHeight      int64          `json:"recent_proposed_height"`
	AccumulatedProposedCount  int64          `json:"accumulated_proposed_count"`
	Uptime                    float64        `json:"uptime"`
	LogoURL                   string         `json:"logo_url"`
	EntityName                string         `json:"entity_name"`

	LastSequences []model.ValidatorSeq `json:"last_sequences"`
}

func ToAggDetailsView

func ToAggDetailsView(m *model.ValidatorAgg, sequences []model.ValidatorSeq) *AggDetailsView

type AggListView

type AggListView struct {
	Items []model.ValidatorAgg `json:"items"`
}

func ToAggListView

func ToAggListView(ms []model.ValidatorAgg) *AggListView

type DecorateCmdHandler added in v0.5.0

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

func NewDecorateCmdHandler added in v0.5.0

func NewDecorateCmdHandler(cfg *config.Config, db *store.Store, c *client.Client) *DecorateCmdHandler

func (*DecorateCmdHandler) Handle added in v0.5.0

func (h *DecorateCmdHandler) Handle(ctx context.Context, filePath string)

type DecorateStore added in v0.5.0

type DecorateStore interface {
	CreateOrUpdate(val *model.ValidatorAgg) error
	FindByAddress(address string) (*model.ValidatorAgg, error)
}

type GetByEntityUidRequest

type GetByEntityUidRequest struct {
	Address        string `uri:"address" binding:"required"`
	SequencesLimit int64  `form:"sequences_limit" binding:"-"`
}

type GetByHeightRequest

type GetByHeightRequest struct {
	Height *int64 `form:"height" binding:"-"`
}

type GetForMinHeightRequest

type GetForMinHeightRequest struct {
	Height *int64 `uri:"height" binding:"required"`
}

type GetSummaryRequest added in v0.4.0

type GetSummaryRequest struct {
	Interval types.SummaryInterval `form:"interval" binding:"required"`
	Period   string                `form:"period" binding:"required"`
	Address  string                `form:"address" binding:"-"`
}

type SeqListItem added in v0.4.2

type SeqListItem struct {
	*model.Model
	*model.Sequence

	EntityUID           string         `json:"entity_uid"`
	Address             string         `json:"address"`
	Proposed            bool           `json:"proposed"`
	VotingPower         int64          `json:"voting_power"`
	TotalShares         types.Quantity `json:"total_shares"`
	ActiveEscrowBalance types.Quantity `json:"active_escrow_balance"`
	Commission          types.Quantity `json:"commission"`
	Rewards             types.Quantity `json:"rewards"`
	PrecommitValidated  *bool          `json:"precommit_validated"`
	EntityName          string         `json:"entity_name"`
}

type SeqListView

type SeqListView struct {
	Items []SeqListItem `json:"items"`
}

func ToSeqListView

func ToSeqListView(validatorSeqs []model.ValidatorSeq, validatorAggs []model.ValidatorAgg) SeqListView

Jump to

Keyboard shortcuts

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