model

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountAgg

type AccountAgg struct {
	*Model
	*Aggregate

	PublicKey                        string         `json:"public_key"`
	RecentGeneralBalance             types.Quantity `json:"recent_general_balance"`
	RecentGeneralNonce               uint64         `json:"recent_general_nonce"`
	RecentEscrowActiveBalance        types.Quantity `json:"recent_escrow_active_balance"`
	RecentEscrowActiveTotalShares    types.Quantity `json:"recent_escrow_active_total_shares"`
	RecentEscrowDebondingBalance     types.Quantity `json:"recent_escrow_debonding_balance"`
	RecentEscrowDebondingTotalShares types.Quantity `json:"recent_escrow_debonding_total_shares"`
}

func (*AccountAgg) Equal

func (aa *AccountAgg) Equal(m AccountAgg) bool

func (AccountAgg) TableName

func (AccountAgg) TableName() string

- METHODS

func (*AccountAgg) UpdateAggAttrs

func (aa *AccountAgg) UpdateAggAttrs(u *AccountAgg)

func (*AccountAgg) Valid

func (aa *AccountAgg) Valid() bool

type Aggregate

type Aggregate struct {
	StartedAtHeight int64      `json:"started_at_height"`
	StartedAt       types.Time `json:"started_at"`
	RecentAtHeight  int64      `json:"recent_at_height"`
	RecentAt        types.Time `json:"recent_at"`
}

func (*Aggregate) Equal

func (a *Aggregate) Equal(m Aggregate) bool

func (*Aggregate) Valid

func (a *Aggregate) Valid() bool

type BlockSeq

type BlockSeq struct {
	*Model
	*Sequence

	// Indexed data
	Hash              string `json:"hash"`
	ProposerEntityUID string `json:"proposer_entity_uid"`
	AppVersion        int64  `json:"app_version"`
	BlockVersion      int64  `json:"block_version"`
	TransactionsCount int64  `json:"transactions_count"`
}

func (*BlockSeq) Equal

func (b *BlockSeq) Equal(m BlockSeq) bool

func (BlockSeq) TableName

func (BlockSeq) TableName() string

- METHODS

func (*BlockSeq) Valid

func (b *BlockSeq) Valid() bool

type Chain

type Chain struct {
	Id          string      `json:"id"`
	Name        string      `json:"name"`
	GenesisTime *types.Time `json:"genesis_time"`
	Height      int64       `json:"height"`
}

type DebondingDelegationSeq

type DebondingDelegationSeq struct {
	*Model
	*Sequence

	ValidatorUID string         `json:"validator_uid"`
	DelegatorUID string         `json:"delegator_uid"`
	Shares       types.Quantity `json:"shares"`
	DebondEnd    uint64         `json:"debond_end"`
}

func (*DebondingDelegationSeq) Equal

func (DebondingDelegationSeq) TableName

func (DebondingDelegationSeq) TableName() string

- METHODS

func (*DebondingDelegationSeq) Valid

func (d *DebondingDelegationSeq) Valid() bool

type DelegationSeq

type DelegationSeq struct {
	*Model
	*Sequence

	ValidatorUID string         `json:"validator_uid"`
	DelegatorUID string         `json:"delegator_uid"`
	Shares       types.Quantity `json:"shares"`
}

func (*DelegationSeq) Equal

func (d *DelegationSeq) Equal(m DelegationSeq) bool

func (DelegationSeq) TableName

func (DelegationSeq) TableName() string

- METHODS

func (*DelegationSeq) Valid

func (d *DelegationSeq) Valid() bool

type Model

type Model struct {
	ID        types.ID   `json:"id"`
	CreatedAt types.Time `json:"created_at"`
	UpdatedAt types.Time `json:"updated_at"`
}

func (*Model) Equal

func (e *Model) Equal(m Model) bool

func (*Model) Valid

func (e *Model) Valid() bool

type Report

type Report struct {
	*Model

	StartHeight  int64
	EndHeight    int64
	SuccessCount *int64
	ErrorCount   *int64
	ErrorMsg     *string
	Duration     time.Duration
	Details      types.Jsonb
	CompletedAt  *types.Time
}

func (*Report) Complete

func (r *Report) Complete(successCount int64, errorCount int64, err error)

func (*Report) Equal

func (r *Report) Equal(m Report) bool

func (Report) TableName

func (Report) TableName() string

- METHODS

func (*Report) Valid

func (r *Report) Valid() bool

type Sequence

type Sequence struct {
	Height int64      `json:"height"`
	Time   types.Time `json:"time"`
}

func (*Sequence) Equal

func (s *Sequence) Equal(m Sequence) bool

func (*Sequence) Valid

func (s *Sequence) Valid() bool

type StakingSeq

type StakingSeq struct {
	*Model
	*Sequence

	TotalSupply         types.Quantity `json:"total_supply"`
	CommonPool          types.Quantity `json:"common_pool"`
	DebondingInterval   uint64         `json:"debonding_interval"`
	MinDelegationAmount types.Quantity `json:"min_delegation_amount"`
}

func (*StakingSeq) Equal

func (ss *StakingSeq) Equal(m StakingSeq) bool

func (StakingSeq) TableName

func (StakingSeq) TableName() string

- Methods

func (*StakingSeq) Valid

func (ss *StakingSeq) Valid() bool

type Syncable

type Syncable struct {
	*Model

	Height       int64          `json:"height"`
	Time         types.Time     `json:"time"`
	AppVersion   uint64         `json:"app_version"`
	BlockVersion uint64         `json:"block_version"`
	Status       SyncableStatus `json:"status"`
	ReportID     types.ID       `json:"report_id"`
	StartedAt    types.Time     `json:"started_at"`
	ProcessedAt  *types.Time    `json:"processed_at"`
	Duration     time.Duration  `json:"duration"`
	Details      types.Jsonb    `json:"details"`
}

func (*Syncable) Equal

func (s *Syncable) Equal(m Syncable) bool

func (*Syncable) MarkProcessed

func (s *Syncable) MarkProcessed()

func (*Syncable) SetStatus

func (s *Syncable) SetStatus(newStatus SyncableStatus)

func (Syncable) TableName

func (Syncable) TableName() string

- Methods

func (*Syncable) Valid

func (s *Syncable) Valid() bool

type SyncableStatus

type SyncableStatus int
const (
	SyncableStatusRunning SyncableStatus = iota
	SyncableStatusCompleted
)

type TransactionSeq

type TransactionSeq struct {
	*Model
	*Sequence

	PublicKey string         `json:"public_key"`
	Hash      string         `json:"hash"`
	Nonce     uint64         `json:"nonce"`
	Fee       types.Quantity `json:"fee"`
	GasLimit  uint64         `json:"gas_limit"`
	GasPrice  types.Quantity `json:"gas_price"`
	Method    string         `json:"method"`
}

func (*TransactionSeq) Equal

func (ts *TransactionSeq) Equal(m TransactionSeq) bool

func (TransactionSeq) TableName

func (TransactionSeq) TableName() string

- Methods

func (*TransactionSeq) Valid

func (ts *TransactionSeq) Valid() bool

type ValidatorAgg

type ValidatorAgg struct {
	*Model
	*Aggregate

	EntityUID                string         `json:"entity_uid"`
	RecentAddress            string         `json:"recent_address"`
	RecentVotingPower        int64          `json:"recent_voting_power"`
	RecentTotalShares        types.Quantity `json:"recent_total_shares"`
	RecentAsValidatorHeight  int64          `json:"recent_as_validator_height"`
	RecentProposedHeight     int64          `json:"recent_proposed_height"`
	AccumulatedProposedCount int64          `json:"accumulated_proposed_count"`
	AccumulatedUptime        int64          `json:"accumulated_uptime"`
	AccumulatedUptimeCount   int64          `json:"accumulated_uptime_count"`
}

func (*ValidatorAgg) Equal

func (aa *ValidatorAgg) Equal(m ValidatorAgg) bool

func (ValidatorAgg) TableName

func (ValidatorAgg) TableName() string

- METHODS

func (*ValidatorAgg) UpdateAggAttrs

func (aa *ValidatorAgg) UpdateAggAttrs(entity ValidatorAgg)

func (*ValidatorAgg) Valid

func (aa *ValidatorAgg) Valid() bool

type ValidatorSeq

type ValidatorSeq struct {
	*Model
	*Sequence

	EntityUID    string         `json:"entity_uid"`
	NodeUID      string         `json:"node_uid"`
	ConsensusUID string         `json:"consensus_uid"`
	Address      string         `json:"address"`
	Proposed     bool           `json:"proposed"`
	VotingPower  int64          `json:"voting_power"`
	TotalShares  types.Quantity `json:"total_shares"`
	// When precommit_validated is null it means that validator did not have chance to validate the block
	PrecommitValidated   *bool `json:"precommit_validated"`
	PrecommitBlockIDFlag int64 `json:"precommit_block_id_flag"`
	PrecommitIndex       int64 `json:"precommit_index"`
}

func (*ValidatorSeq) Equal

func (vs *ValidatorSeq) Equal(m ValidatorSeq) bool

func (ValidatorSeq) TableName

func (ValidatorSeq) TableName() string

- Methods

func (*ValidatorSeq) Valid

func (vs *ValidatorSeq) Valid() bool

Jump to

Keyboard shortcuts

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