Documentation ¶
Overview ¶
Integration contains the integration test setup used for SDK modules. To see how to use this, check the tests/integration/example_test.go file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CreateMultiStore = moduletestutil.CreateMultiStore
CreateMultiStore is a helper for setting up multiple stores for provided modules. Deprecated: use github.com/cosmos/cosmos-sdk/types/module/testutil.CreateMultiStore instead.
Functions ¶
This section is empty.
Types ¶
type App ¶
App is a test application that can be used to test the integration of modules.
func NewIntegrationApp ¶
func NewIntegrationApp( logger log.Logger, keys map[string]*storetypes.KVStoreKey, appCodec codec.Codec, addressCodec address.Codec, validatorCodec address.Codec, modules map[string]appmodule.AppModule, msgRouter *baseapp.MsgServiceRouter, grpcRouter *baseapp.GRPCQueryRouter, baseAppOptions ...func(*baseapp.BaseApp), ) *App
NewIntegrationApp creates an application for testing purposes. This application is able to route messages to their respective handlers.
func (*App) Context ¶
Context returns the application context. It can be unwrapped to a sdk.Context, with the sdk.UnwrapSDKContext function.
func (*App) QueryHelper ¶
func (app *App) QueryHelper() *baseapp.QueryServiceTestHelper
QueryHelper returns the application query helper. It can be used when registering query services.
func (*App) RunMsg ¶
RunMsg provides the ability to run a message and return the response. In order to run a message, the application must have a handler for it. These handlers are registered on the application message service router. The result of the message execution is returned as an Any type. That any type can be unmarshaled to the expected response type. If the message execution fails, an error is returned.
type Option ¶
type Option func(*Config)
Option is a function that can be used to configure the integration app.
func WithAutomaticCommit ¶
func WithAutomaticCommit() Option
WithAutomaticCommit enables automatic commit. This means that the integration app will automatically commit the state after each msgs.
func WithAutomaticFinalizeBlock ¶
func WithAutomaticFinalizeBlock() Option
WithAutomaticFinalizeBlock calls ABCI finalize block.