Documentation
¶
Index ¶
- Constants
- Variables
- func AddTestAddrs(app *app.App, ctx sdk.Context, accNum int, accAmt sdk.Int) []sdk.AccAddress
- func AddTestAddrsIncremental(app *app.App, ctx sdk.Context, accNum int, accAmt sdk.Int) []sdk.AccAddress
- func GenSignedMockTx(r *rand.Rand, txConfig client.TxConfig, msgs []sdk.Msg, feeAmt sdk.Coins, ...) (sdk.Tx, error)
- func GenTx(gen client.TxConfig, msgs []sdk.Msg, feeAmt sdk.Coins, gas uint64, ...) (sdk.Tx, error)
- func GenerateRandomString(length int) string
- func GenerateRandomStringWithCharset(length int, charset string) string
- func GenerateRandomTestAccounts(accNum int) []sdk.AccAddress
- func GetAppEncodingConfig() params.EncodingConfig
- func NewDefaultGenesisState(cdc codec.JSONCodec) app.GenesisState
- func RandInBetween(min, max int) int
- func SetKeeperTestParamsAndDefaultValues(app *app.App, ctx sdk.Context)
- func Setup(t *testing.T, isCheckTx bool) *app.App
- func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, ...) *app.App
- func TestAddr(addr string, bech string) (sdk.AccAddress, error)
- type EmptyAppOptions
- type GenerateAccountStrategy
Constants ¶
const ( TestDenomination = "nund" SimAppChainID = "simulation-app" TestDefaultStorage = 200 TestMaxStorage = 300 )
SimAppChainID hardcoded chainID for simulation
Variables ¶
var ( DefaultConsensusParams = &abci.ConsensusParams{ Block: &abci.BlockParams{ MaxBytes: 200000, MaxGas: 2000000, }, Evidence: &tmproto.EvidenceParams{ MaxAgeNumBlocks: 302400, MaxAgeDuration: 504 * time.Hour, MaxBytes: 10000, }, Validator: &tmproto.ValidatorParams{ PubKeyTypes: []string{ tmtypes.ABCIPubKeyTypeEd25519, }, }, } EncodingConfig = params.EncodingConfig{} )
DefaultConsensusParams defines the default Tendermint consensus params used in app.App testing.
Functions ¶
func AddTestAddrs ¶
AddTestAddrs constructs and returns accNum amount of accounts with an initial balance of accAmt in random order
func AddTestAddrsIncremental ¶
func AddTestAddrsIncremental(app *app.App, ctx sdk.Context, accNum int, accAmt sdk.Int) []sdk.AccAddress
AddTestAddrs constructs and returns accNum amount of accounts with an initial balance of accAmt in random order
func GenSignedMockTx ¶ added in v1.8.0
func GenSignedMockTx(r *rand.Rand, txConfig client.TxConfig, msgs []sdk.Msg, feeAmt sdk.Coins, gas uint64, chainID string, accNums, accSeqs []uint64, priv ...cryptotypes.PrivKey) (sdk.Tx, error)
GenSignedMockTx generates a signed mock transaction.
func GenTx ¶
func GenTx(gen client.TxConfig, msgs []sdk.Msg, feeAmt sdk.Coins, gas uint64, chainID string, accNums, accSeqs []uint64, priv ...cryptotypes.PrivKey) (sdk.Tx, error)
GenTx generates a signed mock transaction.
func GenerateRandomString ¶
GenerateRandomString generates a random string given a length, based on a set character set
func GenerateRandomTestAccounts ¶
func GenerateRandomTestAccounts(accNum int) []sdk.AccAddress
func GetAppEncodingConfig ¶ added in v1.8.0
func GetAppEncodingConfig() params.EncodingConfig
func NewDefaultGenesisState ¶
func NewDefaultGenesisState(cdc codec.JSONCodec) app.GenesisState
NewDefaultGenesisState generates the default state for the application.
func RandInBetween ¶
func SetupWithGenesisValSet ¶ added in v1.8.0
func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *app.App
SetupWithGenesisValSet 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 in the default token of the simapp from first genesis account. A Nop logger is set in SimApp.
Types ¶
type EmptyAppOptions ¶
type EmptyAppOptions struct{}
EmptyAppOptions is a stub implementing AppOptions
func (EmptyAppOptions) Get ¶
func (ao EmptyAppOptions) Get(o string) interface{}
Get implements AppOptions
type GenerateAccountStrategy ¶
type GenerateAccountStrategy func(int) []sdk.AccAddress