Documentation
¶
Overview ¶
Package fixture defines fixture interfaces and implementations for testing server implementations with multiple backends.
Currently one backend - an in-memory store with no ABCI application is supported in configuration.Fixture.
A multi-node in-process ABCI-based backend for full integration tests is planned based on to the Cosmos SDK in-process integration test framework.
Index ¶
- func AddressHash(prefix string, contents []byte) []byte
- func TypeURL(req proto.Message) string
- type CallInfo
- type Factory
- type Fixture
- type Invoker
- type InvokerConn
- type InvokerFactory
- type MockModule
- func (m MockModule) ConsensusVersion() uint64
- func (m MockModule) DefaultGenesis(_ codec.JSONCodec) json.RawMessage
- func (m MockModule) ExportGenesis(_ sdk.Context, _ codec.JSONCodec) json.RawMessage
- func (m MockModule) GetQueryCmd() *cobra.Command
- func (m MockModule) GetTxCmd() *cobra.Command
- func (m MockModule) InitGenesis(_ sdk.Context, _ codec.JSONCodec, _ json.RawMessage) []abci.ValidatorUpdate
- func (m MockModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier
- func (m MockModule) Name() string
- func (m MockModule) QuerierRoute() string
- func (m MockModule) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux)
- func (m MockModule) RegisterInterfaces(_ types.InterfaceRegistry)
- func (m MockModule) RegisterInvariants(_ sdk.InvariantRegistry)
- func (m MockModule) RegisterLegacyAminoCodec(_ *codec.LegacyAmino)
- func (m MockModule) RegisterServices(_ module.Configurator)
- func (m MockModule) Route() sdk.Route
- func (m MockModule) ValidateGenesis(_ codec.JSONCodec, _ client.TxEncodingConfig, _ json.RawMessage) error
- type ModuleID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddressHash ¶
Types ¶
type Factory ¶
type Factory interface { // Setup runs necessary fixture setup and returns a fresh Fixture environment. Setup() Fixture // BaseApp returns the baseApp used in the test fixture.. BaseApp() *baseapp.BaseApp // Codec returns the codec. Codec() *codec.ProtoCodec // SetModules sets the modules to be used in the test fixture. SetModules(modules []sdkmodules.AppModule) }
Factory defines an interface for creating server test fixtures
type Fixture ¶
type Fixture interface { // Context is the context.Context to be used with gRPC generated client code. Context() context.Context // TxConn is the grpc.ClientConnInterface to be used when constructing Msg service clients. TxConn() grpc.ClientConnInterface // QueryConn is the grpc.ClientConnInterface to be used when constructing Query service clients. QueryConn() grpc.ClientConnInterface // Signers are a list of addresses which can be used to sign transactions. They may either be // random or correspond to nodes in a test network which have keyrings. Signers() []sdk.AccAddress // InitGenesis initializes genesis for all modules with provided genesisData. InitGenesis(ctx sdk.Context, genesisData map[string]json.RawMessage) (abci.ResponseInitChain, error) // ExportGenesis returns raw encoded JSON genesis state for all modules. ExportGenesis(ctx sdk.Context) (map[string]json.RawMessage, error) // Codec is the app ProtoCodec. Codec() *codec.ProtoCodec // Teardown performs any teardown actions for the fixture. Teardown() }
Fixture defines an interface for interacting with app services in tests independent of the backend.
type InvokerConn ¶
type InvokerConn interface { grpc.ClientConnInterface Invoker(methodName string) (Invoker, error) }
type InvokerFactory ¶
type MockModule ¶
type MockModule struct{}
func (MockModule) ConsensusVersion ¶
func (m MockModule) ConsensusVersion() uint64
func (MockModule) DefaultGenesis ¶
func (m MockModule) DefaultGenesis(_ codec.JSONCodec) json.RawMessage
func (MockModule) ExportGenesis ¶
func (m MockModule) ExportGenesis(_ sdk.Context, _ codec.JSONCodec) json.RawMessage
func (MockModule) GetQueryCmd ¶
func (m MockModule) GetQueryCmd() *cobra.Command
func (MockModule) GetTxCmd ¶
func (m MockModule) GetTxCmd() *cobra.Command
func (MockModule) InitGenesis ¶
func (m MockModule) InitGenesis(_ sdk.Context, _ codec.JSONCodec, _ json.RawMessage) []abci.ValidatorUpdate
func (MockModule) LegacyQuerierHandler ¶
func (m MockModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier
func (MockModule) Name ¶
func (m MockModule) Name() string
func (MockModule) QuerierRoute ¶
func (m MockModule) QuerierRoute() string
func (MockModule) RegisterGRPCGatewayRoutes ¶
func (m MockModule) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux)
func (MockModule) RegisterInterfaces ¶
func (m MockModule) RegisterInterfaces(_ types.InterfaceRegistry)
func (MockModule) RegisterInvariants ¶
func (m MockModule) RegisterInvariants(_ sdk.InvariantRegistry)
func (MockModule) RegisterLegacyAminoCodec ¶
func (m MockModule) RegisterLegacyAminoCodec(_ *codec.LegacyAmino)
func (MockModule) RegisterServices ¶
func (m MockModule) RegisterServices(_ module.Configurator)
func (MockModule) Route ¶
func (m MockModule) Route() sdk.Route
func (MockModule) ValidateGenesis ¶
func (m MockModule) ValidateGenesis(_ codec.JSONCodec, _ client.TxEncodingConfig, _ json.RawMessage) error
Click to show internal directories.
Click to hide internal directories.