cli

package
v0.52.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 21 Imported by: 485

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTxCode added in v0.47.0

func CheckTxCode(network network.NetworkI, clientCtx client.Context, txHash string, expectedCode uint32) error

CheckTxCode verifies that the transaction result returns a specific code Takes a network, wait for two blocks and fetch the transaction from its hash

func ExecTestCLICmd

func ExecTestCLICmd(clientCtx client.Context, cmd *cobra.Command, extraArgs []string) (testutil.BufferWriter, error)

ExecTestCLICmd builds the client context, mocks the output and executes the command.

func GetTxResponse added in v0.47.0

func GetTxResponse(network network.NetworkI, clientCtx client.Context, txHash string) (sdk.TxResponse, error)

GetTxResponse returns queries the transaction response of a transaction from its hash Takes a network, wait for two blocks and fetch the transaction from its hash

func SubmitTestTx added in v0.50.0

func SubmitTestTx(clientCtx client.Context, msg proto.Message, from sdk.AccAddress, config TestTxConfig) (testutil.BufferWriter, error)

Types

type FilterTxsFn

type FilterTxsFn = func(query string, start, end int) ([][]byte, error)

type MockCometRPC added in v0.50.0

type MockCometRPC struct {
	rpcclientmock.Client
	// contains filtered or unexported fields
}

func NewMockCometRPC added in v0.50.0

func NewMockCometRPC(respQuery abci.QueryResponse) MockCometRPC

NewMockCometRPC returns a mock CometBFT RPC implementation. It is used for CLI testing.

func NewMockCometRPCWithResponseQueryValue

func NewMockCometRPCWithResponseQueryValue(bz []byte) MockCometRPC

NewMockCometRPCWithResponseQueryValue returns a mock CometBFT RPC implementation with value only. It is used for CLI testing.

func (MockCometRPC) ABCIQueryWithOptions added in v0.50.0

func (MockCometRPC) BroadcastTxSync added in v0.50.0

type MockCometTxSearchRPC

type MockCometTxSearchRPC struct {
	rpcclientmock.Client
	// contains filtered or unexported fields
}

func (MockCometTxSearchRPC) Block

func (mock MockCometTxSearchRPC) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error)

func (MockCometTxSearchRPC) BroadcastTxSync

func (MockCometTxSearchRPC) TxSearch

func (mock MockCometTxSearchRPC) TxSearch(ctx context.Context, query string, prove bool, page, perPage *int, orderBy string) (*coretypes.ResultTxSearch, error)

func (MockCometTxSearchRPC) Txs

func (m MockCometTxSearchRPC) Txs() []cmttypes.Tx

func (*MockCometTxSearchRPC) WithFilterTxsFn

func (m *MockCometTxSearchRPC) WithFilterTxsFn(fn FilterTxsFn)

func (*MockCometTxSearchRPC) WithTxConfig

func (m *MockCometTxSearchRPC) WithTxConfig(cfg client.TxConfig)

func (*MockCometTxSearchRPC) WithTxs

func (m *MockCometTxSearchRPC) WithTxs(txs [][]byte)

accept [][]byte so that module that use this for testing dont have to import comet directly

type TestTxConfig added in v0.50.0

type TestTxConfig struct {
	Simulate             bool
	GenOnly              bool
	Offline              bool
	Memo                 string
	Gas                  uint64
	AccNum               uint64
	Seq                  uint64
	Fee                  sdk.Coins
	IsAsyncBroadcastMode bool
}

Jump to

Keyboard shortcuts

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