integration

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMultiStore

func CreateMultiStore(keys map[string]*storetypes.KVStoreKey, logger log.Logger) storetypes.CommitMultiStore

CreateMultiStore is a helper for setting up multiple stores for provided modules.

Types

type IntegationApp

type IntegationApp struct {
	*baseapp.BaseApp
	// contains filtered or unexported fields
}

IntegationApp is a test application that can be used to test the integration of modules.

func NewIntegrationApp

func NewIntegrationApp(
	sdkCtx sdk.Context,
	logger log.Logger,
	keys map[string]*storetypes.KVStoreKey,
	appCodec codec.Codec,
	modules map[string]appmodule.AppModule,
) *IntegationApp

NewIntegrationApp creates an application for testing purposes. This application is able to route messages to their respective handlers.

func (*IntegationApp) AddBlock

func (app *IntegationApp) AddBlock()

AddBlock increments the block number of the application context.

func (*IntegationApp) AddTime

func (app *IntegationApp) AddTime(seconds int64)

AddTime adds time to the application context.

func (*IntegationApp) Context

func (app *IntegationApp) Context() sdk.Context

Context returns the application context. It can be unwrapped to a sdk.Context, with the sdk.UnwrapSDKContext function.

func (*IntegationApp) QueryHelper

func (app *IntegationApp) QueryHelper() *baseapp.QueryServiceTestHelper

QueryHelper returns the application query helper. It can be used when registering query services.

func (*IntegationApp) RunMsg

func (app *IntegationApp) RunMsg(msg sdk.Msg, option ...integration.Option) (*codectypes.Any, error)

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.

Jump to

Keyboard shortcuts

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