0g-chain/x/bep3/simulation/params.go
Denali Marsh 3da4657102
[R4R] BEP3 simulations (#423)
* implement randomized genesis, params

* implement operations: MsgCreateAtomicSwap

* implement claim, refund future ops

* remove dynamic block locks

* refactor BondedAddresses

* add consistent supported assets
2020-04-11 20:54:45 -07:00

47 lines
1.3 KiB
Go

package simulation
import (
"fmt"
"math/rand"
"github.com/cosmos/cosmos-sdk/x/simulation"
"github.com/kava-labs/kava/x/bep3/types"
)
const (
keyBnbDeputyAddress = "BnbDeputyAddress"
keyMinBlockLock = "MinBlockLock"
keyMaxBlockLock = "MaxBlockLock"
keySupportedAssets = "SupportedAssets"
)
// ParamChanges defines the parameters that can be modified by param change proposals
func ParamChanges(r *rand.Rand) []simulation.ParamChange {
// We generate MinBlockLock first because the result is required by GenMaxBlockLock()
minBlockLockVal := GenMinBlockLock(r)
return []simulation.ParamChange{
simulation.NewSimParamChange(types.ModuleName, keyBnbDeputyAddress, "",
func(r *rand.Rand) string {
return fmt.Sprintf("\"%s\"", GenBnbDeputyAddress(r))
},
),
simulation.NewSimParamChange(types.ModuleName, keyMinBlockLock, "",
func(r *rand.Rand) string {
return fmt.Sprintf("\"%d\"", minBlockLockVal)
},
),
simulation.NewSimParamChange(types.ModuleName, keyMaxBlockLock, "",
func(r *rand.Rand) string {
return fmt.Sprintf("\"%d\"", GenMaxBlockLock(r, minBlockLockVal))
},
),
simulation.NewSimParamChange(types.ModuleName, keySupportedAssets, "",
func(r *rand.Rand) string {
return fmt.Sprintf("\"%v\"", GenSupportedAssets(r))
},
),
}
}