simulation

package
v7.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 24 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"
	OpWeightMsgGrantTreasuryAuthorization  = "op_weight_msg_grant_treasury_authorization"
	OpWeightMsgRevokeTreasuryAuthorization = "op_weight_msg_revoke_treasury_authorization"
	OpWeightMsgGrantAllowance              = "op_weight_msg_grant_allowance"
	OpWeightMsgRevokeAllowance             = "op_weight_msg_revoke_allowance"

	DefaultGasValue = 200_000
)

Simulation operation weights constants

View Source
const (
	DefaultWeightMsgUpdateParams int = 100

	OpWeightMsgUpdateSubspaceFeeTokens = "op_weight_msg_update_subspace_fee_tokens" //nolint:gosec
)

Simulation operation weights constants

Variables

This section is empty.

Functions

func GenerateRandomFeeTokens

func GenerateRandomFeeTokens(r *rand.Rand) sdk.Coins

GenerateRandomFeeTokens generates a list of fee tokens

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 ProposalMsgs

func ProposalMsgs(k *keeper.Keeper) []simtypes.WeightedProposalMsg

ProposalMsgs defines the module weighted proposals' contents

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 RandomGrant

func RandomGrant(r *rand.Rand, grants []types.Grant) types.Grant

RandomGrant returns a random user grant from the slice given

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,
) simtypes.Operation

SimulateMsgAddUserToUserGroup tests and runs a single MsgAddUserToUserGroup

func SimulateMsgCreateSection

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

SimulateMsgCreateSection tests and runs a single MsgCreateSection

func SimulateMsgCreateSubspace

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

SimulateMsgCreateSubspace tests and runs a single MsgCreateSubspace

func SimulateMsgCreateUserGroup

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

SimulateMsgCreateUserGroup tests and runs a single MsgCreateUserGroup

func SimulateMsgDeleteSection

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

SimulateMsgDeleteSection tests and runs a single MsgDeleteSection

func SimulateMsgDeleteSubspace

func SimulateMsgDeleteSubspace(
	k *keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.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,
) simtypes.Operation

SimulateMsgDeleteUserGroup tests and runs a single MsgDeleteUserGroup

func SimulateMsgEditSection

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

SimulateMsgEditSection tests and runs a single MsgEditSection

func SimulateMsgEditSubspace

func SimulateMsgEditSubspace(
	k *keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.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,
) simtypes.Operation

SimulateMsgEditUserGroup tests and runs a single MsgEditUserGroup

func SimulateMsgGrantAllowance

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

SimulateMsgGrantAllowance tests and runs a single MsgGrantAllowance

func SimulateMsgGrantTreasuryAuthorization

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

SimulateMsgGrantTreasuryAuthorization tests and runs a single MsgGrantTreasuryAuthorization

func SimulateMsgMoveSection

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

SimulateMsgMoveSection tests and runs a single MsgMoveSection

func SimulateMsgMoveUserGroup

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

SimulateMsgMoveUserGroup tests and runs a single MsgMoveUserGroup

func SimulateMsgRemoveUserFromUserGroup

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

SimulateMsgRemoveUserFromUserGroup tests and runs a single MsgRemoveUserFromUserGroup

func SimulateMsgRevokeAllowance

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

SimulateMsgRevokeAllowance tests and runs a single MsgRevokeAllowance

func SimulateMsgRevokeTreasuryAuthorization

func SimulateMsgRevokeTreasuryAuthorization(
	k *keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, authzk authzkeeper.Keeper,
) simtypes.Operation

SimulateMsgRevokeTreasuryAuthorization tests and runs a single MsgRevokeTreasuryAuthorization

func SimulateMsgSetUserGroupPermissions

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

SimulateMsgSetUserGroupPermissions tests and runs a single MsgSetUserGroupPermissions

func SimulateMsgSetUserPermissions

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

SimulateMsgSetUserPermissions tests and runs a single MsgSetUserPermissions

func SimulateMsgUpdateSubspaceFeeTokens

func SimulateMsgUpdateSubspaceFeeTokens(k *keeper.Keeper) simtypes.MsgSimulatorFn

SimulateMsgUpdateParams returns a random MsgUpdateParams

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