simulation

package
v0.0.0-...-7205676 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

README

Simulations package

Copied from a wasmd simulations branch and to be replaced when a release is available

Documentation

Index

Constants

View Source
const (
	OpWeightMsgStoreCode           = "op_weight_msg_store_code"
	OpWeightMsgInstantiateContract = "op_weight_msg_instantiate_contract"
	OpWeightMsgExecuteContract     = "op_weight_msg_execute_contract"
	OpReflectContractPath          = "op_reflect_contract_path"
)

Simulation operation weights constants

Variables

This section is empty.

Functions

func GridironSimulationCodeIDSelector

func GridironSimulationCodeIDSelector(ctx sdk.Context, wasmKeeper wasmsimulation.WasmKeeper) uint64

GridironSimulationCodeIDSelector picks the first code id with unrestricted permission

func GridironSimulationExecuteContractSelector

func GridironSimulationExecuteContractSelector(ctx sdk.Context, wasmKeeper wasmsimulation.WasmKeeper) sdk.AccAddress

GridironSimulationExecuteContractSelector picks the first non PoE contract address

func NewDecodeStore

func NewDecodeStore() func(kvA kv.Pair, kvB kv.Pair) string

NewDecodeStore returns a decoder function closure that unmarshals the KVPair's Value to the corresponding twasm type. Not fully implemented but falls back into default output

func RandomizedGenState

func RandomizedGenState(simstate *module.SimulationState)

RandomizedGenState generates a random GenesisState for wasm

func WeightedOperations

func WeightedOperations(
	simstate *module.SimulationState,
	ak wasmtypes.AccountKeeper,
	bk BankKeeper,
	wasmKeeper WasmKeeper,
) simulation.WeightedOperations

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

Types

type BankKeeper

type BankKeeper interface {
	simulation.BankKeeper
	IsSendEnabledCoin(ctx sdk.Context, coin sdk.Coin) bool
}

type WasmKeeper

type WasmKeeper interface {
	wasmsimulation.WasmKeeper
	IterateContractInfo(ctx sdk.Context, cb func(sdk.AccAddress, wasmtypes.ContractInfo) bool)
	QuerySmart(ctx sdk.Context, contractAddr sdk.AccAddress, req []byte) ([]byte, error)
	PeekAutoIncrementID(ctx sdk.Context, lastIDKey []byte) uint64
}

WasmKeeper is a subset of the wasm keeper used by simulations

Jump to

Keyboard shortcuts

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