Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeStore(cdc *codec.Codec, kvA, kvB kv.Pair) string
- func GetAccount(address sdk.Address, accs []sim.Account) *sim.Account
- func ParamChanges(r *rand.Rand) []simulation.ParamChange
- func RandomEmojiPostReaction(r *rand.Rand) types.PostReaction
- func RandomHashtag(r *rand.Rand) string
- func RandomMedias(r *rand.Rand, accs []sim.Account) types.PostMedias
- 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.Posts) (types.Post, int)
- func RandomPostID(r *rand.Rand, posts []types.Post) types.PostID
- func RandomPostReactionValue(r *rand.Rand) string
- func RandomReactionShortCode(r *rand.Rand) string
- func RandomReactionValue(r *rand.Rand) string
- func RandomSubspace(r *rand.Rand) string
- func RandomizedGenState(simState *module.SimulationState)
- func SimulateMsgAddPostReaction(k keeper.Keeper, ak auth.AccountKeeper) sim.Operation
- func SimulateMsgAnswerToPoll(k keeper.Keeper, ak auth.AccountKeeper) sim.Operation
- func SimulateMsgCreatePost(k keeper.Keeper, ak auth.AccountKeeper) sim.Operation
- func SimulateMsgEditPost(k keeper.Keeper, ak auth.AccountKeeper) sim.Operation
- func SimulateMsgRegisterReaction(k keeper.Keeper, ak auth.AccountKeeper) sim.Operation
- func SimulateMsgRemovePostReaction(k keeper.Keeper, ak auth.AccountKeeper) sim.Operation
- func WeightedOperations(appParams sim.AppParams, cdc *codec.Codec, k keeper.Keeper, ...) sim.WeightedOperations
- type PostData
- type PostReactionData
- type ReactionData
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" DefaultGasValue = 800000 )
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 DecodeStore ¶
DecodeStore unmarshals the KVPair's Reaction to the corresponding posts type
func GetAccount ¶
GetAccount gets the account having the given address from the accs list
func ParamChanges ¶ added in v0.8.0
func ParamChanges(r *rand.Rand) []simulation.ParamChange
func RandomEmojiPostReaction ¶ added in v0.7.0
func RandomEmojiPostReaction(r *rand.Rand) types.PostReaction
RandomEmojiPostReaction returns a random post reaction representing an emoji reaction
func RandomHashtag ¶ added in v0.4.0
RandomHashtag returns a random hashtag from the above random hashtags
func RandomMedias ¶
RandomMedias returns a randomly generated list of post medias
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 extracted post id from the list of posts given
func RandomPostReactionValue ¶ added in v0.4.0
RandomPostReactionValue returns a random post reaction value
func RandomReactionShortCode ¶ added in v0.4.0
RandomReactionShortCode return a random reaction shortCode
func RandomReactionValue ¶
RandomReactionValue returns a random reaction value
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 ¶ added in v0.4.0
SimulateMsgAddPostReaction tests and runs a single msg add reaction where the reacting user account already exists nolint: funlen
func SimulateMsgAnswerToPoll ¶
SimulateMsgAnswerToPoll tests and runs a single msg poll answer where the answering user account already exists nolint: funlen
func SimulateMsgCreatePost ¶
SimulateMsgCreatePost tests and runs a single msg create post where the post creator account already exists nolint: funlen
func SimulateMsgEditPost ¶
SimulateMsgEditPost tests and runs a single msg edit post where the post creator account already exists nolint: funlen
func SimulateMsgRegisterReaction ¶ added in v0.4.0
SimulateMsgRegisterReaction tests and runs a single msg register reaction where the registering user account already exist nolint: funlen
func SimulateMsgRemovePostReaction ¶ added in v0.4.0
SimulateMsgRemovePostReaction tests and runs a single msg remove reaction where the reacting user account already exists nolint: funlen
func WeightedOperations ¶
func WeightedOperations(appParams sim.AppParams, cdc *codec.Codec, k keeper.Keeper, ak auth.AccountKeeper) sim.WeightedOperations
WeightedOperations returns all the operations from the module with their respective weights
Types ¶
type PostData ¶
type PostData struct { Creator sim.Account ParentID types.PostID Message string AllowsComments bool Subspace string CreationDate time.Time OptionalData map[string]string Medias types.PostMedias PollData *types.PollData }
PostData contains the randomly generated data of a post
type PostReactionData ¶ added in v0.4.0
PostReactionData contains all the data needed for a post reaction to be properly added or removed from a post
func RandomPostReactionData ¶ added in v0.4.0
func RandomPostReactionData(r *rand.Rand, accs []sim.Account, postID types.PostID, shortCode, value string) PostReactionData
RandomPostReactionData returns a randomly generated post reaction data object
type ReactionData ¶
RegisteredReactionData contains all the data needed for a registered reaction to be properly registered
func RandomReactionData ¶
func RandomReactionData(r *rand.Rand, accs []sim.Account) ReactionData
RandomReactionData returns a randomly generated reaction data object
func RegisteredReactionsData ¶ added in v0.4.0
func RegisteredReactionsData(r *rand.Rand, accs []sim.Account) []ReactionData
RegisteredReactionsData returns all the possible registered reactions with given data