simulation

package
v1.20.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxSupply              = "max_supply"
	EnableGovernance       = "enable_governance"
	UnrestrictedDenomRegex = "unresticted_denom_regex"
)

Simulation parameter constants

View Source
const (
	//nolint:gosec // not credentials
	OpWeightMsgAddMarker = "op_weight_msg_add_marker"
	//nolint:gosec // not credentials
	OpWeightMsgChangeStatus = "op_weight_msg_change_status"
	//nolint:gosec // not credentials
	OpWeightMsgAddAccess = "op_weight_msg_add_access"
	//nolint:gosec // not credentials
	OpWeightMsgAddActivateFinalizeMarker = "op_weight_msg_add_finalize_activate_marker"
	//nolint:gosec // not credentials
	OpWeightMsgAddMarkerProposal = "op_weight_msg_add_marker_proposal"
	//nolint:gosec // not credentials
	OpWeightMsgSetAccountData = "op_weight_msg_set_account_data"
	//nolint:gosec // not credentials
	OpWeightMsgUpdateSendDenyList = "op_weight_msg_update_send_deny_list"
)

Simulation operation weights constants

Variables

This section is empty.

Functions

func Dispatch added in v1.7.0

Dispatch sends an operation to the chain using a given account/funds on account for fees. Failures on the server side are handled as no-op msg operations with the error string as the status/response.

func GenEnableGovernance added in v1.7.0

func GenEnableGovernance(r *rand.Rand) bool

GenEnableGovernance returns a randomized EnableGovernance parameter.

func GenMaxSupply added in v1.17.0

func GenMaxSupply(r *rand.Rand) sdkmath.Int

GenMaxSupply randomized Maximum amount of supply to allow for markers

func GenUnrestrictedDenomRegex added in v1.7.0

func GenUnrestrictedDenomRegex(r *rand.Rand) string

GenUnrestrictedDenomRegex returns a randomized length focused string for the unrestricted denom validation expression

func OperationMsgVote added in v1.15.0

func OperationMsgVote(args *WeightedOpsArgs, voter simtypes.Account, govPropID uint64, vote govtypes.VoteOption, comment string) simtypes.Operation

OperationMsgVote returns an operation that casts a yes vote on a gov prop from an account.

func ParamChanges added in v1.7.0

func ParamChanges(_ *rand.Rand) []simtypes.LegacyParamChange

ParamChanges defines the parameters that can be modified by param change proposals on the simulation

func RandomizedGenState

func RandomizedGenState(simState *module.SimulationState)

RandomizedGenState generates a random GenesisState for marker

func SendGovMsg added in v1.15.0

func SendGovMsg(args *SendGovMsgArgs) (bool, simtypes.OperationMsg, error)

SendGovMsg sends a msg as a gov prop. It returns whether to skip the rest, an operation message, and any error encountered.

func SimulateMsgAddAccess added in v1.7.0

func SimulateMsgAddAccess(k keeper.Keeper, args *WeightedOpsArgs) simtypes.Operation

SimulateMsgAddAccess will Add a random access to an account.

func SimulateMsgAddFinalizeActivateMarker added in v1.14.0

func SimulateMsgAddFinalizeActivateMarker(k keeper.Keeper, args *WeightedOpsArgs) simtypes.Operation

SimulateMsgAddFinalizeActivateMarker will bind a NAME under an existing name using a 40% probability of restricting it.

func SimulateMsgAddMarker added in v1.7.0

func SimulateMsgAddMarker(k keeper.Keeper, args *WeightedOpsArgs) simtypes.Operation

SimulateMsgAddMarker will Add a random marker with random configuration.

func SimulateMsgAddMarkerProposal added in v1.15.0

func SimulateMsgAddMarkerProposal(k keeper.Keeper, args *WeightedOpsArgs) simtypes.Operation

SimulateMsgAddMarkerProposal will broadcast a Add random Marker Proposal.

func SimulateMsgChangeStatus added in v1.7.0

func SimulateMsgChangeStatus(k keeper.Keeper, args *WeightedOpsArgs) simtypes.Operation

SimulateMsgChangeStatus will randomly change the status of the marker depending on it's current state.

func SimulateMsgSetAccountData added in v1.16.0

func SimulateMsgSetAccountData(k keeper.Keeper, args *WeightedOpsArgs) simtypes.Operation

SimulateMsgSetAccountData will set randomized account data to a marker.

func SimulateMsgUpdateSendDenyList added in v1.17.0

func SimulateMsgUpdateSendDenyList(k keeper.Keeper, args *WeightedOpsArgs) simtypes.Operation

SimulateMsgUpdateSendDenyList will update random marker with denied send addresses.

func WeightedOperations added in v1.7.0

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

Types

type SendGovMsgArgs added in v1.15.0

type SendGovMsgArgs struct {
	WeightedOpsArgs

	R       *rand.Rand
	App     *baseapp.BaseApp
	Ctx     sdk.Context
	Accs    []simtypes.Account
	ChainID string

	Sender  simtypes.Account
	Msg     sdk.Msg
	Deposit sdk.Coins
	Comment string

	Title   string
	Summary string
}

SendGovMsgArgs holds all the args available and needed for sending a gov msg.

type WeightedOpsArgs added in v1.15.0

type WeightedOpsArgs struct {
	SimState   module.SimulationState
	ProtoCodec *codec.ProtoCodec
	AK         authkeeper.AccountKeeperI
	BK         bankkeeper.Keeper
	GK         govkeeper.Keeper
	AttrK      types.AttrKeeper
}

WeightedOpsArgs holds all the args provided to WeightedOperations so that they can be passed on later more easily.

Jump to

Keyboard shortcuts

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