forked from osmosis-labs/osmosis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
genesis.go
29 lines (24 loc) · 850 Bytes
/
genesis.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
package simulation
import (
"encoding/json"
"fmt"
"github.com/MonOsmosis/osmosis/v10/x/superfluid/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
)
// RandomizedGenState generates a random GenesisState for staking.
func RandomizedGenState(simState *module.SimulationState) {
superfluidGenesis := &types.GenesisState{
Params: types.Params{
MinimumRiskFactor: sdk.NewDecWithPrec(5, 2), // 5%
},
SuperfluidAssets: []types.SuperfluidAsset{},
OsmoEquivalentMultipliers: []types.OsmoEquivalentMultiplierRecord{},
}
bz, err := json.MarshalIndent(&superfluidGenesis.Params, "", " ")
if err != nil {
panic(err)
}
fmt.Printf("Selected randomly generated superfluid parameters:\n%s\n", bz)
simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(superfluidGenesis)
}