Files
wasmd/x/wasm/simulation/params.go
Alexander Peters 2a9c5c1ea5 Fix wasm simulations (#870)
* Fix wasm simulations + make functions compatible with tgrade

* Fix lint issues

* Fix simulation setup

* Make simulations store msg pass

* Use default values params to make operations succeed

* Normalize wasm store

* Add simulations to circleci config

* Run simulation in temp dir

* Store sim logs

* Increase circleci machine type

* Extract reflect contract api into helper

* Add execute msg to simulations

* Embed refect wasm contract

Co-authored-by: Pino' Surace <pino.surace@live.it>
2022-05-31 10:07:16 +02:00

33 lines
853 B
Go

package simulation
import (
"fmt"
"math/rand"
"github.com/cosmos/cosmos-sdk/codec"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/cosmos/cosmos-sdk/x/simulation"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
func ParamChanges(r *rand.Rand, cdc codec.Codec) []simtypes.ParamChange {
params := types.DefaultParams()
return []simtypes.ParamChange{
simulation.NewSimParamChange(types.ModuleName, string(types.ParamStoreKeyUploadAccess),
func(r *rand.Rand) string {
jsonBz, err := cdc.MarshalJSON(&params.CodeUploadAccess)
if err != nil {
panic(err)
}
return string(jsonBz)
},
),
simulation.NewSimParamChange(types.ModuleName, string(types.ParamStoreKeyInstantiateAccess),
func(r *rand.Rand) string {
return fmt.Sprintf("%q", params.CodeUploadAccess.Permission.String())
},
),
}
}