Documentation ¶
Index ¶
- func InterfaceRegistry() codectypes.InterfaceRegistry
- func NewTestFeeAmount() sdk.Coins
- func NewTestGasLimit() uint64
- type TestAccount
- type TestAccountBalance
- 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) SetAccountBalances(accounts []TestAccountBalance)
- 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 TestAccountBalance ¶
type TestAccountBalance struct { TestAccount sdk.Coins }
type TestCase ¶
type TestCase struct { Name string Malleate func(*TestSuite) TestCaseArgs StateUpdate func(*TestSuite) RunAnte bool RunPost bool Simulate bool ExpPass bool ExpErr error ExpectConsumedGas uint64 Mock bool }
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 *feemarketkeeper.Keeper BankKeeper bankkeeper.Keeper FeeGrantKeeper feemarketante.FeeGrantKeeper MockBankKeeper *xfeemarketpostmocks.BankKeeper MockFeeGrantKeeper *mocks.FeeGrantKeeper EncCfg TestEncodingConfig MsgServer feemarkettypes.MsgServer }
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)
func (*TestSuite) SetAccountBalances ¶
func (s *TestSuite) SetAccountBalances(accounts []TestAccountBalance)