simulation

package
v0.0.0-...-0943177 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpWeightMsgCreateSubspace          = "op_weight_msg_create_subspace"
	OpWeightMsgEditSubspace            = "op_weight_msg_edit_subspace"
	OpWeightMsgDeleteSubspace          = "op_weight_msg_delete_subspace"
	OpWeightMsgCreateSection           = "op_weight_msg_create_section"
	OpWeightMsgEditSection             = "op_weight_msg_edit_section"
	OpWeightMsgMoveSection             = "op_weight_msg_move_section"
	OpWeightMsgDeleteSection           = "op_weight_msg_delete_section"
	OpWeightMsgCreateUserGroup         = "op_weight_msg_create_user_group"
	OpWeightMsgEditUserGroup           = "op_weight_msg_edit_user_group"
	OpWeightMsgMoveUserGroup           = "op_weight_msg_move_user_group"
	OpWeightMsgSetUserGroupPermissions = "op_weight_msg_set_user_group_permissions"
	OpWeightMsgDeleteUserGroup         = "op_weight_msg_delete_user_group"
	OpWeightMsgAddUserToUserGroup      = "op_weight_msg_add_user_to_user_group"
	OpWeightMsgRemoveUserFromUserGroup = "op_weight_msg_remove_user_from_user_group"
	OpWeightMsgSetUserPermissions      = "op_weight_msg_set_user_permissions"

	DefaultGasValue = 200_000
)

Simulation operation weights constants #nosec G101 -- This is a false positive

Variables

This section is empty.

Functions

func GenerateRandomSubspace

func GenerateRandomSubspace(r *rand.Rand, accs []simtypes.Account) types.Subspace

GenerateRandomSubspace generates a new subspace containing random data

func GetAccount

func GetAccount(address string, 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 RandomAddress

func RandomAddress(r *rand.Rand, addresses []string) string

RandomAddress returns a random address from the slice given

func RandomAuthAccount

func RandomAuthAccount(r *rand.Rand, accounts []authtypes.AccountI) authtypes.AccountI

RandomAuthAccount returns a random account from the slice given

func RandomDate

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

RandomDate returns a random post creation date

func RandomDescription

func RandomDescription(r *rand.Rand) string

RandomDescription returns a random subspace description

func RandomGroup

func RandomGroup(r *rand.Rand, groups []types.UserGroup) types.UserGroup

RandomGroup returns a random group selecting it from the list of groups given

func RandomID

func RandomID(r *rand.Rand) uint64

RandomID returns a new random ID

func RandomName

func RandomName(r *rand.Rand) string

RandomName returns a random subspace name

func RandomPermission

func RandomPermission(r *rand.Rand, permissions []types.Permissions) types.Permissions

RandomPermission returns a random permission from the given slice

func RandomSection

func RandomSection(r *rand.Rand, sections []types.Section) types.Section

RandomSection returns a randomly selected section from the slice given

func RandomSectionDescription

func RandomSectionDescription(r *rand.Rand) string

RandomSectionDescription returns a random section description

func RandomSectionName

func RandomSectionName(r *rand.Rand) string

RandomSectionName returns a random section name

func RandomSubspace

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

RandomSubspace picks a random subspace from an array and returns its position as well as value.

func RandomizeGenState

func RandomizeGenState(simState *module.SimulationState)

RandomizeGenState generates a random GenesisState for subspaces

func SimulateMsgAddUserToUserGroup

func SimulateMsgAddUserToUserGroup(
	k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper,
) simtypes.Operation

SimulateMsgAddUserToUserGroup tests and runs a single MsgAddUserToUserGroup

func SimulateMsgCreateSection

func SimulateMsgCreateSection(
	k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper,
) simtypes.Operation

SimulateMsgCreateSection tests and runs a single MsgCreateSection

func SimulateMsgCreateSubspace

func SimulateMsgCreateSubspace(
	ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper,
) simtypes.Operation

SimulateMsgCreateSubspace tests and runs a single MsgCreateSubspace

func SimulateMsgCreateUserGroup

func SimulateMsgCreateUserGroup(
	k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper,
) simtypes.Operation

SimulateMsgCreateUserGroup tests and runs a single MsgCreateUserGroup

func SimulateMsgDeleteSection

func SimulateMsgDeleteSection(
	k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper,
) simtypes.Operation

SimulateMsgDeleteSection tests and runs a single MsgDeleteSection

func SimulateMsgDeleteSubspace

func SimulateMsgDeleteSubspace(
	k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper,
) simtypes.Operation

SimulateMsgDeleteSubspace tests and runs a single msg delete subspace

func SimulateMsgDeleteUserGroup

func SimulateMsgDeleteUserGroup(
	k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper,
) simtypes.Operation

SimulateMsgDeleteUserGroup tests and runs a single MsgDeleteUserGroup

func SimulateMsgEditSection

func SimulateMsgEditSection(
	k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper,
) simtypes.Operation

SimulateMsgEditSection tests and runs a single MsgEditSection

func SimulateMsgEditSubspace

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

SimulateMsgEditSubspace tests and runs a single msg edit subspace

func SimulateMsgEditUserGroup

func SimulateMsgEditUserGroup(
	k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper,
) simtypes.Operation

SimulateMsgEditUserGroup tests and runs a single MsgEditUserGroup

func SimulateMsgMoveSection

func SimulateMsgMoveSection(
	k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper,
) simtypes.Operation

SimulateMsgMoveSection tests and runs a single MsgMoveSection

func SimulateMsgMoveUserGroup

func SimulateMsgMoveUserGroup(
	k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper,
) simtypes.Operation

SimulateMsgMoveUserGroup tests and runs a single MsgMoveUserGroup

func SimulateMsgRemoveUserFromUserGroup

func SimulateMsgRemoveUserFromUserGroup(
	k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper,
) simtypes.Operation

SimulateMsgRemoveUserFromUserGroup tests and runs a single MsgRemoveUserFromUserGroup

func SimulateMsgSetUserGroupPermissions

func SimulateMsgSetUserGroupPermissions(
	k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper,
) simtypes.Operation

SimulateMsgSetUserGroupPermissions tests and runs a single MsgSetUserGroupPermissions

func SimulateMsgSetUserPermissions

func SimulateMsgSetUserPermissions(
	k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper,
) simtypes.Operation

SimulateMsgSetUserPermissions tests and runs a single MsgSetUserPermissions

func WeightedOperations

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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