simulation

package
v0.46.4 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DepositParamsMinDeposit    = "deposit_params_min_deposit"
	DepositParamsDepositPeriod = "deposit_params_deposit_period"
	VotingParamsVotingPeriod   = "voting_params_voting_period"
	TallyParamsQuorum          = "tally_params_quorum"
	TallyParamsThreshold       = "tally_params_threshold"
	TallyParamsVeto            = "tally_params_veto"
)

Simulation parameter constants

View Source
const (
	OpWeightMsgDeposit      = "op_weight_msg_deposit"
	OpWeightMsgVote         = "op_weight_msg_vote"
	OpWeightMsgVoteWeighted = "op_weight_msg_weighted_vote"
)

Simulation operation weights constants

View Source
const OpWeightSubmitTextProposal = "op_weight_submit_text_proposal"

OpWeightSubmitTextProposal app params key for text proposal

Variables

View Source
var (
	TypeMsgDeposit        = sdk.MsgTypeURL(&v1.MsgDeposit{})
	TypeMsgVote           = sdk.MsgTypeURL(&v1.MsgVote{})
	TypeMsgVoteWeighted   = sdk.MsgTypeURL(&v1.MsgVoteWeighted{})
	TypeMsgSubmitProposal = sdk.MsgTypeURL(&v1.MsgSubmitProposal{})
)

Governance message types and routes

Functions

func GenDepositParamsDepositPeriod added in v0.46.1

func GenDepositParamsDepositPeriod(r *rand.Rand) time.Duration

GenDepositParamsDepositPeriod randomized DepositParamsDepositPeriod

func GenDepositParamsMinDeposit added in v0.46.1

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

GenDepositParamsMinDeposit randomized DepositParamsMinDeposit

func GenTallyParamsQuorum added in v0.46.1

func GenTallyParamsQuorum(r *rand.Rand) sdk.Dec

GenTallyParamsQuorum randomized TallyParamsQuorum

func GenTallyParamsThreshold added in v0.46.1

func GenTallyParamsThreshold(r *rand.Rand) sdk.Dec

GenTallyParamsThreshold randomized TallyParamsThreshold

func GenTallyParamsVeto added in v0.46.1

func GenTallyParamsVeto(r *rand.Rand) sdk.Dec

GenTallyParamsVeto randomized TallyParamsVeto

func GenVotingParamsVotingPeriod added in v0.46.1

func GenVotingParamsVotingPeriod(r *rand.Rand) time.Duration

GenVotingParamsVotingPeriod randomized VotingParamsVotingPeriod

func NewDecodeStore added in v0.46.1

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 gov type.

func ParamChanges added in v0.46.1

func ParamChanges(r *rand.Rand) []simtypes.ParamChange

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

func ProposalContents added in v0.46.1

func ProposalContents() []simtypes.WeightedProposalContent

ProposalContents defines the module weighted proposals' contents

func RandomizedGenState added in v0.46.1

func RandomizedGenState(simState *module.SimulationState)

RandomizedGenState generates a random GenesisState for gov

func SimulateMsgDeposit

func SimulateMsgDeposit(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simtypes.Operation

SimulateMsgDeposit generates a MsgDeposit with random values.

func SimulateMsgSubmitProposal

func SimulateMsgSubmitProposal(
	ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper, contentSim simtypes.ContentSimulatorFn,
) simtypes.Operation

SimulateMsgSubmitProposal simulates creating a msg Submit Proposal voting on the proposal, and subsequently slashing the proposal. It is implemented using future operations.

func SimulateMsgVote

SimulateMsgVote generates a MsgVote with random values.

func SimulateMsgVoteWeighted added in v0.46.1

func SimulateMsgVoteWeighted(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simtypes.Operation

SimulateMsgVoteWeighted generates a MsgVoteWeighted with random values.

func SimulateTextProposalContent added in v0.46.1

func SimulateTextProposalContent(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) simtypes.Content

SimulateTextProposalContent returns a random text proposal content.

func WeightedOperations added in v0.46.1

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