Documentation
¶
Index ¶
- Constants
- func BuildOperationInput(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, msg interface{ ... }, ...) simulation.OperationInput
- func DefaultSimulateContractSelector(ctx sdk.Context, wasmKeeper WasmKeeper) sdk.AccAddress
- func DefaultSimulateUpdateAdminProposalContractSelector(ctx sdk.Context, wasmKeeper WasmKeeper, adminAddress string) (sdk.AccAddress, types.ContractInfo)
- func DefaultSimulationCodeIDSelector(ctx sdk.Context, wasmKeeper WasmKeeper) uint64
- func DefaultSimulationExecuteContractSelector(ctx sdk.Context, wasmKeeper WasmKeeper) sdk.AccAddress
- func DefaultSimulationExecutePayloader(msg *types.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 ParamChanges(_ *rand.Rand, cdc codec.Codec) []simtypes.ParamChange
- func ProposalContents(bk BankKeeper, wasmKeeper WasmKeeper) []simtypes.WeightedProposalContent
- func RandomizedGenState(simstate *module.SimulationState)
- func SimulateClearAdminProposal(wasmKeeper WasmKeeper, contractSelector ClearAdminContractSelector) simtypes.ContentSimulatorFn
- func SimulateExecuteContractProposal(_ BankKeeper, wasmKeeper WasmKeeper, ...) simtypes.ContentSimulatorFn
- func SimulateInstantiateContractProposal(_ BankKeeper, wasmKeeper WasmKeeper, codeSelector CodeIDSelector) simtypes.ContentSimulatorFn
- func SimulateMigrateContractProposal(wasmKeeper WasmKeeper, ...) simtypes.ContentSimulatorFn
- func SimulateMsgExecuteContract(ak types.AccountKeeper, bk BankKeeper, wasmKeeper WasmKeeper, ...) simtypes.Operation
- func SimulateMsgInstantiateContract(ak types.AccountKeeper, bk BankKeeper, wasmKeeper WasmKeeper, ...) simtypes.Operation
- func SimulateMsgStoreCode(ak types.AccountKeeper, bk BankKeeper, wasmKeeper WasmKeeper, wasmBz []byte, ...) simtypes.Operation
- func SimulatePinContractProposal(wasmKeeper WasmKeeper, codeSelector CodeIDSelector) simtypes.ContentSimulatorFn
- func SimulateStoreAndInstantiateContractProposal(wasmKeeper WasmKeeper) simtypes.ContentSimulatorFn
- func SimulateStoreCodeProposal(wasmKeeper WasmKeeper) simtypes.ContentSimulatorFn
- func SimulateSudoContractProposal(wasmKeeper WasmKeeper, contractSelector SudoContractProposalContractSelector) simtypes.ContentSimulatorFn
- func SimulateUnpinContractProposal(wasmKeeper WasmKeeper, codeSelector CodeIDSelector) simtypes.ContentSimulatorFn
- func SimulateUpdateAdminProposal(wasmKeeper WasmKeeper, contractSelector UpdateAdminContractSelector) simtypes.ContentSimulatorFn
- func SimulateUpdateInstantiateConfigProposal(wasmKeeper WasmKeeper, codeSelector CodeIDSelector) simtypes.ContentSimulatorFn
- func WeightedOperations(simstate *module.SimulationState, ak types.AccountKeeper, bk BankKeeper, ...) simulation.WeightedOperations
- type BankKeeper
- type ClearAdminContractSelector
- type CodeIDSelector
- type MigrateContractProposalContractSelector
- type MsgExecuteContractSelector
- type MsgExecutePayloader
- type MsgExecuteSenderSelector
- type SudoContractProposalContractSelector
- type UpdateAdminContractSelector
- 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
const ( WeightStoreCodeProposal = "weight_store_code_proposal" WeightInstantiateContractProposal = "weight_instantiate_contract_proposal" WeightUpdateAdminProposal = "weight_update_admin_proposal" WeightExeContractProposal = "weight_execute_contract_proposal" WeightClearAdminProposal = "weight_clear_admin_proposal" WeightMigrateContractProposal = "weight_migrate_contract_proposal" WeightSudoContractProposal = "weight_sudo_contract_proposal" WeightPinCodesProposal = "weight_pin_codes_proposal" WeightUnpinCodesProposal = "weight_unpin_codes_proposal" WeightUpdateInstantiateConfigProposal = "weight_update_instantiate_config_proposal" WeightStoreAndInstantiateContractProposal = "weight_store_and_instantiate_contract_proposal" )
Variables ¶
This section is empty.
Functions ¶
func BuildOperationInput ¶ added in v0.2.0
func BuildOperationInput( r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, msg interface { sdk.Msg Type() string }, simAccount simtypes.Account, ak types.AccountKeeper, bk BankKeeper, deposit sdk.Coins, ) simulation.OperationInput
BuildOperationInput helper to build object
func DefaultSimulateContractSelector ¶ added in v0.2.0
func DefaultSimulateContractSelector( ctx sdk.Context, wasmKeeper WasmKeeper, ) sdk.AccAddress
func DefaultSimulateUpdateAdminProposalContractSelector ¶ added in v0.2.0
func DefaultSimulateUpdateAdminProposalContractSelector( ctx sdk.Context, wasmKeeper WasmKeeper, adminAddress string, ) (sdk.AccAddress, types.ContractInfo)
func DefaultSimulationCodeIDSelector ¶ added in v0.2.0
func DefaultSimulationCodeIDSelector(ctx sdk.Context, wasmKeeper WasmKeeper) uint64
DefaultSimulationCodeIDSelector picks the first code id
func DefaultSimulationExecuteContractSelector ¶ added in v0.2.0
func DefaultSimulationExecuteContractSelector(ctx sdk.Context, wasmKeeper WasmKeeper) sdk.AccAddress
DefaultSimulationExecuteContractSelector picks the first contract address
func DefaultSimulationExecutePayloader ¶ added in v0.2.0
func DefaultSimulationExecutePayloader(msg *types.MsgExecuteContract) error
DefaultSimulationExecutePayloader implements a bank msg to send the tokens from contract account back to original sender
func DefaultSimulationExecuteSenderSelector ¶ added in v0.2.0
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 ¶ added in v0.2.0
func GenAndDeliverTx(txCtx simulation.OperationInput, fees sdk.Coins, gas uint64) (simtypes.OperationMsg, []simtypes.FutureOperation, error)
GenAndDeliverTx generates a transactions and delivers it.
func GenAndDeliverTxWithRandFees ¶ added in v0.2.0
func GenAndDeliverTxWithRandFees(txCtx simulation.OperationInput, gas uint64) (simtypes.OperationMsg, []simtypes.FutureOperation, error)
GenAndDeliverTxWithRandFees generates a transaction with a random fee and delivers it.
func ParamChanges ¶
func ProposalContents ¶ added in v0.2.0
func ProposalContents(bk BankKeeper, wasmKeeper WasmKeeper) []simtypes.WeightedProposalContent
func RandomizedGenState ¶
func RandomizedGenState(simstate *module.SimulationState)
RandomizeGenState generates a random GenesisState for wasm
func SimulateClearAdminProposal ¶ added in v0.2.0
func SimulateClearAdminProposal(wasmKeeper WasmKeeper, contractSelector ClearAdminContractSelector) simtypes.ContentSimulatorFn
Simulate clear admin proposal
func SimulateExecuteContractProposal ¶ added in v0.2.0
func SimulateExecuteContractProposal( _ BankKeeper, wasmKeeper WasmKeeper, contractSelector MsgExecuteContractSelector, senderSelector MsgExecuteSenderSelector, payloader MsgExecutePayloader, ) simtypes.ContentSimulatorFn
Simulate execute contract proposal
func SimulateInstantiateContractProposal ¶ added in v0.2.0
func SimulateInstantiateContractProposal(_ BankKeeper, wasmKeeper WasmKeeper, codeSelector CodeIDSelector) simtypes.ContentSimulatorFn
Simulate instantiate contract proposal
func SimulateMigrateContractProposal ¶ added in v0.2.0
func SimulateMigrateContractProposal(wasmKeeper WasmKeeper, contractSelector MigrateContractProposalContractSelector, codeSelector CodeIDSelector) simtypes.ContentSimulatorFn
Simulate migrate contract proposal
func SimulateMsgExecuteContract ¶ added in v0.2.0
func SimulateMsgExecuteContract( ak types.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 types.AccountKeeper, bk BankKeeper, wasmKeeper WasmKeeper, codeSelector CodeIDSelector) simtypes.Operation
SimulateMsgInstantiateContract generates a MsgInstantiateContract with random values
func SimulateMsgStoreCode ¶
func SimulateMsgStoreCode(ak types.AccountKeeper, bk BankKeeper, wasmKeeper WasmKeeper, wasmBz []byte, gas uint64) simtypes.Operation
SimulateMsgStoreCode generates a MsgStoreCode with random values
func SimulatePinContractProposal ¶ added in v0.2.0
func SimulatePinContractProposal(wasmKeeper WasmKeeper, codeSelector CodeIDSelector) simtypes.ContentSimulatorFn
Simulate pin contract proposal
func SimulateStoreAndInstantiateContractProposal ¶ added in v0.2.0
func SimulateStoreAndInstantiateContractProposal(wasmKeeper WasmKeeper) simtypes.ContentSimulatorFn
func SimulateStoreCodeProposal ¶ added in v0.2.0
func SimulateStoreCodeProposal(wasmKeeper WasmKeeper) simtypes.ContentSimulatorFn
simulate store code proposal (unused now) Current problem: out of gas (defaul gaswanted config of gov SimulateMsgSubmitProposal is 10_000_000) but this proposal may need more than it
func SimulateSudoContractProposal ¶ added in v0.2.0
func SimulateSudoContractProposal(wasmKeeper WasmKeeper, contractSelector SudoContractProposalContractSelector) simtypes.ContentSimulatorFn
Simulate sudo contract proposal
func SimulateUnpinContractProposal ¶ added in v0.2.0
func SimulateUnpinContractProposal(wasmKeeper WasmKeeper, codeSelector CodeIDSelector) simtypes.ContentSimulatorFn
Simulate unpin contract proposal
func SimulateUpdateAdminProposal ¶ added in v0.2.0
func SimulateUpdateAdminProposal(wasmKeeper WasmKeeper, contractSelector UpdateAdminContractSelector) simtypes.ContentSimulatorFn
Simulate update admin contract proposal
func SimulateUpdateInstantiateConfigProposal ¶ added in v0.2.0
func SimulateUpdateInstantiateConfigProposal(wasmKeeper WasmKeeper, codeSelector CodeIDSelector) simtypes.ContentSimulatorFn
Simulate update instantiate config proposal
func WeightedOperations ¶
func WeightedOperations( simstate *module.SimulationState, ak types.AccountKeeper, bk BankKeeper, wasmKeeper WasmKeeper, ) simulation.WeightedOperations
WeightedOperations returns all the operations from the module with their respective weights
Types ¶
type BankKeeper ¶ added in v0.2.0
type BankKeeper interface {
simulation.BankKeeper
IsSendEnabledCoin(ctx sdk.Context, coin sdk.Coin) bool
}
type ClearAdminContractSelector ¶ added in v0.2.0
type ClearAdminContractSelector func(sdk.Context, WasmKeeper) sdk.AccAddress
type CodeIDSelector ¶ added in v0.2.0
type CodeIDSelector = func(ctx sdk.Context, wasmKeeper WasmKeeper) uint64
CodeIDSelector returns code id to be used in simulations
type MigrateContractProposalContractSelector ¶ added in v0.2.0
type MigrateContractProposalContractSelector func(sdk.Context, WasmKeeper) sdk.AccAddress
type MsgExecuteContractSelector ¶ added in v0.2.0
type MsgExecuteContractSelector = func(ctx sdk.Context, wasmKeeper WasmKeeper) sdk.AccAddress
MsgExecuteContractSelector returns contract address to be used in simulations
type MsgExecutePayloader ¶ added in v0.2.0
type MsgExecutePayloader func(msg *types.MsgExecuteContract) error
MsgExecutePayloader extension point to modify msg with custom payload
type MsgExecuteSenderSelector ¶ added in v0.2.0
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 SudoContractProposalContractSelector ¶ added in v0.2.0
type SudoContractProposalContractSelector func(sdk.Context, WasmKeeper) sdk.AccAddress
type UpdateAdminContractSelector ¶ added in v0.2.0
type UpdateAdminContractSelector func(sdk.Context, WasmKeeper, string) (sdk.AccAddress, types.ContractInfo)
type WasmKeeper ¶
type WasmKeeper interface {
GetParams(ctx sdk.Context) types.Params
IterateCodeInfos(ctx sdk.Context, cb func(uint64, types.CodeInfo) bool)
IterateContractInfo(ctx sdk.Context, cb func(sdk.AccAddress, types.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