types

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: CC0-1.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDBSignatures

func NewDBSignatures(signaturesList []types.TxSignatures) []string

NewDBSignatures returns signatures in string array

func ToNullString

func ToNullString(value string) sql.NullString

func ToString

func ToString(value sql.NullString) string

Types

type BlockRow

type BlockRow struct {
	Height          int64          `db:"height"`
	Hash            string         `db:"hash"`
	TxNum           int64          `db:"num_txs"`
	TotalGas        int64          `db:"total_gas"`
	ProposerAddress sql.NullString `db:"proposer_address"`
	PreCommitsNum   int64          `db:"pre_commits"`
	Timestamp       time.Time      `db:"timestamp"`
}

BlockRow represents a single block row stored inside the database

type DbCoin

type DbCoin struct {
	Denom  string
	Amount string
}

DbCoin represents the information stored inside the database about a single coin

func NewDbCoin

func NewDbCoin(coin sdk.Coin) DbCoin

NewDbCoin builds a DbCoin starting from an SDK Coin

func (*DbCoin) Value

func (coin *DbCoin) Value() (driver.Value, error)

Value implements driver.Value

type DbCoins

type DbCoins []*DbCoin

DbCoins represents an array of coins

func NewDbCoins

func NewDbCoins(coins sdk.Coins) DbCoins

NewDbCoins build a new DbCoins object starting from an array of coins

type GenesisRow

type GenesisRow struct {
	OneRowID      bool      `db:"one_row_id"`
	ChainID       string    `db:"chain_id"`
	Time          time.Time `db:"time"`
	InitialHeight int64     `db:"initial_height"`
}

GenesisRow represents a single genesis row stored inside the database

func NewGenesisRow

func NewGenesisRow(chainID string, time time.Time, initialHeight int64) GenesisRow

NewGenesisRow allows to create new GenesisRow instance

func (GenesisRow) Equal

func (v GenesisRow) Equal(w GenesisRow) bool

Equal tells whether v and w represent the same rows

type TokenPriceRow

type TokenPriceRow struct {
	ID        string    `db:"id"`
	Name      string    `db:"unit_name"`
	Price     float64   `db:"price"`
	MarketCap int64     `db:"market_cap"`
	Timestamp time.Time `db:"timestamp"`
}

TokenPriceRow represent a row of the table token_price in the database

func NewTokenPriceRow

func NewTokenPriceRow(name string, currentPrice float64, marketCap int64, timestamp time.Time) TokenPriceRow

NewTokenPriceRow allows to easily create a new NewTokenPriceRow

func (TokenPriceRow) Equals

func (u TokenPriceRow) Equals(v TokenPriceRow) bool

Equals return true if u and v represent the same row

type TokenRow

type TokenRow struct {
	Name       string `db:"name"`
	TradedUnit string `db:"traded_unit"`
}

TokenUnitRow represents a single token row stored inside the database

type TokenUnitRow

type TokenUnitRow struct {
	TokenName string         `db:"token_name"`
	Denom     string         `db:"denom"`
	Exponent  int            `db:"exponent"`
	Aliases   pq.StringArray `db:"aliases"`
	PriceID   sql.NullString `db:"price_id"`
}

TokenUnitRow represents a single token unit row stored inside the database

type ValidatorCommissionRow

type ValidatorCommissionRow struct {
	OperatorAddress     string         `db:"validator_address"`
	SelfDelegateAddress string         `db:"self_delegate_address"`
	Commission          string         `db:"commission"`
	MinSelfDelegation   sql.NullString `db:"min_self_delegation"`
	Height              int64          `db:"height"`
}

ValidatorCommissionRow represents a single row of the validator_commission database table

func NewValidatorCommissionRow

func NewValidatorCommissionRow(
	operatorAddress, selfDelegateAddress, commission, minSelfDelegation string, height int64,
) ValidatorCommissionRow

NewValidatorCommissionRow allows to build new ValidatorCommissionRow instance

func (ValidatorCommissionRow) Equal

Equal tells whether v and w represent the same rows

type ValidatorDescriptionRow

type ValidatorDescriptionRow struct {
	ValAddress          string         `db:"validator_address"`
	SelfDelegateAddress string         `db:"self_delegate_address"`
	Moniker             sql.NullString `db:"moniker"`
	Identity            sql.NullString `db:"identity"`
	Details             sql.NullString `db:"details"`
	Height              int64          `db:"height"`
}

ValidatorDescriptionRow represent a single row in validator_description database table.

func NewValidatorDescriptionRow

func NewValidatorDescriptionRow(
	valAddress, selfDelegateAddress, moniker, identity, details string, height int64,
) ValidatorDescriptionRow

NewValidatorDescriptionRow allows to build new ValidatorDescriptionRow instance

func (ValidatorDescriptionRow) Equal

Equal tells whether v and w represent the same rows

type ValidatorStatusRow

type ValidatorStatusRow struct {
	ConsAddress         string `db:"validator_address"`
	SelfDelegateAddress string `db:"self_delegate_address"`
	InActiveSet         string `db:"in_active_set"`
	Jailed              string `db:"jailed"`
	Tombstoned          string `db:"tombstoned"`
	Height              int64  `db:"height"`
}

ValidatorStatusRow represents a single row of the validator_status table

func NewValidatorStatusRow

func NewValidatorStatusRow(consAddess, selfDelegateAddress, inActiveSet, jailed, tombstoned string, height int64) ValidatorStatusRow

NewValidatorStatusRow builds a new ValidatorStatusRow

func (ValidatorStatusRow) Equal

Equal tells whether v and w contain the same data

Jump to

Keyboard shortcuts

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