forked from cerc-io/laconicd-deprecated
randomize bond params
This commit is contained in:
parent
9ea31b81f5
commit
055e323f3b
@ -7,11 +7,13 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/types/module"
|
||||
|
||||
"github.com/cerc-io/laconicd/x/bond/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
// RandomizedGenState generates a random GenesisState
|
||||
func RandomizedGenState(simState *module.SimulationState) {
|
||||
bondGenesis := types.DefaultGenesisState()
|
||||
bondParams := types.NewParams(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(int64(simState.Rand.Intn(10000000000)))))
|
||||
bondGenesis := types.NewGenesisState(bondParams, []*types.Bond{})
|
||||
|
||||
bz, err := json.MarshalIndent(bondGenesis, "", " ")
|
||||
if err != nil {
|
||||
|
@ -8,3 +8,10 @@ func DefaultGenesisState() *GenesisState {
|
||||
Bonds: []*Bond{},
|
||||
}
|
||||
}
|
||||
|
||||
func NewGenesisState(params Params, bonds []*Bond) *GenesisState {
|
||||
return &GenesisState{
|
||||
Params: params,
|
||||
Bonds: bonds,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user