validator

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidIntervalPeriod = errors.New("invalid interval and/or period")
)

Functions

func NewGetByHeightHttpHandler

func NewGetByHeightHttpHandler(
	cfg *config.Config,
	cli *client.Client,
	accountDb store.Accounts,
	blockDb store.Blocks,
	databaseDb store.Database,
	eventDb store.Events,
	reportDb store.Reports,
	rewardDb store.Rewards,
	rewardStore *indexer.RewardStore,
	syncableDb store.Syncables,
	systemEventDb store.SystemEvents,
	transactionDb store.Transactions,
	validatorDb store.Validators,
	datastoreClient datastore.DatastoreServiceClient,
) *getByHeightHttpHandler

func NewGetByHeightUseCase

func NewGetByHeightUseCase(
	cfg *config.Config,
	cli *client.Client,
	accountDb store.Accounts,
	blockDb store.Blocks,
	databaseDb store.Database,
	eventDb store.Events,
	reportDb store.Reports,
	rewardDb store.Rewards,
	rewardStore *indexer.RewardStore,
	syncableDb store.Syncables,
	systemEventDb store.SystemEvents,
	transactionDb store.Transactions,
	validatorDb store.Validators,
	datastoreClient datastore.DatastoreServiceClient,
) *getByHeightUseCase

func NewGetByStashAccountHttpHandler

func NewGetByStashAccountHttpHandler(accountEraSeqDb store.AccountEraSeq, validatorDb store.Validators) *getByStashAccountHttpHandler

func NewGetByStashAccountUseCase

func NewGetByStashAccountUseCase(accountEraSeqDb store.AccountEraSeq, validatorDb store.Validators) *getByStashAccountUseCase

func NewGetForMinHeightHttpHandler

func NewGetForMinHeightHttpHandler(syncablesDb store.Syncables, validatorAggDb store.ValidatorAgg) *getForMinHeightHttpHandler

func NewGetForMinHeightUseCase

func NewGetForMinHeightUseCase(syncablesDb store.Syncables, validatorAggDb store.ValidatorAgg) *getForMinHeightUseCase

func NewGetSummaryHttpHandler

func NewGetSummaryHttpHandler(syncablesDb store.Syncables, validatorSummaryDb store.ValidatorSummary) *getSummaryHttpHandler

func NewGetSummaryUseCase

func NewGetSummaryUseCase(syncablesDb store.Syncables, validatorSummaryDb store.ValidatorSummary) *getSummaryUseCase

Types

type AggDetailsView

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

	StashAccount            string  `json:"stash_account"`
	RecentAsValidatorHeight int64   `json:"recent_as_validator_height"`
	DisplayName             string  `json:"display_name"`
	Uptime                  float64 `json:"uptime"`

	LastSessionSequences []model.ValidatorSessionSeq `json:"last_session_sequences"`
	LastEraSequences     []model.ValidatorEraSeq     `json:"last_era_sequences"`
	LastDelegations      []*common.Delegation        `json:"delegations"`
}

swagger:response ValidatorAggregateView

func ToAggDetailsView

func ToAggDetailsView(m *model.ValidatorAgg, sessionSequences []model.ValidatorSessionSeq, eraSequences []model.ValidatorEraSeq, accountEraSequences []model.AccountEraSeq) *AggDetailsView

type AggListView

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

swagger:response ValidatorAggregatesView

func ToAggListView

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

type EraSeqListItem

type EraSeqListItem struct {
	*model.EraSequence

	StashAccount      string         `json:"stash_account"`
	ControllerAccount string         `json:"controller_account"`
	SessionAccounts   pq.StringArray `json:"session_accounts"`
	Index             int64          `json:"index"`
	TotalStake        types.Quantity `json:"total_stake"`
	OwnStake          types.Quantity `json:"own_stake"`
	StakersStake      types.Quantity `json:"stakers_stake"`
	RewardPoints      int64          `json:"reward_points"`
	Commission        int64          `json:"commission"`
	StakersCount      int            `json:"stakers_count"`
}

type GetByEntityUidRequest

type GetByEntityUidRequest struct {
	// StashAccount
	//
	// required: true
	// in: path
	StashAccount string `json:"stash_account" uri:"stash_account" binding:"required"`
	// SessionsLimit
	//
	// in: query
	SessionsLimit int64 `json:"sessions_limit" form:"sessions_limit" binding:"-"`
	// ErasLimit
	//
	// in: query
	ErasLimit int64 `json:"eras_limit" form:"eras_limit" binding:"-"`
}

swagger:parameters getValidatorByStash

type GetByHeightRequest

type GetByHeightRequest struct {
	// Height
	//
	// in: query
	Height *int64 `json:"height" form:"height" binding:"-"`
}

swagger:parameters getValidatorsByHeight

type GetForMinHeightRequest

type GetForMinHeightRequest struct {
	// Height
	//
	// required: true
	// in: query
	Height *int64 `json:"height" uri:"height" binding:"required"`
}

swagger:parameters getValidatorForMinHeight

type GetSummaryRequest

type GetSummaryRequest struct {
	// Interval
	//
	// required: true
	// in: query
	Interval types.SummaryInterval `json:"interval" form:"interval" binding:"required"`
	// Period
	//
	// required: true
	// in: query
	Period string `json:"period" form:"period" binding:"required"`
	// StashAccount
	//
	// required: true
	// in: query
	StashAccount string `json:"stash_account" form:"stash_account" binding:"-"`
}

swagger:parameters getValidatorSummary

type SeqListView

type SeqListView struct {
	SessionItems []SessionSeqListItem `json:"session_items"`
	EraItems     []EraSeqListItem     `json:"era_items"`
}

swagger:response ValidatorsView

func ToSeqListView

func ToSeqListView(validatorSessionSeqs []model.ValidatorSessionSeq, validatorEraSeqs []model.ValidatorEraSeq) SeqListView

type SessionSeqListItem

type SessionSeqListItem struct {
	*model.SessionSequence

	DisplayName  string `json:"display_name"`
	StashAccount string `json:"stash_account"`
	Online       bool   `json:"online"`
}

Jump to

Keyboard shortcuts

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