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 BindFlagsLoadViper

func BindFlagsLoadViper(cmd *cobra.Command, _ []string) error

BindFlagsLoadViper binds all flags and read the config into viper

func ConvertValidatorAddressToBech32String

func ConvertValidatorAddressToBech32String(address types.Address) string

ConvertValidatorAddressToBech32String converts the given validator address to its Bech32 string representation

func ConvertValidatorPubKeyToBech32String

func ConvertValidatorPubKeyToBech32String(pubKey tmcrypto.PubKey) (string, error)

ConvertValidatorPubKeyToBech32String converts the given pubKey to a Bech32 string

Types

type Block

type Block struct {
	Height          int64
	Hash            string
	TxNum           int
	TotalGas        uint64
	ProposerAddress string
	Timestamp       time.Time
}

Block contains the data of a single chain block

func NewBlock

func NewBlock(
	height int64, hash string, txNum int, totalGas uint64, proposerAddress string, timestamp time.Time,
) *Block

NewBlock allows to build a new Block instance

func NewBlockFromTmBlock

func NewBlockFromTmBlock(blk *tmctypes.ResultBlock, totalGas uint64) *Block

NewBlockFromTmBlock builds a new Block instance from a given ResultBlock object

type CobraCmdFunc

type CobraCmdFunc func(cmd *cobra.Command, args []string) error

CobraCmdFunc represents a cobra command function

func ConcatCobraCmdFuncs

func ConcatCobraCmdFuncs(fs ...CobraCmdFunc) CobraCmdFunc

ConcatCobraCmdFuncs returns a single function that calls each argument function in sequence RunE, PreRunE, PersistentPreRunE, etc. all have this same signature

type CommitSig

type CommitSig struct {
	Height           int64
	ValidatorAddress string
	VotingPower      int64
	ProposerPriority int64
	Timestamp        time.Time
}

CommitSig contains the data of a single validator commit signature

func NewCommitSig

func NewCommitSig(validatorAddress string, votingPower, proposerPriority, height int64, timestamp time.Time) *CommitSig

NewCommitSig allows to build a new CommitSign object

type DoubleSignEvidence

type DoubleSignEvidence struct {
	VoteA  DoubleSignVote
	VoteB  DoubleSignVote
	Height int64
}

DoubleSignEvidence represent a double sign evidence on each tendermint block

func NewDoubleSignEvidence

func NewDoubleSignEvidence(height int64, voteA DoubleSignVote, voteB DoubleSignVote) DoubleSignEvidence

NewDoubleSignEvidence return a new DoubleSignEvidence object

type DoubleSignVote

type DoubleSignVote struct {
	BlockID          string
	ValidatorAddress string
	Signature        string
	Type             int
	Height           int64
	Round            int32
	ValidatorIndex   int32
}

DoubleSignVote represents a double vote which is included inside a DoubleSignEvidence

func NewDoubleSignVote

func NewDoubleSignVote(
	roundType int,
	height int64,
	round int32,
	blockID string,
	validatorAddress string,
	validatorIndex int32,
	signature string,
) DoubleSignVote

NewDoubleSignVote allows to create a new DoubleSignVote instance

type Genesis

type Genesis struct {
	ChainID       string
	Time          time.Time
	InitialHeight int64
}

Genesis contains the useful information about the genesis

func NewGenesis

func NewGenesis(chainID string, startTime time.Time, initialHeight int64) *Genesis

NewGenesis allows to build a new Genesis instance

type HeightQueue

type HeightQueue chan int64

HeightQueue is a simple type alias for a (buffered) channel of block heights.

func NewQueue

func NewQueue(size int) HeightQueue

type IBCTransfer

type IBCTransfer struct {
	ReceiveEnabled bool `json:"receive_enabled" yaml:"receive_enabled"`
	SendEnabled    bool `json:"send_enabled" yaml:"send_enabled"`
}

IBCTransfer represents the x/ibc transfer parameters

type IBCTransferParams

type IBCTransferParams struct {
	Params IBCTransfer
	Height int64
}

IBCTransferParams represents the x/ibc transfer parameters

func NewIBCTransferParams

func NewIBCTransferParams(params IBCTransfer, height int64) *IBCTransferParams

NewIBCTransferParams allows to build a new IBCTransferParams instance

type InflationResponse

type InflationResponse struct {
	Inflation string `json:"inflation" yaml:"inflation"`
}

InflationResponse contains the data of the current inflation rate

type PageResponse

type PageResponse struct {
	NextKey []byte `json:"next_key,omitempty"`
	Total   string `json:"total,omitempty"`
}

type QueryAllBalancesResponse

type QueryAllBalancesResponse struct {
	Balances   sdk.Coins     `json:"balances"`
	Pagination *PageResponse `json:"pagination,omitempty"`
}

QueryAllBalancesResponse contains the account balance data

type StakingPool

type StakingPool struct {
	BondedTokens    sdk.Int
	NotBondedTokens sdk.Int
	Height          int64
}

StakingPool contains the data of the staking pool at the given height

func NewStakingPool

func NewStakingPool(bondedTokens sdk.Int, notBondedTokens sdk.Int, height int64) *StakingPool

NewStakingPool allows to build a new StakingPool instance

type Token

type Token struct {
	Name  string      `yaml:"name"`
	Units []TokenUnit `yaml:"units"`
}

Token represents a valid token inside the chain

func NewToken

func NewToken(name string, units []TokenUnit) Token

NewToken allows to build a new Token instance

type TokenPrice

type TokenPrice struct {
	UnitName  string
	Price     float64
	MarketCap int64
	Timestamp time.Time
}

TokenPrice represents the price at a given moment in time of a token unit

func NewTokenPrice

func NewTokenPrice(unitName string, price float64, marketCap int64, timestamp time.Time) TokenPrice

NewTokenPrice returns a new TokenPrice instance containing the given data

type TokenUnit

type TokenUnit struct {
	Denom    string   `yaml:"denom"`
	Exponent int      `yaml:"exponent"`
	Aliases  []string `yaml:"aliases,omitempty"`
	PriceID  string   `yaml:"price_id,omitempty"`
}

TokenUnit represents a unit of a token

func NewTokenUnit

func NewTokenUnit(denom string, exponent int, aliases []string, priceID string) TokenUnit

NewTokenUnit allows to build a new TokenUnit instance

type TxFee

type TxFee struct {
	Amount sdk.Coins `json:"amount" yaml:"amount"`
	Gas    string    `json:"gas" yaml:"gas"`
}

type TxMsg

type TxMsg struct {
	Type  string     `json:"type" yaml:"type"`
	Value TxMsgValue `json:"value" yaml:"value"`
}

type TxMsgValue

type TxMsgValue struct {
	Amount           sdk.Coin `json:"amount" yaml:"amount"`
	DelegatorAddress string   `json:"delegator_address" yaml:"delegator_address"`
	ValidatorAddress string   `json:"validator_address" yaml:"validator_address"`
}

type TxResponse

type TxResponse struct {
	Fee        TxFee          `json:"fee" yaml:"fee"`
	Memo       string         `json:"memo" yaml:"memo"`
	Msg        []TxMsg        `json:"msg" yaml:"msg"`
	Signatures []TxSignatures `json:"signatures" yaml:"signatures"`
	Hash       string         `json:"hash" yaml:"hash"`
	Height     int64          `json:"height" yaml:"height"`
}

TxResponse represents a valid transaction response

func NewTxResponse

func NewTxResponse(
	fee TxFee, memo string, msg []TxMsg, sig []TxSignatures, hash string, height int64,
) TxResponse

NewTxResponse allows to build a new TxResponse instance

type TxSignatures

type TxSignatures struct {
	Signature string `json:"signature" yaml:"signature"`
}

type Validator

type Validator struct {
	ConsensusAddr       string
	SelfDelegateAddress string
	Height              int64
}

Validator contains the data of a single validator

func NewValidator

func NewValidator(
	consAddr string,
	selfDelegateAddress string,
	height int64,
) Validator

NewValidator allows to build a new Validator instance

type ValidatorCommission

type ValidatorCommission struct {
	ValAddress          string
	SelfDelegateAddress string
	Commission          string
	MinSelfDelegation   string
	Height              int64
}

ValidatorCommission contains the data of a validator commission at a given height

func NewValidatorCommission

func NewValidatorCommission(
	valAddress, selfDelegateAddress, commission, minSelfDelegation string, height int64,
) ValidatorCommission

NewValidatorCommission return a new ValidatorCommission instance

type ValidatorDescription

type ValidatorDescription struct {
	OperatorAddress     string
	SelfDelegateAddress string
	Description         string
	Identity            string
	Moniker             string
	Height              int64
}

ValidatorDescription contains the description of a validator and timestamp do the description get changed

func NewValidatorDescription

func NewValidatorDescription(
	opAddr, selfDelegateAddress, description, identity string, moniker string, height int64,
) ValidatorDescription

NewValidatorDescription returns a new ValidatorDescription object

type ValidatorInfo

type ValidatorInfo struct {
	Address           string `yaml:"address"`
	Commission        string `yaml:"commission"`
	Details           string `yaml:"details"`
	Identity          string `yaml:"identity"`
	Jailed            string `yaml:"jailed"`
	MinSelfDelegation string `yaml:"min_self_delegation"`
	Moniker           string `yaml:"moniker"`
	Tombstoned        string `yaml:"tombstoned"`
	InActiveSet       string `yaml:"in_active_set"`
	VotingPower       string `yaml:"voting_power"`
}

type ValidatorList

type ValidatorList struct {
	Validator ValidatorInfo `yaml:"validator"`
}

type ValidatorStatus

type ValidatorStatus struct {
	ConsensusAddress    string
	SelfDelegateAddress string
	InActiveSet         string
	Jailed              string
	Tombstoned          string
	Height              int64
}

ValidatorStatus represents the latest state of a validator

func NewValidatorStatus

func NewValidatorStatus(valConsAddr, selfDelegateAddress, inActiveSet, jailed, tombstoned string, height int64) ValidatorStatus

NewValidatorStatus creates a new ValidatorVotingPower

type ValidatorVotingPower

type ValidatorVotingPower struct {
	ConsensusAddress    string
	SelfDelegateAddress string
	VotingPower         string
	Height              int64
}

ValidatorVotingPower represents the voting power of a validator at a specific block height

func NewValidatorVotingPower

func NewValidatorVotingPower(address, selfDelegateAddress string, votingPower string, height int64) ValidatorVotingPower

NewValidatorVotingPower creates a new ValidatorVotingPower

type ValidatorsList

type ValidatorsList struct {
	Validators []ValidatorList `yaml:"validators"`
}

ValidatorsList represents validators list from a file

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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