testtx

package
v0.0.0-...-dcdbaa1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAnyTimesTxTxContext

func NewAnyTimesTxTxContext(
	t *testing.T,
	keyring cosmoskeyring.Keyring,
) (*mockclient.MockTxContext, client.TxContext)

NewAnyTimesTxTxContext initializes a mock transaction context that's configured to allow arbitrary calls to certain predefined interactions, primarily concerning the retrieval of account numbers and sequences.

func NewBaseTxContext

func NewBaseTxContext(
	t *testing.T,
	signingKeyName string,
	keyring cosmoskeyring.Keyring,
	expectedTx *cometbytes.HexBytes,
) *mockclient.MockTxContext

NewBaseTxContext creates a mock transaction context that's configured to expect calls to NewTxBuilder, SignTx, and EncodeTx methods, any number of times. EncodeTx is used to intercept the encoded transaction bytes and store them in the expectedTx output parameter. Each of these methods proxies to the corresponding method on a real transaction context.

func NewLocalnetClient

func NewLocalnetClient(t *testing.T, opts ...client.TxClientOption) client.TxClient

NewLocalnetClient creates and returns a new client for use with the LocalNet validator.

func NewLocalnetContext

func NewLocalnetContext(t *testing.T) client.TxContext

NewLocalnetContext creates and returns a new transaction context configured for use with the LocalNet validator.

func NewOneTimeDelayedSignAndBroadcastTxClient

func NewOneTimeDelayedSignAndBroadcastTxClient(
	t *testing.T,
	ctx context.Context,
	delay time.Duration,
) *mockclient.MockTxClient

NewOneTimeDelayedSignAndBroadcastTxClient constructs a mock TxClient with the expectation to perform a SignAndBroadcast operation with a specified delay.

func NewOneTimeErrCheckTxTxContext

func NewOneTimeErrCheckTxTxContext(
	t *testing.T,
	keyring cosmoskeyring.Keyring,
	signingKeyName string,
	expectedErrMsg *string,
) *mockclient.MockTxContext

NewOneTimeErrCheckTxTxContext creates a mock transaction context to simulate a specific error scenario during the ABCI check-tx phase (i.e., during initial validation before the transaction is included in the block). expectedErrMsg is populated with the same error message which is presented in the result from the QueryTx method so that it can be asserted against.

func NewOneTimeErrTxTimeoutTxContext

func NewOneTimeErrTxTimeoutTxContext(
	t *testing.T,
	keyring cosmoskeyring.Keyring,
	signingKeyName string,
	expectedErrMsg *string,
) *mockclient.MockTxContext

NewOneTimeErrTxTimeoutTxContext creates a mock transaction context designed to simulate a specific timeout error scenario during transaction broadcasting. expectedErrMsg is populated with the same error message which is presented in the result from the QueryTx method so that it can be asserted against.

func NewOneTimeSignAndBroadcastTxClient

func NewOneTimeSignAndBroadcastTxClient(
	t *testing.T,
	ctx context.Context,
	signAndBroadcast signAndBroadcastFn,
) *mockclient.MockTxClient

NewOneTimeSignAndBroadcastTxClient constructs a mock TxClient with the expectation to perform a SignAndBroadcast operation, which will call and receive the return from the given signAndBroadcast function.

func NewOneTimeTxTxContext

func NewOneTimeTxTxContext(
	t *testing.T,
	keyring cosmoskeyring.Keyring,
	signingKeyName string,
	expectedTx *cometbytes.HexBytes,
) *mockclient.MockTxContext

NewOneTimeTxTxContext creates a mock transaction context primed to respond with a single successful transaction response.

Types

This section is empty.

Jump to

Keyboard shortcuts

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