view

package
v1.7.38 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_LOWEST_ACTIVE_BLOCKS_BLOCK_HEIGHT = int64(0)
	VALIDATORS_TABLE_NAME                     = "view_validators"
)
View Source
const VALIDATOR_ACTIVE_BLOCKS_TABLE_NAME = "view_validator_active_blocks"
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 MockValidatorActiveBlocksView added in v1.6.17

type MockValidatorActiveBlocksView struct {
	mock.Mock
}

func (*MockValidatorActiveBlocksView) ClearValidatorActiveBLocks added in v1.6.17

func (view *MockValidatorActiveBlocksView) ClearValidatorActiveBLocks(operatorAddress string) error

func (*MockValidatorActiveBlocksView) UpdateValidatorsActiveBlocks added in v1.6.17

func (view *MockValidatorActiveBlocksView) UpdateValidatorsActiveBlocks(
	operatorAddressToSignedBlockFlagMap OperatorAddressToSignedBlockFlagMap,
	height int64,
	maxRecentUpTimeInBlocks int64,
) error

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, maybeLowestBlockHeight *int64) (*ValidatorRow, error)

func (*MockValidatorsView) Insert added in v1.6.5

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

func (*MockValidatorsView) LastHandledHeight added in v1.6.8

func (validatorsView *MockValidatorsView) LastHandledHeight() (int64, 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, maybeLowestBlockHeight *int64) ([]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 OperatorAddressToSignedBlockFlagMap added in v1.6.17

type OperatorAddressToSignedBlockFlagMap map[string]bool

type ValidatorActiveBlockCountFilter added in v1.6.17

type ValidatorActiveBlockCountFilter struct {
	MaybeOperatorAddresses []string
}

type ValidatorActiveBlockRow added in v1.6.17

type ValidatorActiveBlockRow struct {
	OperatorAddress string `json:"operatorAddress"`
	BlockHeight     int64  `json:"blockHeight"`
	Signed          bool   `json:"signed"`
}

type ValidatorActiveBlocks added in v1.6.17

type ValidatorActiveBlocks interface {
	UpdateValidatorsActiveBlocks(
		operatorAddressToSignedBlockFlagMap OperatorAddressToSignedBlockFlagMap,
		height int64,
		maxRecentUpTimeInBlocks int64,
	) error
	ClearValidatorActiveBLocks(operatorAddress string) error
}

func NewMockValidatorActiveBlocksView added in v1.6.17

func NewMockValidatorActiveBlocksView(_ *rdb.Handle) ValidatorActiveBlocks

func NewValidatorActiveBlocksView added in v1.6.17

func NewValidatorActiveBlocksView(handle *rdb.Handle) ValidatorActiveBlocks

type ValidatorActiveBlocksView added in v1.6.17

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

ValidatorActiveBlocksView projection view implemented by relational database

func (*ValidatorActiveBlocksView) ClearValidatorActiveBLocks added in v1.6.17

func (validatorActiveBlocksView *ValidatorActiveBlocksView) ClearValidatorActiveBLocks(operatorAddress string) error

func (*ValidatorActiveBlocksView) UpdateValidatorsActiveBlocks added in v1.6.17

func (validatorActiveBlocksView *ValidatorActiveBlocksView) UpdateValidatorsActiveBlocks(
	operatorAddressToSignedBlockFlagMap OperatorAddressToSignedBlockFlagMap,
	height int64,
	maxRecentActiveBlocks int64,
) 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"`
	TotalRecentSignedBlocks int64      `json:"totalRecentSignedBlocks"`
	TotalRecentActiveBlocks int64      `json:"totalRecentActiveBlocks"`
	Attention               bool       `json:"attention"`
}

type Validators

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

	Search(
		keyword string,
		maybeLowestBlockHeight *int64,
	) ([]ValidatorRow, error)
	FindBy(
		identity ValidatorIdentity,
		maybeLowestBlockHeight *int64,
	) (*ValidatorRow, error)
	Update(validator *ValidatorRow) error
	UpdateAllValidatorUpTime([]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)
	LastHandledHeight() (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
	MaybeRecentActiveBlock *ValidatorsListRecentActiveBlockFilter
}

type ValidatorsListOrder

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

type ValidatorsListRecentActiveBlockFilter added in v1.6.18

type ValidatorsListRecentActiveBlockFilter struct {
	MaybeLowestActiveBlockHeight int64
}

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,
	maybeLowestBlockHeight *int64,
) (*ValidatorRow, error)

func (*ValidatorsView) Insert added in v1.6.5

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

func (*ValidatorsView) LastHandledHeight added in v1.6.8

func (validatorsView *ValidatorsView) LastHandledHeight() (int64, 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,
	maybeLowestBlockHeight *int64,
) ([]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