-
Notifications
You must be signed in to change notification settings - Fork 180
/
params.go
39 lines (34 loc) · 1.06 KB
/
params.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package simulation
// DONTCOVER
import (
"fmt"
"math/rand"
"github.com/okex/exchain/libs/cosmos-sdk/x/simulation"
"github.com/okex/exchain/libs/cosmos-sdk/x/slashing/internal/types"
)
const (
keySignedBlocksWindow = "SignedBlocksWindow"
keyMinSignedPerWindow = "MinSignedPerWindow"
keySlashFractionDowntime = "SlashFractionDowntime"
)
// ParamChanges defines the parameters that can be modified by param change proposals
// on the simulation
func ParamChanges(r *rand.Rand) []simulation.ParamChange {
return []simulation.ParamChange{
simulation.NewSimParamChange(types.ModuleName, keySignedBlocksWindow,
func(r *rand.Rand) string {
return fmt.Sprintf("\"%d\"", GenSignedBlocksWindow(r))
},
),
simulation.NewSimParamChange(types.ModuleName, keyMinSignedPerWindow,
func(r *rand.Rand) string {
return fmt.Sprintf("\"%s\"", GenMinSignedPerWindow(r))
},
),
simulation.NewSimParamChange(types.ModuleName, keySlashFractionDowntime,
func(r *rand.Rand) string {
return fmt.Sprintf("\"%s\"", GenSlashFractionDowntime(r))
},
),
}
}