2019-08-28 07:58:25 -07:00
|
|
|
package simulation
|
|
|
|
|
|
|
|
// DONTCOVER
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"math/rand"
|
|
|
|
|
|
|
|
"github.com/cosmos/cosmos-sdk/x/simulation"
|
2020-03-23 04:55:44 -07:00
|
|
|
|
|
|
|
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
|
|
|
"github.com/cosmos/cosmos-sdk/x/mint/types"
|
2019-08-28 07:58:25 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
keyInflationRateChange = "InflationRateChange"
|
|
|
|
keyInflationMax = "InflationMax"
|
|
|
|
keyInflationMin = "InflationMin"
|
|
|
|
keyGoalBonded = "GoalBonded"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ParamChanges defines the parameters that can be modified by param change proposals
|
|
|
|
// on the simulation
|
2020-03-23 04:55:44 -07:00
|
|
|
func ParamChanges(r *rand.Rand) []simtypes.ParamChange {
|
|
|
|
return []simtypes.ParamChange{
|
2019-12-10 08:48:57 -08:00
|
|
|
simulation.NewSimParamChange(types.ModuleName, keyInflationRateChange,
|
2019-08-28 07:58:25 -07:00
|
|
|
func(r *rand.Rand) string {
|
|
|
|
return fmt.Sprintf("\"%s\"", GenInflationRateChange(r))
|
|
|
|
},
|
|
|
|
),
|
2019-12-10 08:48:57 -08:00
|
|
|
simulation.NewSimParamChange(types.ModuleName, keyInflationMax,
|
2019-08-28 07:58:25 -07:00
|
|
|
func(r *rand.Rand) string {
|
|
|
|
return fmt.Sprintf("\"%s\"", GenInflationMax(r))
|
|
|
|
},
|
|
|
|
),
|
2019-12-10 08:48:57 -08:00
|
|
|
simulation.NewSimParamChange(types.ModuleName, keyInflationMin,
|
2019-08-28 07:58:25 -07:00
|
|
|
func(r *rand.Rand) string {
|
|
|
|
return fmt.Sprintf("\"%s\"", GenInflationMin(r))
|
|
|
|
},
|
|
|
|
),
|
2019-12-10 08:48:57 -08:00
|
|
|
simulation.NewSimParamChange(types.ModuleName, keyGoalBonded,
|
2019-08-28 07:58:25 -07:00
|
|
|
func(r *rand.Rand) string {
|
|
|
|
return fmt.Sprintf("\"%s\"", GenGoalBonded(r))
|
|
|
|
},
|
|
|
|
),
|
|
|
|
}
|
|
|
|
}
|