view

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const VALIDATOR_ACTIVITIES_TABLE_NAME = "view_validator_activities_total"
View Source
const VALIDATOR_BLOCK_COMMITMENTS_TABLE_NAME = "view_validator_block_commitments_total"

Variables

This section is empty.

Functions

This section is empty.

Types

type CountFilter

type CountFilter struct {
	MaybeStatus []string
}

type ListValidatorBlockCommitmentRow

type ListValidatorBlockCommitmentRow struct {
	ValidatorBlockCommitmentRow

	Moniker string `json:"moniker"`
}

type ListValidatorRow

type ListValidatorRow struct {
	ValidatorRow

	PowerPercentage           string `json:"powerPercentage"`
	CumulativePowerPercentage string `json:"cumulativePowerPercentage"`
}

type MockValidatorActivitiesTotalView added in v1.6.5

type MockValidatorActivitiesTotalView struct {
	mock.Mock
}

func (*MockValidatorActivitiesTotalView) DecrementAll added in v1.6.5

func (view *MockValidatorActivitiesTotalView) DecrementAll(identities []string, total int64) error

func (*MockValidatorActivitiesTotalView) FindBy added in v1.6.5

func (view *MockValidatorActivitiesTotalView) FindBy(identity string) (int64, error)

func (*MockValidatorActivitiesTotalView) Increment added in v1.6.5

func (view *MockValidatorActivitiesTotalView) Increment(identity string, total int64) error

func (*MockValidatorActivitiesTotalView) IncrementAll added in v1.6.5

func (view *MockValidatorActivitiesTotalView) IncrementAll(identities []string, total int64) error

func (*MockValidatorActivitiesTotalView) Set added in v1.6.5

func (view *MockValidatorActivitiesTotalView) Set(identity string, total int64) error

func (*MockValidatorActivitiesTotalView) SumBy added in v1.6.5

func (view *MockValidatorActivitiesTotalView) SumBy(identities []string) (int64, error)

type MockValidatorActivitiesView added in v1.6.5

type MockValidatorActivitiesView struct {
	mock.Mock
}

func (*MockValidatorActivitiesView) Insert added in v1.6.5

func (validatorActivitiesView *MockValidatorActivitiesView) Insert(validatorActivity *ValidatorActivityRow) error

func (*MockValidatorActivitiesView) InsertAll added in v1.6.5

func (validatorActivitiesView *MockValidatorActivitiesView) InsertAll(validatorActivities []ValidatorActivityRow) error

func (*MockValidatorActivitiesView) List added in v1.6.5

type MockValidatorBlockCommitmentsTotalView added in v1.6.5

type MockValidatorBlockCommitmentsTotalView struct {
	mock.Mock
}

func (*MockValidatorBlockCommitmentsTotalView) DecrementAll added in v1.6.5

func (view *MockValidatorBlockCommitmentsTotalView) DecrementAll(identities []string, total int64) error

func (*MockValidatorBlockCommitmentsTotalView) FindBy added in v1.6.5

func (view *MockValidatorBlockCommitmentsTotalView) FindBy(identity string) (int64, error)

func (*MockValidatorBlockCommitmentsTotalView) Increment added in v1.6.5

func (view *MockValidatorBlockCommitmentsTotalView) Increment(identity string, total int64) error

func (*MockValidatorBlockCommitmentsTotalView) IncrementAll added in v1.6.5

func (view *MockValidatorBlockCommitmentsTotalView) IncrementAll(identities []string, total int64) error

func (*MockValidatorBlockCommitmentsTotalView) Set added in v1.6.5

func (view *MockValidatorBlockCommitmentsTotalView) Set(identity string, total int64) error

func (*MockValidatorBlockCommitmentsTotalView) SumBy added in v1.6.5

func (view *MockValidatorBlockCommitmentsTotalView) SumBy(identities []string) (int64, error)

type MockValidatorBlockCommitmentsView added in v1.6.5

type MockValidatorBlockCommitmentsView struct {
	mock.Mock
}

func (*MockValidatorBlockCommitmentsView) Insert added in v1.6.5

func (commitmentsView *MockValidatorBlockCommitmentsView) Insert(commitment ValidatorBlockCommitmentRow) error

func (*MockValidatorBlockCommitmentsView) InsertAll added in v1.6.5

func (commitmentsView *MockValidatorBlockCommitmentsView) InsertAll(commitments []ValidatorBlockCommitmentRow) error

func (*MockValidatorBlockCommitmentsView) List added in v1.6.5

type MockValidatorsView added in v1.6.5

type MockValidatorsView struct {
	mock.Mock
}

func (*MockValidatorsView) Count added in v1.6.5

func (validatorsView *MockValidatorsView) Count(filter CountFilter) (int64, error)

func (*MockValidatorsView) FindBy added in v1.6.5

func (validatorsView *MockValidatorsView) FindBy(identity ValidatorIdentity) (*ValidatorRow, error)

func (*MockValidatorsView) Insert added in v1.6.5

func (validatorsView *MockValidatorsView) Insert(validator *ValidatorRow) error

func (*MockValidatorsView) LastJoinedBlockHeight added in v1.6.5

func (validatorsView *MockValidatorsView) LastJoinedBlockHeight(
	operatorAddress string,
	consensusNodeAddress string,
) (bool, int64, error)

func (*MockValidatorsView) List added in v1.6.5

func (*MockValidatorsView) ListAll added in v1.6.5

func (validatorsView *MockValidatorsView) ListAll(filter ValidatorsListFilter, order ValidatorsListOrder) ([]ValidatorRow, error)

func (*MockValidatorsView) Search added in v1.6.5

func (validatorsView *MockValidatorsView) Search(keyword string) ([]ValidatorRow, error)

func (*MockValidatorsView) Update added in v1.6.5

func (validatorsView *MockValidatorsView) Update(validator *ValidatorRow) error

func (*MockValidatorsView) UpdateAllValidatorUpTime added in v1.6.5

func (validatorsView *MockValidatorsView) UpdateAllValidatorUpTime(validators []ValidatorRow) error

func (*MockValidatorsView) Upsert added in v1.6.5

func (validatorsView *MockValidatorsView) Upsert(validator *ValidatorRow) error

type ValidatorActivities

type ValidatorActivities interface {
	Insert(validatorActivity *ValidatorActivityRow) error
	InsertAll(validatorActivities []ValidatorActivityRow) error
	List(
		filter ValidatorActivitiesListFilter,
		order ValidatorActivitiesListOrder,
		pagination *pagination_interface.Pagination,
	) ([]ValidatorActivityRow, *pagination_interface.PaginationResult, error)
}

func NewMockValidatorActivitiesView added in v1.6.5

func NewMockValidatorActivitiesView(_ *rdb.Handle) ValidatorActivities

func NewValidatorActivitiesView added in v1.6.5

func NewValidatorActivitiesView(handle *rdb.Handle) ValidatorActivities

type ValidatorActivitiesListFilter

type ValidatorActivitiesListFilter struct {
	MaybeOperatorAddress      *string
	MaybeConsensusNodeAddress *string
	MaybeAfterBlockTime       *utctime.UTCTime
}

type ValidatorActivitiesListOrder

type ValidatorActivitiesListOrder struct {
	MaybeBlockHeight *view.ORDER
}

type ValidatorActivitiesTotal

type ValidatorActivitiesTotal interface {
	Set(string, int64) error
	Increment(string, int64) error
	IncrementAll([]string, int64) error
	DecrementAll([]string, int64) error
	FindBy(string) (int64, error)
	SumBy([]string) (int64, error)
}

func NewMockValidatorActivitiesTotalView added in v1.6.5

func NewMockValidatorActivitiesTotalView(_ *rdb.Handle) ValidatorActivitiesTotal

func NewValidatorActivitiesTotalView added in v1.6.5

func NewValidatorActivitiesTotalView(rdbHandle *rdb.Handle) ValidatorActivitiesTotal

type ValidatorActivitiesTotalView added in v1.6.5

type ValidatorActivitiesTotalView struct {
	*view.Total
}

type ValidatorActivitiesView added in v1.6.5

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

BlockEvents projection view implemented by relational database

func (*ValidatorActivitiesView) Insert added in v1.6.5

func (validatorActivitiesView *ValidatorActivitiesView) Insert(validatorActivity *ValidatorActivityRow) error

func (*ValidatorActivitiesView) InsertAll added in v1.6.5

func (validatorActivitiesView *ValidatorActivitiesView) InsertAll(validatorActivities []ValidatorActivityRow) error

func (*ValidatorActivitiesView) List added in v1.6.5

type ValidatorActivityRow

type ValidatorActivityRow struct {
	BlockHeight          int64                    `json:"blockHeight"`
	BlockTime            utctime.UTCTime          `json:"blockTime"`
	BlockHash            string                   `json:"blockHash"`
	MaybeTransactionHash *string                  `json:"transactionHash"`
	OperatorAddress      string                   `json:"operatorAddress"`
	Success              bool                     `json:"success"`
	Data                 ValidatorActivityRowData `json:"activity"`
}

type ValidatorActivityRowData

type ValidatorActivityRowData struct {
	Type    string      `json:"type"`
	Content interface{} `json:"content"`
}

type ValidatorBlockCommitmentRow

type ValidatorBlockCommitmentRow struct {
	MaybeId              *int64          `json:"-"`
	ConsensusNodeAddress string          `json:"consensusNodeAddress"`
	BlockHeight          int64           `json:"blockHeight"`
	IsProposer           bool            `json:"isProposer"`
	Signature            string          `json:"signature"`
	Timestamp            utctime.UTCTime `json:"timestamp"`
}

type ValidatorBlockCommitments

type ValidatorBlockCommitments interface {
	InsertAll(commitments []ValidatorBlockCommitmentRow) error
	Insert(commitment ValidatorBlockCommitmentRow) error
	List(
		filter ValidatorBlockCommitmentsListFilter,
		pagination *pagination_interface.Pagination,
	) ([]ListValidatorBlockCommitmentRow, *pagination.PaginationResult, error)
}

func NewMockValidatorBlockCommitmentsView added in v1.6.5

func NewMockValidatorBlockCommitmentsView(_ *rdb.Handle) ValidatorBlockCommitments

func NewValidatorBlockCommitments

func NewValidatorBlockCommitments(handle *rdb.Handle) ValidatorBlockCommitments

type ValidatorBlockCommitmentsListFilter

type ValidatorBlockCommitmentsListFilter struct {
	MaybeBlockHeight                   *int64
	MaybeGreaterThanEqualToBlockHeight *int64 // TODO
	MaybeConsensusNodeAddress          *string
}

type ValidatorBlockCommitmentsTotal

type ValidatorBlockCommitmentsTotal interface {
	Set(string, int64) error
	Increment(string, int64) error
	IncrementAll([]string, int64) error
	DecrementAll([]string, int64) error
	FindBy(string) (int64, error)
	SumBy([]string) (int64, error)
}

func NewMockValidatorBlockCommitmentsTotal added in v1.6.5

func NewMockValidatorBlockCommitmentsTotal(_ *rdb.Handle) ValidatorBlockCommitmentsTotal

func NewValidatorBlockCommitmentsTotal

func NewValidatorBlockCommitmentsTotal(rdbHandle *rdb.Handle) ValidatorBlockCommitmentsTotal

type ValidatorBlockCommitmentsTotalView added in v1.6.5

type ValidatorBlockCommitmentsTotalView struct {
	*view.Total
}

type ValidatorBlockCommitmentsView added in v1.6.5

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

func (*ValidatorBlockCommitmentsView) Insert added in v1.6.5

func (commitmentsView *ValidatorBlockCommitmentsView) Insert(commitment ValidatorBlockCommitmentRow) error

func (*ValidatorBlockCommitmentsView) InsertAll added in v1.6.5

func (commitmentsView *ValidatorBlockCommitmentsView) InsertAll(commitments []ValidatorBlockCommitmentRow) error

func (*ValidatorBlockCommitmentsView) List added in v1.6.5

type ValidatorIdentity

type ValidatorIdentity struct {
	MaybeConsensusNodeAddress    *string
	MaybeOperatorAddress         *string
	MaybeInitialDelegatorAddress *string
}

type ValidatorRow

type ValidatorRow struct {
	MaybeId                 *int64     `json:"-"`
	OperatorAddress         string     `json:"operatorAddress"`
	ConsensusNodeAddress    string     `json:"consensusNodeAddress"`
	InitialDelegatorAddress string     `json:"initialDelegatorAddress"`
	TendermintPubkey        string     `json:"tendermintPubkey"`
	TendermintAddress       string     `json:"tendermintAddress"`
	Status                  string     `json:"status"`
	Jailed                  bool       `json:"jailed"`
	JoinedAtBlockHeight     int64      `json:"joinedAtBlockHeight"`
	Power                   string     `json:"power"`
	Moniker                 string     `json:"moniker"`
	Identity                string     `json:"identity"`
	Website                 string     `json:"website"`
	SecurityContact         string     `json:"securityContact"`
	Details                 string     `json:"details"`
	CommissionRate          string     `json:"commissionRate"`
	CommissionMaxRate       string     `json:"commissionMaxRate"`
	CommissionMaxChangeRate string     `json:"commissionMaxChangeRate"`
	MinSelfDelegation       string     `json:"minSelfDelegation"`
	TotalSignedBlock        int64      `json:"totalSignedBlock"`
	TotalActiveBlock        int64      `json:"totalActiveBlock"`
	ImpreciseUpTime         *big.Float `json:"impreciseUpTime"`
	VotedGovProposal        *big.Int   `json:"votedGovProposal"`
}

type Validators

type Validators interface {
	LastJoinedBlockHeight(
		operatorAddress string,
		consensusNodeAddress string,
	) (bool, int64, error)
	Upsert(validator *ValidatorRow) error
	Insert(validator *ValidatorRow) error

	Search(keyword string) ([]ValidatorRow, error)
	FindBy(identity ValidatorIdentity) (*ValidatorRow, error)
	Update(validator *ValidatorRow) error
	UpdateAllValidatorUpTime(validators []ValidatorRow) error
	ListAll(
		filter ValidatorsListFilter,
		order ValidatorsListOrder) ([]ValidatorRow, error)
	List(
		filter ValidatorsListFilter,
		order ValidatorsListOrder,
		pagination *pagination_interface.Pagination) ([]ListValidatorRow, *pagination.PaginationResult, error)
	Count(filter CountFilter) (int64, error)
	// contains filtered or unexported methods
}

func NewMockValidatorsView added in v1.6.5

func NewMockValidatorsView(_ *rdb.Handle) Validators

func NewValidatorsView added in v1.6.5

func NewValidatorsView(handle *rdb.Handle) Validators

type ValidatorsListFilter

type ValidatorsListFilter struct {
	MaybeStatuses []constants.Status
}

type ValidatorsListOrder

type ValidatorsListOrder struct {
	MaybeStatus              *view.ORDER
	MaybePower               *view.ORDER
	MaybeCommission          *view.ORDER
	MaybeJoinedAtBlockHeight *view.ORDER
	MaybeImpreciseUpTime     *view.ORDER
}

type ValidatorsView added in v1.6.5

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

func (*ValidatorsView) Count added in v1.6.5

func (validatorsView *ValidatorsView) Count(filter CountFilter) (int64, error)

func (*ValidatorsView) FindBy added in v1.6.5

func (validatorsView *ValidatorsView) FindBy(identity ValidatorIdentity) (*ValidatorRow, error)

func (*ValidatorsView) Insert added in v1.6.5

func (validatorsView *ValidatorsView) Insert(validator *ValidatorRow) error

func (*ValidatorsView) LastJoinedBlockHeight added in v1.6.5

func (validatorsView *ValidatorsView) LastJoinedBlockHeight(
	operatorAddress string,
	consensusNodeAddress string,
) (bool, int64, error)

func (*ValidatorsView) List added in v1.6.5

func (*ValidatorsView) ListAll added in v1.6.5

func (validatorsView *ValidatorsView) ListAll(
	filter ValidatorsListFilter,
	order ValidatorsListOrder,
) ([]ValidatorRow, error)

func (*ValidatorsView) Search added in v1.6.5

func (validatorsView *ValidatorsView) Search(keyword string) ([]ValidatorRow, error)

func (*ValidatorsView) Update added in v1.6.5

func (validatorsView *ValidatorsView) Update(validator *ValidatorRow) error

func (*ValidatorsView) UpdateAllValidatorUpTime added in v1.6.5

func (validatorsView *ValidatorsView) UpdateAllValidatorUpTime(validators []ValidatorRow) error

func (*ValidatorsView) Upsert added in v1.6.5

func (validatorsView *ValidatorsView) Upsert(validator *ValidatorRow) error

Jump to

Keyboard shortcuts

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