34 lines
1.0 KiB
Go
34 lines
1.0 KiB
Go
package simulation
|
|
|
|
import (
|
|
"math/rand"
|
|
|
|
simappparams "github.com/cosmos/cosmos-sdk/simapp/params"
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
|
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
|
|
"github.com/cosmos/cosmos-sdk/x/simulation"
|
|
)
|
|
|
|
// OpWeightSubmitTextProposal app params key for text proposal
|
|
const OpWeightSubmitTextProposal = "op_weight_submit_text_proposal"
|
|
|
|
// ProposalContents defines the module weighted proposals' contents
|
|
func ProposalContents() []simtypes.WeightedProposalContent {
|
|
return []simtypes.WeightedProposalContent{
|
|
simulation.NewWeightedProposalContent(
|
|
OpWeightMsgDeposit,
|
|
simappparams.DefaultWeightTextProposal,
|
|
SimulateTextProposalContent,
|
|
),
|
|
}
|
|
}
|
|
|
|
// SimulateTextProposalContent returns a random text proposal content.
|
|
func SimulateTextProposalContent(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) simtypes.Content {
|
|
return v1beta1.NewTextProposal(
|
|
simtypes.RandStringOfLength(r, 140),
|
|
simtypes.RandStringOfLength(r, 5000),
|
|
)
|
|
}
|