utils

package
v0.0.2-rc3 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QueryTx

func QueryTx(ctx context.Context, cctx client.Context, hash []byte) (*sdk.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 QueryTxsByEvents

func QueryTxsByEvents(ctx context.Context, cctx client.Context, events []string, page, limit int, orderBy string) (*sdk.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

func QueryVoteByTxQuery

func QueryVoteByTxQuery(ctx context.Context, cctx client.Context, params v1.QueryVoteParams) ([]byte, error)

QueryVoteByTxQuery will query for a single vote via a direct txs tags query.

func QueryVotesByTxQuery

func QueryVotesByTxQuery(ctx context.Context, cctx client.Context, params v1.QueryProposalVotesParams) ([]byte, error)

QueryVotesByTxQuery will query for votes via a direct txs tags query. It will fetch and build votes directly from the returned txs and returns a JSON marshalled result or any error that occurred.

Types

type Proposer

type Proposer struct {
	ProposalID uint64 `json:"proposal_id" yaml:"proposal_id"`
	Proposer   string `json:"proposer" yaml:"proposer"`
}

Proposer contains metadata of a governance proposal used for querying a proposer.

func NewProposer

func NewProposer(proposalID uint64, proposer string) Proposer

NewProposer returns a new Proposer given id and proposer

func QueryProposerByTxQuery

func QueryProposerByTxQuery(ctx context.Context, cctx client.Context, proposalID uint64) (Proposer, error)

QueryProposerByTxQuery will query for a proposer of a governance proposal by ID.

func (Proposer) String

func (p Proposer) String() string

String implements the fmt.Stringer interface.

Jump to

Keyboard shortcuts

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