testutil

package
v0.5.5-beta-1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConsensusParams = &tmproto.ConsensusParams{
	Block: &tmproto.BlockParams{
		MaxBytes: 200000,
		MaxGas:   2000000,
	},
	Evidence: &tmproto.EvidenceParams{
		MaxAgeNumBlocks: 302400,
		MaxAgeDuration:  504 * time.Hour,
		MaxBytes:        10000,
	},
	Validator: &tmproto.ValidatorParams{
		PubKeyTypes: []string{
			tmtypes.ABCIPubKeyTypeEd25519,
		},
	},
}

DefaultConsensusParams defines the default Tendermint consensus params used in SimApp testing.

Functions

func AddGenesisAccount

func AddGenesisAccount(addr sdk.AccAddress, appState app.GenesisState, cdc codec.Codec) (map[string]json.RawMessage, error)

AddGenesisAccount mimics the cli addGenesisAccount command, providing an account with an allocation of to "token" and "tia" tokens in the genesis state

func GenerateKeyringSigner

func GenerateKeyringSigner(t *testing.T, acct string) *types.KeyringSigner

GenerateKeyringSigner creates a types.KeyringSigner with keys generated for the provided accounts

func GenesisStateWithSingleValidator added in v0.5.0

func GenesisStateWithSingleValidator(t *testing.T, testApp *app.App) (app.GenesisState, *tmtypes.ValidatorSet)

SetupWithGenesisValSet initializes GenesisState with a single validator and genesis accounts that also act as delegators.

func NewDefaultGenesisState

func NewDefaultGenesisState(cdc codec.JSONCodec) app.GenesisState

NewDefaultGenesisState generates the default state for the application.

func SetupTestAppWithGenesisValSet added in v0.5.0

func SetupTestAppWithGenesisValSet(t *testing.T) *app.App

SetupTestAppWithGenesisValSet initializes a new app 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 in the default token of the app from first genesis account. A Nop logger is set in app.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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