Documentation ¶
Index ¶
- Constants
- func AddTestAddrsIncremental(app *xapp.XplaApp, ctx sdk.Context, accNum int, accAmt sdk.Int) []sdk.AccAddress
- func ConvertAddrsToValAddrs(addrs []sdk.AccAddress) []sdk.ValAddress
- func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey
- func DefaultConfig() network.Config
- func FundAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, ...) error
- func GenTx(gen client.TxConfig, msgs []sdk.Msg, feeAmt sdk.Coins, gas uint64, ...) (sdk.Tx, error)
- func NewAppConstructor(encodingCfg params.EncodingConfig) network.AppConstructor
- func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey)
- func NewTestEthSecpPrivKey(mnemonic string) (cryptotypes.PrivKey, error)
- func NewTestMnemonic(entropy []byte) (string, error)
- func RandomAccounts(r *rand.Rand, n int) []simtypes.Account
- func Setup(isCheckTx bool, invCheckPeriod uint) *xapp.XplaApp
- func TestAddr(addr string, bech string) (sdk.AccAddress, error)
- type GenerateAccountStrategy
Constants ¶
const ( DefaultTestGenTxGas = 1000000 TestChainId = "cude_1-1" )
Variables ¶
This section is empty.
Functions ¶
func AddTestAddrsIncremental ¶
func AddTestAddrsIncremental(app *xapp.XplaApp, 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 ConvertAddrsToValAddrs ¶
func ConvertAddrsToValAddrs(addrs []sdk.AccAddress) []sdk.ValAddress
ConvertAddrsToValAddrs converts the provided addresses to ValAddress.
func CreateTestPubKeys ¶
func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey
CreateTestPubKeys returns a total of numPubKeys public keys in ascending order.
func DefaultConfig ¶
DefaultConfig returns a sane default configuration suitable for nearly all testing requirements.
func FundAccount ¶
func FundAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, amounts sdk.Coins) error
FundAccount is a utility function that funds an account by minting and sending the coins to the address. This should be used for testing purposes only!
TODO: Instead of using the mint module account, which has the permission of minting, create a "faucet" account. (@fdymylja)
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 NewAppConstructor ¶
func NewAppConstructor(encodingCfg params.EncodingConfig) network.AppConstructor
NewAppConstructor returns a new AppConstructor
func NewPubKeyFromHex ¶
func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey)
NewPubKeyFromHex returns a PubKey from a hex string.
func NewTestEthSecpPrivKey ¶
func NewTestEthSecpPrivKey(mnemonic string) (cryptotypes.PrivKey, error)
func NewTestMnemonic ¶
func RandomAccounts ¶
RandomAccounts generates n random accounts
Types ¶
type GenerateAccountStrategy ¶
type GenerateAccountStrategy func(int) []sdk.AccAddress