Documentation ¶
Index ¶
- func InterfaceRegistry() codectypes.InterfaceRegistry
- func NewTestFeeAmount() sdk.Coins
- func NewTestGasLimit() uint64
- type TestAccount
- type TestCase
- type TestCaseArgs
- type TestEncodingConfig
- type TestSuite
- func (s *TestSuite) CreateTestAccounts(numAccs int) []TestAccount
- func (s *TestSuite) CreateTestTx(privs []cryptotypes.PrivKey, accNums []uint64, accSeqs []uint64, ...) (authsigning.Tx, error)
- func (s *TestSuite) DeliverMsgs(t *testing.T, privs []cryptotypes.PrivKey, msgs []sdk.Msg, feeAmount sdk.Coins, ...) (sdk.Context, error)
- func (s *TestSuite) RunTestCase(t *testing.T, tc TestCase, args TestCaseArgs)
- func (s *TestSuite) SetupHandlers(mock bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InterfaceRegistry ¶
func InterfaceRegistry() codectypes.InterfaceRegistry
Types ¶
type TestAccount ¶
type TestAccount struct { Account sdk.AccountI Priv cryptotypes.PrivKey }
TestAccount represents an account used in the tests in x/auth/ante.
type TestCase ¶
type TestCase struct { Name string Malleate func(*TestSuite) TestCaseArgs RunAnte bool RunPost bool Simulate bool ExpPass bool ExpErr error }
TestCase represents a test case used in test tables.
type TestCaseArgs ¶
type TestEncodingConfig ¶
type TestEncodingConfig struct { InterfaceRegistry codectypes.InterfaceRegistry Codec codec.Codec TxConfig client.TxConfig Amino *codec.LegacyAmino }
TestEncodingConfig specifies the concrete encoding types to use for a given app. This is provided for compatibility between protobuf and amino implementations.
func MakeTestEncodingConfig ¶
func MakeTestEncodingConfig() TestEncodingConfig
MakeTestEncodingConfig creates a test EncodingConfig for a test configuration.
type TestSuite ¶
type TestSuite struct { suite.Suite Ctx sdk.Context AnteHandler sdk.AnteHandler PostHandler sdk.PostHandler ClientCtx client.Context TxBuilder client.TxBuilder AccountKeeper feemarketante.AccountKeeper FeeMarketKeeper feemarketpost.FeeMarketKeeper BankKeeper feemarketante.BankKeeper FeeGrantKeeper feemarketante.FeeGrantKeeper MockBankKeeper *mocks.BankKeeper MockFeeGrantKeeper *mocks.FeeGrantKeeper EncCfg TestEncodingConfig }
func SetupTestSuite ¶
SetupTestSuite setups a new test, with new app, context, and anteHandler.
func (*TestSuite) CreateTestAccounts ¶
func (s *TestSuite) CreateTestAccounts(numAccs int) []TestAccount
func (*TestSuite) CreateTestTx ¶
func (s *TestSuite) CreateTestTx(privs []cryptotypes.PrivKey, accNums []uint64, accSeqs []uint64, chainID string) (authsigning.Tx, error)
CreateTestTx is a helper function to create a tx given multiple inputs.
func (*TestSuite) DeliverMsgs ¶
func (s *TestSuite) 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 (*TestSuite) RunTestCase ¶
func (s *TestSuite) RunTestCase(t *testing.T, tc TestCase, args TestCaseArgs)