mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-27 16:55:21 +00:00
a573625df8
* bump SDK version to v0.38.3 Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: Kevin Davis <kjydavis3@gmail.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: denalimarsh <denalimarsh@gmail.com> Co-authored-by: rhuairahrighairigh <ruaridh.odonnell@gmail.com>
35 lines
907 B
Go
35 lines
907 B
Go
package simulation
|
|
|
|
import (
|
|
"fmt"
|
|
"math/rand"
|
|
|
|
"github.com/cosmos/cosmos-sdk/x/simulation"
|
|
|
|
"github.com/kava-labs/kava/x/kavadist/types"
|
|
)
|
|
|
|
// ParamChanges defines the parameters that can be modified by param change proposals
|
|
// on the simulation
|
|
func ParamChanges(r *rand.Rand) []simulation.ParamChange {
|
|
// Hacky way to validate periods since validation is wrapped in params
|
|
active := genRandomActive(r)
|
|
periods := genRandomPeriods(r, simulation.RandTimestamp(r))
|
|
if err := types.NewParams(active, periods).Validate(); err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
return []simulation.ParamChange{
|
|
simulation.NewSimParamChange(types.ModuleName, string(types.KeyActive),
|
|
func(r *rand.Rand) string {
|
|
return fmt.Sprintf("%t", active)
|
|
},
|
|
),
|
|
simulation.NewSimParamChange(types.ModuleName, string(types.KeyPeriods),
|
|
func(r *rand.Rand) string {
|
|
return fmt.Sprintf("%v", periods)
|
|
},
|
|
),
|
|
}
|
|
}
|