testutil

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: Apache-2.0 Imports: 7 Imported by: 8

Documentation

Overview

Package server 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

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenAddress added in v1.1.0

func GenAddress() string

GenAddress generates a valid bech32 address

Types

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 FixtureFactory

type FixtureFactory interface {

	// Setup runs necessary fixture setup and returns a fresh Fixture environment.
	Setup() Fixture
}

FixtureFactory defines an interface for creating server test fixtures

Directories

Path Synopsis
Package network implements and exposes a fully operational in-process Tendermint test network that consists of at least one or potentially many validators.
Package network implements and exposes a fully operational in-process Tendermint test network that consists of at least one or potentially many validators.

Jump to

Keyboard shortcuts

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