simulation

package
v0.0.0-...-0943177 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	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"

	DefaultGasValue = 200000
)

Simulation operation weights constants

Variables

This section is empty.

Functions

func GenerateRandomAttachment

func GenerateRandomAttachment(r *rand.Rand, post types.Post, id uint32) types.Attachment

GenerateRandomAttachment generates a random attachment

func GenerateRandomAttachmentContent

func GenerateRandomAttachmentContent(r *rand.Rand) types.AttachmentContent

GenerateRandomAttachmentContent returns a randomly generated attachment content

func GenerateRandomMedia

func GenerateRandomMedia(r *rand.Rand) *types.Media

GenerateRandomMedia returns a randomly generated media content

func GenerateRandomPoll

func GenerateRandomPoll(r *rand.Rand) *types.Poll

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

func GenerateRandomTags(r *rand.Rand, tagsNumber int) []string

GenerateRandomTags returns a slice containing tagsNumber randomly generated tags

func GenerateRandomText

func GenerateRandomText(r *rand.Rand, maxLength uint32) string

GenerateRandomText returns a random text that does not exceed the given max length

func NewDecodeStore

func NewDecodeStore(cdc codec.Codec) func(kvA, kvB kv.Pair) string

NewDecodeStore returns a new decoder that unmarshals the KVPair's Value to the corresponding subspaces type

func ParamChanges

func ParamChanges(r *rand.Rand) []simtypes.ParamChange

func RandomAnswersIndexes

func RandomAnswersIndexes(r *rand.Rand, poll *types.Poll) (answersIndexes []uint32)

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

func RandomMaxTextLength(r *rand.Rand) uint32

RandomMaxTextLength returns a random max text length in the [30, 999] range

func RandomPost

func RandomPost(r *rand.Rand, posts []types.Post) types.Post

RandomPost returns a random post from the slice 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 SimulateMsgAddPostAttachment

func SimulateMsgAddPostAttachment(
	k keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper,
) simtypes.Operation

SimulateMsgAddPostAttachment tests and runs a single msg add post attachment

func SimulateMsgAnswerPoll

SimulateMsgAnswerPoll tests and runs a single msg answer poll post

func SimulateMsgCreatePost

SimulateMsgCreatePost tests and runs a single msg create post

func SimulateMsgDeletePost

SimulateMsgDeletePost tests and runs a single msg delete post

func SimulateMsgEditPost

SimulateMsgEditPost tests and runs a single msg edit post

func SimulateMsgRemovePostAttachment

func SimulateMsgRemovePostAttachment(
	k keeper.Keeper, sk subspaceskeeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fk feeskeeper.Keeper,
) simtypes.Operation

SimulateMsgRemovePostAttachment tests and runs a single msg remove post attachment

func WeightedOperations

WeightedOperations returns all the operations from the module with their respective weights

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL