Documentation ¶
Index ¶
- Constants
- Variables
- func GenDepositMinInitialDepositRatio(r *rand.Rand) sdkmath.LegacyDec
- func GenDepositPeriod(r *rand.Rand) time.Duration
- func GenExpeditedMinDeposit(r *rand.Rand, bondDenom string) sdk.Coins
- func GenExpeditedThreshold(r *rand.Rand) sdkmath.LegacyDec
- func GenExpeditedVotingPeriod(r *rand.Rand) time.Duration
- func GenMinDeposit(r *rand.Rand, bondDenom string) sdk.Coins
- func GenMinDepositRatio(r *rand.Rand) sdkmath.LegacyDec
- func GenProposalCancelRate(r *rand.Rand) sdkmath.LegacyDec
- func GenQuorum(r *rand.Rand) sdkmath.LegacyDec
- func GenThreshold(r *rand.Rand) sdkmath.LegacyDec
- func GenVeto(r *rand.Rand) sdkmath.LegacyDec
- func GenVotingPeriod(r *rand.Rand) time.Duration
- func ProposalContents() []simtypes.WeightedProposalContent
- func ProposalMsgs() []simtypes.WeightedProposalMsg
- func RandomizedGenState(simState *module.SimulationState)
- func SimulateLegacyTextProposalContent(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) simtypes.Content
- func SimulateMsgCancelProposal(txGen client.TxConfig, ak types.AccountKeeper, bk types.BankKeeper, ...) simtypes.Operation
- func SimulateMsgDeposit(txGen client.TxConfig, ak types.AccountKeeper, bk types.BankKeeper, ...) simtypes.Operation
- func SimulateMsgSubmitLegacyProposal(txGen client.TxConfig, ak types.AccountKeeper, bk types.BankKeeper, ...) simtypes.Operation
- func SimulateMsgSubmitProposal(txGen client.TxConfig, ak types.AccountKeeper, bk types.BankKeeper, ...) simtypes.Operation
- func SimulateMsgVote(txGen client.TxConfig, ak types.AccountKeeper, bk types.BankKeeper, ...) simtypes.Operation
- func SimulateMsgVoteWeighted(txGen client.TxConfig, ak types.AccountKeeper, bk types.BankKeeper, ...) simtypes.Operation
- func SimulateTextProposal(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) sdk.Msg
- func WeightedOperations(appParams simtypes.AppParams, txGen client.TxConfig, ak types.AccountKeeper, ...) simulation.WeightedOperations
Constants ¶
const ( MinDeposit = "min_deposit" ExpeditedMinDeposit = "expedited_min_deposit" DepositPeriod = "deposit_period" MinInitialRatio = "min_initial_ratio" VotingPeriod = "voting_period" ExpeditedVotingPeriod = "expedited_voting_period" Quorum = "quorum" Threshold = "threshold" ExpeditedThreshold = "expedited_threshold" Veto = "veto" ProposalCancelRate = "proposal_cancel_rate" MinDepositRatio = "min_deposit_ratio" )
Simulation parameter constants
const ( OpWeightMsgDeposit = "op_weight_msg_deposit" OpWeightMsgVote = "op_weight_msg_vote" OpWeightMsgVoteWeighted = "op_weight_msg_weighted_vote" OpWeightMsgCancelProposal = "op_weight_msg_cancel_proposal" DefaultWeightMsgDeposit = 100 DefaultWeightMsgVote = 67 DefaultWeightMsgVoteWeighted = 33 DefaultWeightTextProposal = 5 DefaultWeightMsgCancelProposal = 5 )
Simulation operation weights constants
const OpWeightSubmitTextProposal = "op_weight_submit_text_proposal"
OpWeightSubmitTextProposal app params key for text proposal
Variables ¶
var ( TypeMsgDeposit = sdk.MsgTypeURL(&v1.MsgDeposit{}) TypeMsgVote = sdk.MsgTypeURL(&v1.MsgVote{}) TypeMsgVoteWeighted = sdk.MsgTypeURL(&v1.MsgVoteWeighted{}) TypeMsgSubmitProposal = sdk.MsgTypeURL(&v1.MsgSubmitProposal{}) TypeMsgCancelProposal = sdk.MsgTypeURL(&v1.MsgCancelProposal{}) )
Governance message types and routes
Functions ¶
func GenDepositMinInitialDepositRatio ¶
GenDepositMinInitialRatio returns randomized DepositMinInitialRatio
func GenDepositPeriod ¶
GenDepositPeriod returns randomized DepositPeriod
func GenExpeditedMinDeposit ¶
GenExpeditedMinDeposit returns randomized ExpeditedMinDeposit It is always greater than GenMinDeposit
func GenExpeditedThreshold ¶
GenExpeditedThreshold randomized ExpeditedThreshold
func GenExpeditedVotingPeriod ¶
GenExpeditedVotingPeriod randomized ExpeditedVotingPeriod
func GenMinDeposit ¶
GenMinDeposit returns randomized MinDeposit
func GenMinDepositRatio ¶
GenMinDepositRatio returns randomized DepositMinRatio
func GenProposalCancelRate ¶
GenProposalCancelRate returns randomized ProposalCancelRate
func GenThreshold ¶
GenThreshold returns randomized Threshold
func GenVotingPeriod ¶
GenVotingPeriod returns randomized VotingPeriod
func ProposalContents ¶
func ProposalContents() []simtypes.WeightedProposalContent
ProposalContents defines the module weighted proposals' contents
func ProposalMsgs ¶
func ProposalMsgs() []simtypes.WeightedProposalMsg
ProposalMsgs defines the module weighted proposals' contents
func RandomizedGenState ¶
func RandomizedGenState(simState *module.SimulationState)
RandomizedGenState generates a random GenesisState for gov
func SimulateLegacyTextProposalContent ¶
func SimulateLegacyTextProposalContent(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) simtypes.Content
SimulateTextProposalContent returns a random text proposal content.
func SimulateMsgCancelProposal ¶
func SimulateMsgCancelProposal( txGen client.TxConfig, ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper, ) simtypes.Operation
SimulateMsgCancelProposal generates a MsgCancelProposal.
func SimulateMsgDeposit ¶
func SimulateMsgDeposit( txGen client.TxConfig, ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper, ) simtypes.Operation
SimulateMsgDeposit generates a MsgDeposit with random values.
func SimulateMsgSubmitLegacyProposal ¶
func SimulateMsgSubmitLegacyProposal( txGen client.TxConfig, ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper, contentSim simtypes.ContentSimulatorFn, ) simtypes.Operation
SimulateMsgSubmitLegacyProposal simulates creating a msg Submit Proposal voting on the proposal, and subsequently slashing the proposal. It is implemented using future operations.
func SimulateMsgSubmitProposal ¶
func SimulateMsgSubmitProposal( txGen client.TxConfig, ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper, msgSim simtypes.MsgSimulatorFn, ) 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 ¶
func SimulateMsgVote( txGen client.TxConfig, ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper, ) simtypes.Operation
SimulateMsgVote generates a MsgVote with random values.
func SimulateMsgVoteWeighted ¶
func SimulateMsgVoteWeighted( txGen client.TxConfig, ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper, ) simtypes.Operation
SimulateMsgVoteWeighted generates a MsgVoteWeighted with random values.
func SimulateTextProposal ¶
SimulateTextProposal returns a random text proposal content. A text proposal is a proposal that contains no msgs.
func WeightedOperations ¶
func WeightedOperations( appParams simtypes.AppParams, txGen client.TxConfig, ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper, wMsgs []simtypes.WeightedProposalMsg, wContents []simtypes.WeightedProposalContent, ) simulation.WeightedOperations
WeightedOperations returns all the operations from the module with their respective weights
Types ¶
This section is empty.