Documentation ¶
Index ¶
- Constants
- func DefaultSimulationCodeIDSelector(ctx sdk.Context, wasmKeeper WasmKeeper) uint64
- func DefaultSimulationExecutePayloader(msg *wasmtypes.MsgExecuteContract) error
- func DefaultSimulationExecuteSenderSelector(wasmKeeper WasmKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, ...) (simtypes.Account, error)
- func GenAndDeliverTx(txCtx simulation.OperationInput, fees sdk.Coins, gas uint64) (simtypes.OperationMsg, []simtypes.FutureOperation, error)
- func GenAndDeliverTxWithRandFees(txCtx simulation.OperationInput, gas uint64) (simtypes.OperationMsg, []simtypes.FutureOperation, error)
- func NewDecodeStore() func(kvA kv.Pair, kvB kv.Pair) string
- func RandomizedGenState(simstate *module.SimulationState)
- func SimulateMsgExecuteContract(ak wasmtypes.AccountKeeper, bk BankKeeper, wasmKeeper WasmKeeper, ...) simtypes.Operation
- func SimulateMsgInstantiateContract(ak wasmtypes.AccountKeeper, bk BankKeeper, wasmKeeper WasmKeeper, ...) simtypes.Operation
- func SimulateMsgStoreCode(ak wasmtypes.AccountKeeper, bk simulation.BankKeeper, wasmKeeper WasmKeeper, ...) simtypes.Operation
- func TgradeSimulationCodeIDSelector(ctx sdk.Context, wasmKeeper WasmKeeper) uint64
- func TgradeSimulationExecuteContractSelector(ctx sdk.Context, wasmKeeper WasmKeeper) sdk.AccAddress
- func WeightedOperations(simstate *module.SimulationState, ak wasmtypes.AccountKeeper, bk BankKeeper, ...) simulation.WeightedOperations
- type BankKeeper
- type ChainQuery
- type ChainResponse
- type CodeIDSelector
- type MsgExecuteContractSelector
- type MsgExecutePayloader
- type MsgExecuteSenderSelector
- type OwnerPayload
- type OwnerResponse
- type ReflectHandleMsg
- type ReflectPayload
- type ReflectQueryMsg
- type ReflectSubPayload
- type SubCall
- type Text
- type WasmKeeper
Constants ¶
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 DefaultSimulationCodeIDSelector ¶
func DefaultSimulationCodeIDSelector(ctx sdk.Context, wasmKeeper WasmKeeper) uint64
DefaultSimulationCodeIDSelector picks the first code id
func DefaultSimulationExecutePayloader ¶
func DefaultSimulationExecutePayloader(msg *wasmtypes.MsgExecuteContract) error
DefaultSimulationExecutePayloader implements a bank msg to send the tokens from contract account back to original sender
func DefaultSimulationExecuteSenderSelector ¶
func DefaultSimulationExecuteSenderSelector(wasmKeeper WasmKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, accs []simtypes.Account) (simtypes.Account, error)
DefaultSimulationExecuteSenderSelector queries reflect contract for owner address and selects accounts
func GenAndDeliverTx ¶
func GenAndDeliverTx(txCtx simulation.OperationInput, fees sdk.Coins, gas uint64) (simtypes.OperationMsg, []simtypes.FutureOperation, error)
GenAndDeliverTx generates a transactions and delivers it.
func GenAndDeliverTxWithRandFees ¶
func GenAndDeliverTxWithRandFees(txCtx simulation.OperationInput, gas uint64) (simtypes.OperationMsg, []simtypes.FutureOperation, error)
GenAndDeliverTxWithRandFees generates a transaction with a random fee and delivers it.
func NewDecodeStore ¶
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 SimulateMsgExecuteContract ¶
func SimulateMsgExecuteContract( ak wasmtypes.AccountKeeper, bk BankKeeper, wasmKeeper WasmKeeper, contractSelector MsgExecuteContractSelector, senderSelector MsgExecuteSenderSelector, payloader MsgExecutePayloader, ) simtypes.Operation
SimulateMsgExecuteContract create a execute message a reflect contract instance
func SimulateMsgInstantiateContract ¶
func SimulateMsgInstantiateContract(ak wasmtypes.AccountKeeper, bk BankKeeper, wasmKeeper WasmKeeper, codeSelector CodeIDSelector) simtypes.Operation
SimulateMsgInstantiateContract generates a MsgInstantiateContract with random values
func SimulateMsgStoreCode ¶
func SimulateMsgStoreCode(ak wasmtypes.AccountKeeper, bk simulation.BankKeeper, wasmKeeper WasmKeeper, wasmBz []byte, gas uint64) simtypes.Operation
SimulateMsgStoreCode generates a MsgStoreCode with random values
func TgradeSimulationCodeIDSelector ¶
func TgradeSimulationCodeIDSelector(ctx sdk.Context, wasmKeeper WasmKeeper) uint64
func TgradeSimulationExecuteContractSelector ¶
func TgradeSimulationExecuteContractSelector(ctx sdk.Context, wasmKeeper WasmKeeper) sdk.AccAddress
TgradeSimulationExecuteContractSelector picks the first non PoE contract address
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 ChainQuery ¶
type ChainQuery struct {
Request *typwasmvmtypes.QueryRequest `json:"request,omitempty"`
}
type ChainResponse ¶
type ChainResponse struct {
Data []byte `json:"data,omitempty"`
}
type CodeIDSelector ¶
type CodeIDSelector = func(ctx sdk.Context, wasmKeeper WasmKeeper) uint64
CodeIDSelector returns code id to be used in simulations
type MsgExecuteContractSelector ¶
type MsgExecuteContractSelector = func(ctx sdk.Context, wasmKeeper WasmKeeper) sdk.AccAddress
MsgExecuteContractSelector returns contract address to be used in simulations
type MsgExecutePayloader ¶
type MsgExecutePayloader func(msg *wasmtypes.MsgExecuteContract) error
MsgExecutePayloader extension point to modify msg with custom payload
type MsgExecuteSenderSelector ¶
type MsgExecuteSenderSelector func(wasmKeeper WasmKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, accs []simtypes.Account) (simtypes.Account, error)
MsgExecuteSenderSelector extension point that returns the sender address
type OwnerPayload ¶
type OwnerResponse ¶
type OwnerResponse struct {
Owner string `json:"owner,omitempty"`
}
type ReflectHandleMsg ¶
type ReflectHandleMsg struct { Reflect *ReflectPayload `json:"reflect_msg,omitempty"` ReflectSubMsg *ReflectSubPayload `json:"reflect_sub_msg,omitempty"` ChangeOwner *OwnerPayload `json:"change_owner,omitempty"` }
ReflectHandleMsg is used to encode handle messages
type ReflectPayload ¶
type ReflectPayload struct {
Msgs []typwasmvmtypes.CosmosMsg `json:"msgs"`
}
type ReflectQueryMsg ¶
type ReflectQueryMsg struct { Owner *struct{} `json:"owner,omitempty"` Capitalized *Text `json:"capitalized,omitempty"` Chain *ChainQuery `json:"chain,omitempty"` SubMsgResult *SubCall `json:"sub_msg_result,omitempty"` }
ReflectQueryMsg is used to encode query messages
type ReflectSubPayload ¶
type ReflectSubPayload struct {
Msgs []typwasmvmtypes.SubMsg `json:"msgs"`
}
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