Documentation ¶
Index ¶
- Variables
- func CreateJwtTicket(claim jwt.MapClaims) (string, error)
- func GenerateOvmPublicKeys(n int) (pubKeys []string)
- func NewStakingHelper(t *testing.T, ctx sdk.Context, k stakingKeeper.Keeper) *stakingtestutil.Helper
- func RandomString(length int) string
- func SetAccountCoins(ctx *sdk.Context, k bankkeeper.Keeper, addr sdk.AccAddress, amount int64) error
- func SetModuleAccountCoins(ctx *sdk.Context, k bankkeeper.Keeper, moduleName string, amount int64) error
- func WriteKeyringFile(name string, dir string, contents []byte) error
- type Options
- type TestApp
- type TestUser
- type TestValidator
Constants ¶
This section is empty.
Variables ¶
var ( // TestParamUsers represents the map of simapp users TestParamUsers = make(map[string]TestUser) // TestParamValidatorAddresses represents the map of test validators TestParamValidatorAddresses = make(map[string]TestValidator) // TestOVMPublicKeys represents test public keys needed for ovm TestOVMPublicKeys []ed25519.PublicKey // TestOVMPrivateKeys represents test private keys needed for ovm TestOVMPrivateKeys []ed25519.PrivateKey )
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 parameters for tendermint consensus
var GenesisModuleAccountsBalances = map[string]int64{}
GenesisModuleAccountsBalances holds the test genesis module accounts balance map.
var PKs = createTestPubKeys(500)
PKs is a slice of public keys for test
Functions ¶
func GenerateOvmPublicKeys ¶ added in v0.0.6
func NewStakingHelper ¶
func NewStakingHelper(t *testing.T, ctx sdk.Context, k stakingKeeper.Keeper) *stakingtestutil.Helper
NewStakingHelper creates staking Handler wrapper for tests
func RandomString ¶ added in v0.0.8
func SetAccountCoins ¶
func SetAccountCoins(ctx *sdk.Context, k bankkeeper.Keeper, addr sdk.AccAddress, amount int64) error
SetAccountCoins sets the balance of accounts for testing
func SetModuleAccountCoins ¶
func SetModuleAccountCoins( ctx *sdk.Context, k bankkeeper.Keeper, moduleName string, amount int64, ) error
SetModuleAccountCoins sets the balance of accounts for testing
Types ¶
type Options ¶ added in v0.0.5
type Options struct {
CreateGenesisValidators bool
}
Options defines options related to simapp initialization
type TestApp ¶
TestApp is used as a container of the sge app
func GetTestObjects ¶
GetTestObjects gets the test objects and ingredients for testing phase start with default options
func GetTestObjectsWithOptions ¶
GetTestObjectsWithOptions gets the test objects and ingredients for testing phase start with custom options
func SetupWithGenesisAccounts ¶
func SetupWithGenesisAccounts( genAccs []authtypes.GenesisAccount, options Options, balances ...banktypes.Balance, ) *TestApp
SetupWithGenesisAccounts sets up the genesis accounts for testing
type TestUser ¶
type TestUser struct { PrvKey secp256k1.PrivKey Address sdk.AccAddress Balance int64 }
TestUser is simapp user type for testing
type TestValidator ¶
type TestValidator struct { PubKey types.PubKey Address sdk.ValAddress ConsAddress sdk.ConsAddress Power sdkmath.Int }
TestValidator is simapp validator type for testing