Documentation ¶
Index ¶
- Constants
- func GenerateRandomAttachment(r *rand.Rand, post types.Post, id uint32) types.Attachment
- func GenerateRandomAttachmentContent(r *rand.Rand, currentTime time.Time) types.AttachmentContent
- func GenerateRandomMedia(r *rand.Rand) *types.Media
- func GenerateRandomPoll(r *rand.Rand, currentTime time.Time) *types.Poll
- func GenerateRandomPost(r *rand.Rand, accounts []simtypes.Account, subspaceID uint64, sectionID uint32, ...) types.Post
- func GenerateRandomTags(r *rand.Rand, tagsNumber int) []string
- func GenerateRandomText(r *rand.Rand, maxLength uint32) string
- func NewDecodeStore(cdc codec.Codec) func(kvA, kvB kv.Pair) string
- func ProposalMsgs() []simtypes.WeightedProposalMsg
- func RandomAnswersIndexes(r *rand.Rand, poll *types.Poll) (answersIndexes []uint32)
- func RandomAttachment(r *rand.Rand, attachments []types.Attachment) types.Attachment
- func RandomMaxTextLength(r *rand.Rand) uint32
- func RandomPost(r *rand.Rand, posts []types.Post) types.Post
- func RandomPostOwnerTransferRequest(r *rand.Rand, requests []types.PostOwnerTransferRequest) types.PostOwnerTransferRequest
- func RandomReplySettings(r *rand.Rand) types.ReplySetting
- func RandomizeGenState(simState *module.SimulationState)
- func SimulateMsgAcceptPostOwnerTransferRequest(k *keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation
- func SimulateMsgAddPostAttachment(k *keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation
- func SimulateMsgAnswerPoll(k *keeper.Keeper, sk types.SubspacesKeeper, ak authkeeper.AccountKeeper, ...) simtypes.Operation
- func SimulateMsgCancelPostOwnerTransferRequest(k *keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation
- func SimulateMsgCreatePost(k *keeper.Keeper, sk types.SubspacesKeeper, ak authkeeper.AccountKeeper, ...) simtypes.Operation
- func SimulateMsgDeletePost(k *keeper.Keeper, sk types.SubspacesKeeper, ak authkeeper.AccountKeeper, ...) simtypes.Operation
- func SimulateMsgEditPost(k *keeper.Keeper, sk types.SubspacesKeeper, ak authkeeper.AccountKeeper, ...) simtypes.Operation
- func SimulateMsgMovePost(k *keeper.Keeper, sk types.SubspacesKeeper, ak authkeeper.AccountKeeper, ...) simtypes.Operation
- func SimulateMsgRefusePostOwnerTransferRequest(k *keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation
- func SimulateMsgRemovePostAttachment(k *keeper.Keeper, sk types.SubspacesKeeper, ak authkeeper.AccountKeeper, ...) simtypes.Operation
- func SimulateMsgRequestPostOwnerTransfer(k *keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation
- func SimulateMsgUpdateParams(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) sdk.Msg
- func WeightedOperations(appParams simtypes.AppParams, cdc codec.JSONCodec, k *keeper.Keeper, ...) sim.WeightedOperations
Constants ¶
const ( DefaultWeightMsgCreatePost int = 80 DefaultWeightMsgEditPost int = 40 DefaultWeightMsgDeletePost int = 20 DefaultWeightMsgAddPostAttachment int = 50 DefaultWeightMsgRemovePostAttachment int = 50 DefaultWeightMsgAnswerPoll int = 50 DefaultWeightMsgMovePost int = 10 DefaultWeightMsgRequestPostOwnerTransfer int = 10 DefaultWeightMsgCancelPostOwnerTransferRequest int = 10 DefaultWeightMsgAcceptPostOwnerTransferRequest int = 10 DefaultWeightMsgRefusePostOwnerTransferRequest int = 10 OpWeightMsgCreatePost = "op_weight_msg_create_post" OpWeightMsgEditPost = "op_weight_msg_edit_post" OpWeightMsgDeletePost = "op_weight_msg_delete_post" OpWeightMsgAddPostAttachment = "op_weight_msg_add_post_attachment" OpWeightMsgRemovePostAttachment = "op_weight_msg_remove_post_attachment" OpWeightMsgAnswerPoll = "op_weight_msg_answer_poll" OpWeightMsgMovePost = "op_weight_msg_move_post" OpWeightMsgRequestPostOwnerTransfer = "op_weight_msg_request_post_owner_transfer" OpWeightMsgCancelPostOwnerTransferRequest = "op_weight_msg_cancel_post_owner_transfer_request" OpWeightMsgAcceptPostOwnerTransferRequest = "op_weight_msg_accept_post_owner_transfer_request" OpWeightMsgRefusePostOwnerTransferRequest = "op_weight_msg_refuse_post_owner_transfer_request" DefaultGasValue = 200000 )
Simulation operation weights constants
const ( DefaultWeightMsgUpdateParams int = 100 OpWeightMsgUpdateParams = "op_weight_msg_update_params" //nolint:gosec )
Simulation operation weights constants
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomAttachment ¶
GenerateRandomAttachment generates a random attachment
func GenerateRandomAttachmentContent ¶
GenerateRandomAttachmentContent returns a randomly generated attachment content
func GenerateRandomMedia ¶
GenerateRandomMedia returns a randomly generated media content
func GenerateRandomPoll ¶
GenerateRandomPoll returns a randomly generated poll content
func GenerateRandomPost ¶
func GenerateRandomPost(r *rand.Rand, accounts []simtypes.Account, subspaceID uint64, sectionID uint32, postID uint64, params types.Params) types.Post
GenerateRandomPost generates a random post
func GenerateRandomTags ¶
GenerateRandomTags returns a slice containing tagsNumber randomly generated tags
func GenerateRandomText ¶
GenerateRandomText returns a random text that does not exceed the given max length
func NewDecodeStore ¶
NewDecodeStore returns a new decoder that unmarshals the KVPair's Value to the corresponding subspaces type
func ProposalMsgs ¶
func ProposalMsgs() []simtypes.WeightedProposalMsg
ProposalMsgs defines the module weighted proposals' contents
func RandomAnswersIndexes ¶
RandomAnswersIndexes returns a random answers indexes slice based on the given poll
func RandomAttachment ¶
func RandomAttachment(r *rand.Rand, attachments []types.Attachment) types.Attachment
RandomAttachment returns a random attachment from the ones given
func RandomMaxTextLength ¶
RandomMaxTextLength returns a random max text length in the [30, 999] range
func RandomPost ¶
RandomPost returns a random post from the slice given
func RandomPostOwnerTransferRequest ¶
func RandomPostOwnerTransferRequest(r *rand.Rand, requests []types.PostOwnerTransferRequest) types.PostOwnerTransferRequest
RandomPostOwnerTransferRequest returns a random post owner transfer request from the ones given
func RandomReplySettings ¶
func RandomReplySettings(r *rand.Rand) types.ReplySetting
RandomReplySettings returns a random valid ReplySetting for the post
func RandomizeGenState ¶
func RandomizeGenState(simState *module.SimulationState)
RandomizeGenState generates a random GenesisState for posts
func SimulateMsgAcceptPostOwnerTransferRequest ¶
func SimulateMsgAcceptPostOwnerTransferRequest( k *keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgAcceptPostOwnerTransferRequest tests and runs a single msg accept post owner transfer request
func SimulateMsgAddPostAttachment ¶
func SimulateMsgAddPostAttachment( k *keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgAddPostAttachment tests and runs a single msg add post attachment
func SimulateMsgAnswerPoll ¶
func SimulateMsgAnswerPoll( k *keeper.Keeper, sk types.SubspacesKeeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgAnswerPoll tests and runs a single msg answer poll post
func SimulateMsgCancelPostOwnerTransferRequest ¶
func SimulateMsgCancelPostOwnerTransferRequest( k *keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgCancelPostOwnerTransferRequest tests and runs a single msg cancel post owner transfer request
func SimulateMsgCreatePost ¶
func SimulateMsgCreatePost( k *keeper.Keeper, sk types.SubspacesKeeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgCreatePost tests and runs a single msg create post
func SimulateMsgDeletePost ¶
func SimulateMsgDeletePost( k *keeper.Keeper, sk types.SubspacesKeeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgDeletePost tests and runs a single msg delete post
func SimulateMsgEditPost ¶
func SimulateMsgEditPost( k *keeper.Keeper, sk types.SubspacesKeeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgEditPost tests and runs a single msg edit post
func SimulateMsgMovePost ¶
func SimulateMsgMovePost( k *keeper.Keeper, sk types.SubspacesKeeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgMovePost tests and runs a single msg move post
func SimulateMsgRefusePostOwnerTransferRequest ¶
func SimulateMsgRefusePostOwnerTransferRequest( k *keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgRefusePostOwnerTransferRequest tests and runs a single msg refuse post owner transfer request
func SimulateMsgRemovePostAttachment ¶
func SimulateMsgRemovePostAttachment( k *keeper.Keeper, sk types.SubspacesKeeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgRemovePostAttachment tests and runs a single msg remove post attachment
func SimulateMsgRequestPostOwnerTransfer ¶
func SimulateMsgRequestPostOwnerTransfer( k *keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgRequestPostOwnerTransfer tests and runs a single msg request post owner transfer request
func SimulateMsgUpdateParams ¶
SimulateMsgUpdateParams returns a random MsgUpdateParams
func WeightedOperations ¶
func WeightedOperations( appParams simtypes.AppParams, cdc codec.JSONCodec, k *keeper.Keeper, sk types.SubspacesKeeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) sim.WeightedOperations
WeightedOperations returns all the operations from the module with their respective weights
Types ¶
This section is empty.