ante

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnteTestSuite

type AnteTestSuite struct {
	AnteHandler    sdk.AnteHandler
	Ctx            sdk.Context
	ClientCtx      client.Context
	TxBuilder      client.TxBuilder
	AccountKeeper  keeper.AccountKeeper
	BankKeeper     *authtestutil.MockBankKeeper
	FeeGrantKeeper *antetestutil.MockFeegrantKeeper
	EncCfg         moduletestutil.TestEncodingConfig
}

AnteTestSuite is a test suite to be used with ante handler tests.

func SetupTestSuite

func SetupTestSuite(t *testing.T, isCheckTx bool) *AnteTestSuite

SetupTest setups a new test, with new app, context, and AnteHandler.

func (*AnteTestSuite) CreateTestAccounts

func (suite *AnteTestSuite) CreateTestAccounts(numAccs int) []TestAccount

func (*AnteTestSuite) CreateTestTx

func (suite *AnteTestSuite) CreateTestTx(
	privs []cryptotypes.PrivKey,
	accNums []uint64,
	accSeqs []uint64,
	chainID string,
) (xauthsigning.Tx, error)

CreateTestTx is a helper function to create a tx given multiple inputs.

func (*AnteTestSuite) DeliverMsgs

func (suite *AnteTestSuite) DeliverMsgs(
	t *testing.T,
	privs []cryptotypes.PrivKey,
	msgs []sdk.Msg,
	feeAmount sdk.Coins,
	gasLimit uint64,
	accNums,
	accSeqs []uint64,
	chainID string,
	simulate bool,
) (sdk.Context, error)

DeliverMsgs constructs a tx and runs it through the ante handler. This is used to set the context for a test case, for example to test for replay protection.

func (*AnteTestSuite) RunTestCase

func (suite *AnteTestSuite) RunTestCase(t *testing.T, tc TestCase, args TestCaseArgs)

type TestAccount

type TestAccount struct {
	// contains filtered or unexported fields
}

TestAccount represents an account used in the tests in x/auth/ante.

type TestCase

type TestCase struct {
	// contains filtered or unexported fields
}

TestCase represents a test case used in test tables.

type TestCaseArgs

type TestCaseArgs struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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