laconicd-deprecated/x/evm/simulation/params.go

42 lines
1.1 KiB
Go
Raw Normal View History

2022-04-28 07:43:39 +00:00
package simulation
// DONTCOVER
import (
"fmt"
"math/rand"
"github.com/cerc-io/laconicd/x/evm/types"
2022-10-10 10:38:33 +00:00
amino "github.com/cosmos/cosmos-sdk/codec"
2022-04-28 07:43:39 +00:00
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/cosmos/cosmos-sdk/x/simulation"
)
// ParamChanges defines the parameters that can be modified by param change proposals
// on the simulation.
func ParamChanges(r *rand.Rand) []simtypes.ParamChange {
return []simtypes.ParamChange{
2022-10-10 10:38:33 +00:00
simulation.NewSimParamChange(types.ModuleName, string(types.ParamStoreKeyExtraEIPs),
func(r *rand.Rand) string {
extraEIPs := GenExtraEIPs(r)
amino := amino.NewLegacyAmino()
bz, err := amino.MarshalJSON(extraEIPs)
if err != nil {
panic(err)
}
return string(bz)
},
),
simulation.NewSimParamChange(types.ModuleName, string(types.ParamStoreKeyEnableCreate),
func(r *rand.Rand) string {
return fmt.Sprintf("%v", GenEnableCreate(r))
},
),
simulation.NewSimParamChange(types.ModuleName, string(types.ParamStoreKeyEnableCall),
2022-04-28 07:43:39 +00:00
func(r *rand.Rand) string {
2022-10-10 10:38:33 +00:00
return fmt.Sprintf("%v", GenEnableCall(r))
2022-04-28 07:43:39 +00:00
},
),
}
}