Documentation ¶
Index ¶
- Constants
- Variables
- func GetAccount(address sdk.Address, accs []simtypes.Account) *simtypes.Account
- func NewDecodeStore(cdc codec.Marshaler) func(kvA, kvB kv.Pair) string
- func ParamChanges(r *rand.Rand) []simtypes.ParamChange
- func RandomAttachments(r *rand.Rand, accs []simtypes.Account) types.Attachments
- func RandomCommentsState(r *rand.Rand) types.CommentsState
- func RandomDate(r *rand.Rand) time.Time
- func RandomEmojiPostReaction(r *rand.Rand) types.PostReaction
- func RandomMessage(r *rand.Rand) string
- func RandomParams(r *rand.Rand) types.Params
- func RandomPollData(r *rand.Rand) *types.PollData
- func RandomPost(r *rand.Rand, posts []types.Post) (types.Post, int)
- func RandomPostID(r *rand.Rand) string
- func RandomPostIDFromPosts(r *rand.Rand, posts []types.Post) string
- func RandomReportMessage(r *rand.Rand) string
- func RandomReportTypes(r *rand.Rand) string
- func RandomSubspace(r *rand.Rand) string
- func RandomizedGenState(simState *module.SimulationState)
- func SimulateMsgAddPostReaction(k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation
- func SimulateMsgAnswerToPoll(k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation
- func SimulateMsgCreatePost(k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation
- func SimulateMsgEditPost(k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation
- func SimulateMsgRegisterReaction(k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation
- func SimulateMsgRemovePostReaction(k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation
- func SimulateMsgReportPost(pk postskeeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation
- func WeightedOperations(appParams simtypes.AppParams, cdc codec.JSONMarshaler, k keeper.Keeper, ...) sim.WeightedOperations
- type PostData
- type PostReactionData
- type ReactionData
- type ReportsData
Constants ¶
const ( OpWeightMsgCreatePost = "op_weight_msg_create_post" OpWeightMsgEditPost = "op_weight_msg_edit_post" OpWeightMsgAddReaction = "op_weight_msg_add_reaction" OpWeightMsgRemoveReaction = "op_weight_msg_remove_reaction" OpWeightMsgAnswerPoll = "op_weight_msg_answer_poll" OpWeightMsgRegisterReaction = "op_weight_msg_register_reaction" OpWeightMsgReportPost = "op_weight_msg_report_post" DefaultGasValue = 5_000_000 )
Simulation operation weights constants
Variables ¶
var ( RandomMimeTypes = []string{"audio/aac", "application/x-bzip2", "audio/ogg", "image/webp", "image/png"} RandomHosts = []string{"https://example.com/", "https://ipfs.ink/"} )
Functions ¶
func GetAccount ¶
GetAccount gets the account having the given address from the accs list
func NewDecodeStore ¶
NewDecodeStore returns a new decoder that unmarshals the KVPair's Value to the corresponding posts type
func ParamChanges ¶
func ParamChanges(r *rand.Rand) []simtypes.ParamChange
func RandomAttachments ¶
RandomAttachments returns a randomly generated list of post attachments
func RandomCommentsState ¶ added in v0.17.0
func RandomCommentsState(r *rand.Rand) types.CommentsState
RandomCommentsState returns a random comments state
func RandomDate ¶
RandomDate returns a random post creation date
func RandomEmojiPostReaction ¶
func RandomEmojiPostReaction(r *rand.Rand) types.PostReaction
RandomEmojiPostReaction returns a random post reaction representing an emoji reaction
func RandomMessage ¶
RandomMessage returns a random post message from the above random lorem phrases
func RandomPollData ¶
RandomPollData returns a randomly generated poll data
func RandomPost ¶
RandomPost picks and returns a random post from an array and returns its position in the array.
func RandomPostID ¶
RandomPostID returns a randomly generated postID
func RandomPostIDFromPosts ¶
RandomPostIDFromPosts returns a randomly extracted post id from the list of posts given
func RandomReportMessage ¶ added in v0.16.3
func RandomReportTypes ¶ added in v0.16.3
func RandomSubspace ¶
RandomSubspace returns a random post subspace from the above random subspaces
func RandomizedGenState ¶
func RandomizedGenState(simState *module.SimulationState)
RandomizedGenState generates a random GenesisState for auth
func SimulateMsgAddPostReaction ¶
func SimulateMsgAddPostReaction( k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgAddPostReaction tests and runs a single msg add reaction where the reacting user account already exists nolint: funlen
func SimulateMsgAnswerToPoll ¶
func SimulateMsgAnswerToPoll( k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgAnswerToPoll tests and runs a single msg poll answer where the answering user account already exists nolint: funlen
func SimulateMsgCreatePost ¶
func SimulateMsgCreatePost(k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) simtypes.Operation
SimulateMsgCreatePost tests and runs a single msg create post where the post creator account already exists nolint: funlen
func SimulateMsgEditPost ¶
func SimulateMsgEditPost( k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgEditPost tests and runs a single msg edit post where the post creator account already exists nolint: funlen
func SimulateMsgRegisterReaction ¶
func SimulateMsgRegisterReaction( k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgRegisterReaction tests and runs a single msg register reaction where the registering user account already exist nolint: funlen
func SimulateMsgRemovePostReaction ¶
func SimulateMsgRemovePostReaction( k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgRemovePostReaction tests and runs a single msg remove reaction where the reacting user account already exists nolint: funlen
func SimulateMsgReportPost ¶ added in v0.16.3
func SimulateMsgReportPost( pk postskeeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) simtypes.Operation
SimulateMsgReportPost tests and runs a single MsgReportPost created by a random account. nolint: funlen
func WeightedOperations ¶
func WeightedOperations( appParams simtypes.AppParams, cdc codec.JSONMarshaler, k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, ) sim.WeightedOperations
WeightedOperations returns all the operations from the module with their respective weights
Types ¶
type PostReactionData ¶
PostReactionData contains all the data needed for a post reaction to be properly added or removed from a post
func RandomPostReactionData ¶
func RandomPostReactionData( r *rand.Rand, accs []simtypes.Account, postID string, shortCode, value string, ) PostReactionData
RandomPostReactionData returns a randomly generated post reaction data object
type ReactionData ¶
ReactionData contains all the data needed for a registered reaction to be properly registered
func RandomReactionData ¶
func RandomReactionData(r *rand.Rand, accs []simtypes.Account) ReactionData
RandomReactionData returns a randomly generated reaction data object
func RandomReactionsData ¶
func RandomReactionsData(r *rand.Rand, accs []simtypes.Account) []ReactionData
type ReportsData ¶ added in v0.16.3
func RandomReportsData ¶ added in v0.16.3
RandomReportsData returns a randomly generated ReportsData based on the given random posts and accounts list