queries

package
v1.20.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertGetAllBalances

func AssertGetAllBalances(t *testing.T, n *network.Network, addr string) (sdk.Coins, bool)

AssertGetAllBalances executes a query to get all balances for an account, asserting that everything is okay. The returned bool will be true on success, or false if something goes wrong.

func AssertGetGovProp

func AssertGetGovProp(t *testing.T, n *network.Network, propID string) (*govv1.Proposal, bool)

AssertGetGovProp executes a query to get the requested governance proposal, asserting that everything is okay. The returned bool will be true on success, or false if something goes wrong.

func AssertGetLastGovProp

func AssertGetLastGovProp(t *testing.T, n *network.Network) (*govv1.Proposal, bool)

AssertGetLastGovProp executes a query to get the most recent governance proposal, asserting that everything is okay. The returned bool will be true on success, or false if something goes wrong.

func AssertGetModuleAccountByName

func AssertGetModuleAccountByName(t *testing.T, n *network.Network, moduleName string) (sdk.ModuleAccountI, bool)

AssertGetModuleAccountByName executes a query to get a module account by name, asserting that everything is okay. The returned bool will be true on success, or false if something goes wrong.

func AssertGetRequest

func AssertGetRequest[T proto.Message](t *testing.T, n *network.Network, url string, emptyResp T) (T, bool)

AssertGetRequest does an HTTP get on the provided url and unmarshalls the response into the provided emptyResp. The returned bool will be true on success, or false if something goes wrong.

The url should start with a / and should just contain the portion as defined in the proto.

func AssertGetSpendableBalances

func AssertGetSpendableBalances(t *testing.T, n *network.Network, addr string) (sdk.Coins, bool)

AssertGetSpendableBalances executes a query to get spendable balances for an account, asserting that everything is okay. The returned bool will be true on success, or false if something goes wrong.

func AssertGetTxFromResponse

func AssertGetTxFromResponse(t *testing.T, n *network.Network, txRespBz []byte) (sdk.TxResponse, bool)

AssertGetTxFromResponse gets the TxResponse from the provided ExecTestCLICmd output bytes. If the provided output indicates a code other than 0, that is what is returned. If the provided output has a code of 0, the tx hash is extracted from it, and queries are executed to get the TxResponse for it. Four attempts are made to query for the tx, waiting a block between each attempt.

This asserts that there are no problems getting the TxResponse, returning true if no assertions failed.

func CmdGetAllGovProps

func CmdGetAllGovProps(n *network.Network) *cobra.Command

CmdGetAllGovProps returns a cobra.Command that will execute a query to get all governance proposals.

func GetAllBalances

func GetAllBalances(t *testing.T, n *network.Network, addr string) sdk.Coins

GetAllBalances executes a query to get all balances for an account, requiring everything to be okay.

func GetGovProp

func GetGovProp(t *testing.T, n *network.Network, propID string) *govv1.Proposal

GetGovProp executes a query to get the requested governance proposal, requiring everything to be okay.

func GetLastGovProp

func GetLastGovProp(t *testing.T, n *network.Network) *govv1.Proposal

GetLastGovProp executes a query to get the most recent governance proposal, requiring everything to be okay.

func GetModuleAccountByName

func GetModuleAccountByName(t *testing.T, n *network.Network, moduleName string) sdk.ModuleAccountI

GetModuleAccountByName executes a query to get a module account by name, requiring everything to be okay.

func GetSpendableBalances

func GetSpendableBalances(t *testing.T, n *network.Network, addr string) sdk.Coins

GetSpendableBalances executes a query to get spendable balances for an account, requiring everything to be okay.

func GetTxFromResponse

func GetTxFromResponse(t *testing.T, n *network.Network, txRespBz []byte) sdk.TxResponse

GetTxFromResponse gets the TxResponse from the provided ExecTestCLICmd output bytes. If the provided output indicates a code other than 0, that is what is returned. If the provided output has a code of 0, the tx hash is extracted from it, and queries are executed to get the TxResponse for it. Three attempts are made to query for the tx, waiting a block between each attempt.

This requires that there are no problems getting the TxResponse.

Types

This section is empty.

Jump to

Keyboard shortcuts

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