testutil

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultGenesis

func DefaultGenesis(cdc codec.JSONCodec) map[string]json.RawMessage

DefaultGenesis returns default genesis state as raw bytes

func ExecCommand

func ExecCommand(
	t *testing.T,
	network *network.Network,
	clientCtx client.Context,
	cmd *cobra.Command,
	extraArgs []string,
) *coretypes.ResultTx

ExecCommand executes a tx command and returns the result

func MakeCodecs

func MakeCodecs() params.EncodingConfig

MakeCodecs returns the application codec and tx codec

func NewConfig

func NewConfig() network.Config

NewConfig returns a new app config

func NewTestNetworkFixture

func NewTestNetworkFixture() network.TestFixture

NewTestNetworkFixture returns a new simapp AppConstructor for network simulation tests

func WaitForTx

func WaitForTx(
	t *testing.T,
	network *network.Network,
	clientCtx client.Context,
	txHash string,
) *coretypes.ResultTx

WaitForTx waits for a tx to be included in a block

Types

type AppWrapper

type AppWrapper struct {
	*app.IrisApp
}

AppWrapper extends an ABCI application, but with most of its parameters exported. They are exported for convenience in creating helper functions, as object capabilities aren't needed for testing.

func CreateApp

func CreateApp(t *testing.T) *AppWrapper

CreateApp initializes a new SimApp. A Nop logger is set in SimApp.

func CreateAppWithGenesisValSet

func CreateAppWithGenesisValSet(
	t *testing.T,
	valSet *tmtypes.ValidatorSet,
	genAccs []authtypes.GenesisAccount,
	balances ...banktypes.Balance,
) *AppWrapper

CreateAppWithGenesisValSet initializes a new SimApp with a validator set and genesis accounts that also act as delegators. For simplicity, each validator is bonded with a delegation of one consensus engine unit (10^6) in the default token of the simapp from first genesis account. A Nop logger is set in SimApp.

type EmptyAppOptions

type EmptyAppOptions struct{}

EmptyAppOptions is a stub implementing AppOptions

func (EmptyAppOptions) Get

func (ao EmptyAppOptions) Get(o string) interface{}

Get implements AppOptions

Jump to

Keyboard shortcuts

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