simulation

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: Apache-2.0 Imports: 23 Imported by: 8

Documentation

Index

Constants

View Source
const (
	GroupInfo       = "group-info"
	GroupMembers    = "group-members"
	GroupPolicyInfo = "group-policy-info"
	GroupProposals  = "group-proposals"
	GroupVote       = "group-vote"
)
View Source
const (
	OpMsgCreateGroup                     = "op_weight_msg_create_group"
	OpMsgUpdateGroupAdmin                = "op_weight_msg_update_group_admin"
	OpMsgUpdateGroupMetadata             = "op_wieght_msg_update_group_metadata"
	OpMsgUpdateGroupMembers              = "op_weight_msg_update_group_members"
	OpMsgCreateGroupPolicy               = "op_weight_msg_create_group_account"
	OpMsgCreateGroupWithPolicy           = "op_weight_msg_create_group_with_policy"
	OpMsgUpdateGroupPolicyAdmin          = "op_weight_msg_update_group_account_admin"
	OpMsgUpdateGroupPolicyDecisionPolicy = "op_weight_msg_update_group_account_decision_policy"
	OpMsgUpdateGroupPolicyMetaData       = "op_weight_msg_update_group_account_metadata"
	OpMsgSubmitProposal                  = "op_weight_msg_submit_proposal"
	OpMsgWithdrawProposal                = "op_weight_msg_withdraw_proposal"
	OpMsgVote                            = "op_weight_msg_vote"
	OpMsgExec                            = "ops_weight_msg_exec"
	OpMsgLeaveGroup                      = "ops_weight_msg_leave_group"
)

Simulation operation weights constants will be removed in the future

View Source
const (
	WeightMsgCreateGroup                     = 100
	WeightMsgCreateGroupPolicy               = 50
	WeightMsgSubmitProposal                  = 90
	WeightMsgVote                            = 90
	WeightMsgExec                            = 90
	WeightMsgLeaveGroup                      = 5
	WeightMsgUpdateGroupMetadata             = 5
	WeightMsgUpdateGroupAdmin                = 5
	WeightMsgUpdateGroupMembers              = 5
	WeightMsgUpdateGroupPolicyAdmin          = 5
	WeightMsgUpdateGroupPolicyDecisionPolicy = 5
	WeightMsgUpdateGroupPolicyMetadata       = 5
	WeightMsgWithdrawProposal                = 20
	WeightMsgCreateGroupWithPolicy           = 50
)

If update group or group policy txn's executed, `SimulateMsgVote` & `SimulateMsgExec` txn's returns `noOp`. That's why we have less weight for update group & group-policy txn's. will be removed in the future

Variables

View Source
var (
	TypeMsgCreateGroup                     = sdk.MsgTypeURL(&group.MsgCreateGroup{})
	TypeMsgUpdateGroupMembers              = sdk.MsgTypeURL(&group.MsgUpdateGroupMembers{})
	TypeMsgUpdateGroupAdmin                = sdk.MsgTypeURL(&group.MsgUpdateGroupAdmin{})
	TypeMsgUpdateGroupMetadata             = sdk.MsgTypeURL(&group.MsgUpdateGroupMetadata{})
	TypeMsgCreateGroupWithPolicy           = sdk.MsgTypeURL(&group.MsgCreateGroupWithPolicy{})
	TypeMsgCreateGroupPolicy               = sdk.MsgTypeURL(&group.MsgCreateGroupPolicy{})
	TypeMsgUpdateGroupPolicyAdmin          = sdk.MsgTypeURL(&group.MsgUpdateGroupPolicyAdmin{})
	TypeMsgUpdateGroupPolicyDecisionPolicy = sdk.MsgTypeURL(&group.MsgUpdateGroupPolicyDecisionPolicy{})
	TypeMsgUpdateGroupPolicyMetadata       = sdk.MsgTypeURL(&group.MsgUpdateGroupPolicyMetadata{})
	TypeMsgSubmitProposal                  = sdk.MsgTypeURL(&group.MsgSubmitProposal{})
	TypeMsgWithdrawProposal                = sdk.MsgTypeURL(&group.MsgWithdrawProposal{})
	TypeMsgVote                            = sdk.MsgTypeURL(&group.MsgVote{})
	TypeMsgExec                            = sdk.MsgTypeURL(&group.MsgExec{})
	TypeMsgLeaveGroup                      = sdk.MsgTypeURL(&group.MsgLeaveGroup{})
)

group message types will be removed in the future

Functions

func MsgCreateGroupFactory added in v0.53.0

func MsgCreateGroupFactory() simsx.SimMsgFactoryFn[*group.MsgCreateGroup]

func MsgCreateGroupPolicyFactory added in v0.53.0

func MsgCreateGroupPolicyFactory(k keeper.Keeper, s *SharedState) simsx.SimMsgFactoryFn[*group.MsgCreateGroupPolicy]

func MsgCreateGroupWithPolicyFactory added in v0.53.0

func MsgCreateGroupWithPolicyFactory() simsx.SimMsgFactoryFn[*group.MsgCreateGroupWithPolicy]

func MsgExecFactory added in v0.53.0

func MsgExecFactory(k keeper.Keeper, s *SharedState) simsx.SimMsgFactoryFn[*group.MsgExec]

func MsgLeaveGroupFactory added in v0.53.0

func MsgLeaveGroupFactory(k keeper.Keeper, s *SharedState) simsx.SimMsgFactoryFn[*group.MsgLeaveGroup]

func MsgSubmitProposalFactory added in v0.53.0

func MsgSubmitProposalFactory(k keeper.Keeper, s *SharedState) simsx.SimMsgFactoryFn[*group.MsgSubmitProposal]

func MsgUpdateGroupAdminFactory added in v0.53.0

func MsgUpdateGroupAdminFactory(k keeper.Keeper, s *SharedState) simsx.SimMsgFactoryFn[*group.MsgUpdateGroupAdmin]

func MsgUpdateGroupMembersFactory added in v0.53.0

func MsgUpdateGroupMembersFactory(k keeper.Keeper, s *SharedState) simsx.SimMsgFactoryFn[*group.MsgUpdateGroupMembers]

func MsgUpdateGroupMetadataFactory added in v0.53.0

func MsgUpdateGroupMetadataFactory(k keeper.Keeper, s *SharedState) simsx.SimMsgFactoryFn[*group.MsgUpdateGroupMetadata]

func MsgUpdateGroupPolicyAdminFactory added in v0.53.0

func MsgUpdateGroupPolicyAdminFactory(k keeper.Keeper, s *SharedState) simsx.SimMsgFactoryFn[*group.MsgUpdateGroupPolicyAdmin]

func MsgUpdateGroupPolicyDecisionPolicyFactory added in v0.53.0

func MsgUpdateGroupPolicyDecisionPolicyFactory(k keeper.Keeper, s *SharedState) simsx.SimMsgFactoryFn[*group.MsgUpdateGroupPolicyDecisionPolicy]

func MsgUpdateGroupPolicyMetadataFactory added in v0.53.0

func MsgUpdateGroupPolicyMetadataFactory(k keeper.Keeper, s *SharedState) simsx.SimMsgFactoryFn[*group.MsgUpdateGroupPolicyMetadata]

func MsgVoteFactory added in v0.53.0

func MsgVoteFactory(k keeper.Keeper, s *SharedState) simsx.SimMsgFactoryFn[*group.MsgVote]

func MsgWithdrawProposalFactory added in v0.53.0

func MsgWithdrawProposalFactory(k keeper.Keeper, s *SharedState) simsx.SimMsgFactoryFn[*group.MsgWithdrawProposal]

func NewDecodeStore

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

NewDecodeStore returns a decoder function closure that unmarshals the KVPair's Value to the corresponding group type.

func RandomizedGenState

func RandomizedGenState(simState *module.SimulationState)

RandomizedGenState generates a random GenesisState for the group module.

func SimulateMsgCreateGroup

func SimulateMsgCreateGroup(
	_ *codec.ProtoCodec,
	txGen client.TxConfig,
	ak group.AccountKeeper,
	bk group.BankKeeper,
) simtypes.Operation

SimulateMsgCreateGroup generates a MsgCreateGroup with random values migrate to the msg factories instead, this method will be removed in the future

func SimulateMsgCreateGroupPolicy

func SimulateMsgCreateGroupPolicy(
	cdc *codec.ProtoCodec,
	txGen client.TxConfig,
	ak group.AccountKeeper,
	bk group.BankKeeper,
	k keeper.Keeper,
) simtypes.Operation

SimulateMsgCreateGroupPolicy generates a NewMsgCreateGroupPolicy with random values migrate to the msg factories instead, this method will be removed in the future

func SimulateMsgCreateGroupWithPolicy

func SimulateMsgCreateGroupWithPolicy(
	_ *codec.ProtoCodec,
	txGen client.TxConfig,
	ak group.AccountKeeper,
	bk group.BankKeeper,
) simtypes.Operation

SimulateMsgCreateGroupWithPolicy generates a MsgCreateGroupWithPolicy with random values migrate to the msg factories instead, this method will be removed in the future

func SimulateMsgExec

SimulateMsgExec generates a MsgExec with random values migrate to the msg factories instead, this method will be removed in the future

func SimulateMsgLeaveGroup

func SimulateMsgLeaveGroup(
	_ *codec.ProtoCodec,
	txGen client.TxConfig,
	k keeper.Keeper,
	ak group.AccountKeeper,
	bk group.BankKeeper,
) simtypes.Operation

SimulateMsgLeaveGroup generates a MsgLeaveGroup with random values migrate to the msg factories instead, this method will be removed in the future

func SimulateMsgSubmitProposal

func SimulateMsgSubmitProposal(
	cdc *codec.ProtoCodec,
	txGen client.TxConfig,
	ak group.AccountKeeper,
	bk group.BankKeeper,
	k keeper.Keeper,
) simtypes.Operation

SimulateMsgSubmitProposal generates a NewMsgSubmitProposal with random values migrate to the msg factories instead, this method will be removed in the future

func SimulateMsgUpdateGroupAdmin

func SimulateMsgUpdateGroupAdmin(
	_ *codec.ProtoCodec,
	txGen client.TxConfig,
	ak group.AccountKeeper,
	bk group.BankKeeper,
	k keeper.Keeper,
) simtypes.Operation

SimulateMsgUpdateGroupAdmin generates a MsgUpdateGroupAdmin with random values migrate to the msg factories instead, this method will be removed in the future

func SimulateMsgUpdateGroupMembers

func SimulateMsgUpdateGroupMembers(
	_ *codec.ProtoCodec,
	txGen client.TxConfig,
	ak group.AccountKeeper,
	bk group.BankKeeper,
	k keeper.Keeper,
) simtypes.Operation

SimulateMsgUpdateGroupMembers generates a MsgUpdateGroupMembers with random values migrate to the msg factories instead, this method will be removed in the future

func SimulateMsgUpdateGroupMetadata

func SimulateMsgUpdateGroupMetadata(
	_ *codec.ProtoCodec,
	txGen client.TxConfig,
	ak group.AccountKeeper,
	bk group.BankKeeper,
	k keeper.Keeper,
) simtypes.Operation

SimulateMsgUpdateGroupMetadata generates a MsgUpdateGroupMetadata with random values migrate to the msg factories instead, this method will be removed in the future

func SimulateMsgUpdateGroupPolicyAdmin

func SimulateMsgUpdateGroupPolicyAdmin(
	_ *codec.ProtoCodec,
	txGen client.TxConfig,
	ak group.AccountKeeper,
	bk group.BankKeeper,
	k keeper.Keeper,
) simtypes.Operation

SimulateMsgUpdateGroupPolicyAdmin generates a MsgUpdateGroupPolicyAdmin with random values migrate to the msg factories instead, this method will be removed in the future

func SimulateMsgUpdateGroupPolicyDecisionPolicy

func SimulateMsgUpdateGroupPolicyDecisionPolicy(
	_ *codec.ProtoCodec,
	txGen client.TxConfig,
	ak group.AccountKeeper,
	bk group.BankKeeper,
	k keeper.Keeper,
) simtypes.Operation

SimulateMsgUpdateGroupPolicyDecisionPolicy generates a NewMsgUpdateGroupPolicyDecisionPolicy with random values migrate to the msg factories instead, this method will be removed in the future

func SimulateMsgUpdateGroupPolicyMetadata

func SimulateMsgUpdateGroupPolicyMetadata(
	_ *codec.ProtoCodec,
	txGen client.TxConfig,
	ak group.AccountKeeper,
	bk group.BankKeeper,
	k keeper.Keeper,
) simtypes.Operation

SimulateMsgUpdateGroupPolicyMetadata generates a MsgUpdateGroupPolicyMetadata with random values migrate to the msg factories instead, this method will be removed in the future

func SimulateMsgVote

SimulateMsgVote generates a MsgVote with random values migrate to the msg factories instead, this method will be removed in the future

func SimulateMsgWithdrawProposal

func SimulateMsgWithdrawProposal(
	_ *codec.ProtoCodec,
	txGen client.TxConfig,
	ak group.AccountKeeper,
	bk group.BankKeeper,
	k keeper.Keeper,
) simtypes.Operation

SimulateMsgWithdrawProposal generates a MsgWithdrawProposal with random values migrate to the msg factories instead, this method will be removed in the future

func WeightedOperations

WeightedOperations returns all the operations from the module with their respective weights migrate to the msg factories instead, this method will be removed in the future

Types

type SharedState added in v0.53.0

type SharedState struct {
	// contains filtered or unexported fields
}

SharedState shared state between message invocations

func NewSharedState added in v0.53.0

func NewSharedState() *SharedState

NewSharedState constructor

Jump to

Keyboard shortcuts

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