simulation

package
v2.3.0-testnet Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpWeightMsgCreateSubspace = "op_weight_msg_create_subspace"
	OpWeightMsgEditSubspace   = "op_weight_msg_edit_subspace"
	OpWeightMsgAddAdmin       = "op_weight_msg_add_admin"
	OpWeightMsgRemoveAdmin    = "op_weight_msg_remove_admin"
	OpWeightMsgRegisterUser   = "op_weight_msg_register_user"
	OpWeightMsgUnregisterUser = "op_weight_msg_unregister_user"
	OpWeightMsgBanUser        = "op_weight_msg_ban_user"
	OpWeightMsgUnbanUser      = "op_weight_msg_unban_user"

	DefaultGasValue = 500_000
)

Simulation operation weights constants

Variables

This section is empty.

Functions

func GetAccount

func GetAccount(address sdk.Address, accs []simtypes.Account) *simtypes.Account

GetAccount gets the account having the given address from the accs list

func NewDecodeStore

func NewDecodeStore(cdc codec.Codec) func(kvA, kvB kv.Pair) string

NewDecodeStore returns a new decoder that unmarshals the KVPair's Value to the corresponding subspaces type

func RandomDate

func RandomDate(r *rand.Rand) time.Time

RandomDate returns a random post creation date

func RandomName

func RandomName(r *rand.Rand) string

RandomName returns a random subspace name from the above random names

func RandomSubspace

func RandomSubspace(r *rand.Rand, subspaces []types.Subspace) (types.Subspace, int)

RandomSubspace picks and returns a random subspace from an array and returns its position in the array.

func RandomSubspaceID

func RandomSubspaceID(r *rand.Rand) string

RandomSubspaceID returns a random id from the above random ids array

func RandomSubspaceType

func RandomSubspaceType(r *rand.Rand) types.SubspaceType

RandomSubspaceType returns a random subspace type

func RandomizeGenState

func RandomizeGenState(simState *module.SimulationState)

RandomizeGenState generates a random GenesisState for subspaces

func SimulateMsgAddAdmin

SimulateMsgAddAdmin tests and runs a single msg add admin nolint: funlen

func SimulateMsgBanUser

SimulateMsgBanUser tests and runs a single msg ban user nolint: funlen

func SimulateMsgCreateSubspace

func SimulateMsgCreateSubspace(k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation

SimulateMsgCreateSubspace tests and runs a single msg create subspace nolint: funlen

func SimulateMsgEditSubspace

func SimulateMsgEditSubspace(
	k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper,
) simtypes.Operation

SimulateMsgEditSubspace tests and runs a single msg edit subspace nolint: funlen

func SimulateMsgRegisterUser

func SimulateMsgRegisterUser(k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation

SimulateMsgRegisterUser tests and runs a single msg register user nolint: funlen

func SimulateMsgRemoveAdmin

func SimulateMsgRemoveAdmin(k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation

SimulateMsgRemoveAdmin tests and runs a single msg remove admin nolint: funlen

func SimulateMsgUnbanUser

func SimulateMsgUnbanUser(k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation

SimulateMsgUnbanUser tests and runs a single msg unban user nolint: funlen

func SimulateMsgUnregisterUser

func SimulateMsgUnregisterUser(k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation

SimulateMsgUnregisterUser tests and runs a single msg unregister user nolint: funlen

func WeightedOperations

WeightedOperations returns all the operations from the module with their respective weights

Types

type SubspaceData

type SubspaceData struct {
	Subspace       types.Subspace
	CreatorAccount simtypes.Account
}

func RandomSubspaceData

func RandomSubspaceData(r *rand.Rand, accs []simtypes.Account) SubspaceData

Jump to

Keyboard shortcuts

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