2021-10-11 11:09:53 +00:00
|
|
|
package simulation
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"fmt"
|
|
|
|
|
2022-05-31 16:28:46 +00:00
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
2021-10-11 11:09:53 +00:00
|
|
|
"github.com/cosmos/cosmos-sdk/types/module"
|
|
|
|
|
2022-06-19 09:43:41 +00:00
|
|
|
"github.com/evmos/ethermint/x/feemarket/types"
|
2021-10-11 11:09:53 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// RandomizedGenState generates a random GenesisState for nft
|
|
|
|
func RandomizedGenState(simState *module.SimulationState) {
|
2022-06-05 09:22:33 +00:00
|
|
|
params := types.NewParams(simState.Rand.Uint32()%2 == 0, simState.Rand.Uint32(), simState.Rand.Uint32(), simState.Rand.Uint64(), simState.Rand.Int63(), sdk.ZeroDec(), types.DefaultMinGasMultiplier)
|
2022-05-31 16:28:46 +00:00
|
|
|
|
2021-10-11 11:09:53 +00:00
|
|
|
blockGas := simState.Rand.Uint64()
|
2022-02-23 18:48:44 +00:00
|
|
|
feemarketGenesis := types.NewGenesisState(params, blockGas)
|
2021-10-11 11:09:53 +00:00
|
|
|
|
|
|
|
bz, err := json.MarshalIndent(feemarketGenesis, "", " ")
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
fmt.Printf("Selected randomly generated %s parameters:\n%s\n", types.ModuleName, bz)
|
|
|
|
|
|
|
|
simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(feemarketGenesis)
|
|
|
|
}
|