cli

package
v0.0.0-...-8551cdf Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBroadcastCommand

func GetBroadcastCommand(cdc *codec.Codec) *cobra.Command

func GetDecodeCommand

func GetDecodeCommand(codec *amino.Codec) *cobra.Command

GetDecodeCommand returns the decode command to take Amino-serialized bytes and turn it into a JSONified transaction.

func GetEncodeCommand

func GetEncodeCommand(cdc *codec.Codec) *cobra.Command

GetEncodeCommand returns the encode command to take a JSONified transaction and turn it into Amino-serialized bytes

func QueryTxCmd

func QueryTxCmd(cdc *codec.Codec) *cobra.Command

func QueryTxsByEventsCmd

func QueryTxsByEventsCmd(cdc *codec.Codec) *cobra.Command

QueryTxsByEventsCmd returns a command to search through transactions by events.

func ValidateTxResult

func ValidateTxResult(cliCtx context.CLIContext, resTx *ctypes.ResultTx) error

ValidateTxResult performs transaction verification.

Types

type SearchTxsResult

type SearchTxsResult struct {
	TotalCount int          `json:"total_count"` // Count of all txs
	Count      int          `json:"count"`       // Count of txs in current page
	PageNumber int          `json:"page_number"` // Index of current page, start from 1
	PageTotal  int          `json:"page_total"`  // Count of total pages
	Limit      int          `json:"limit"`       // Max count txs per page
	Txs        []TxResponse `json:"txs"`         // List of txs in current page
}

SearchTxsResult defines a structure for querying txs pageable

func NewSearchTxsResult

func NewSearchTxsResult(totalCount, count, page, limit int, txs []TxResponse) SearchTxsResult

func QueryTxsByEvents

func QueryTxsByEvents(cliCtx context.CLIContext, events []string, page, limit int, orderBy string) (*SearchTxsResult, error)

QueryTxsByEvents performs a search for transactions for a given set of events via the Tendermint RPC. An event takes the form of: "{eventAttribute}.{attributeKey} = '{attributeValue}'". Each event is concatenated with an 'AND' operand. It returns a slice of Info object containing txs and metadata. An error is returned if the query fails. If an empty string is provided it will order txs by asc

type TxResponse

type TxResponse sdk.TxResponse

func QueryTx

func QueryTx(cliCtx context.CLIContext, hashHexStr string) (TxResponse, error)

QueryTx queries for a single transaction by a hash string in hex format. An error is returned if the transaction does not exist or cannot be queried.

func (TxResponse) Empty

func (txRes TxResponse) Empty() bool

func (TxResponse) PrettifyJSON

func (txRes TxResponse) PrettifyJSON(cdc *codec.Codec) ([]byte, error)

Jump to

Keyboard shortcuts

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