Skip to content

Commit

Permalink
update genesis generation script
Browse files Browse the repository at this point in the history
  • Loading branch information
gophereth committed Nov 17, 2022
1 parent 0154228 commit 019d0e2
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion cmd/acred/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types"
evmtypes "github.com/evmos/ethermint/x/evm/types"
"github.com/spf13/cobra"
tmtypes "github.com/tendermint/tendermint/types"
)
Expand Down Expand Up @@ -109,6 +110,17 @@ func PrepareGenesis(clientCtx client.Context, appState map[string]json.RawMessag
}
appState[minttypes.ModuleName] = mintGenStateBz

// evm module genesis
evmGenState := evmtypes.DefaultGenesisState()
evmGenState.Params = evmtypes.DefaultParams()
evmGenState.Params.EvmDenom = appparams.BaseDenom

evmGenStateBz, err := cdc.MarshalJSON(evmGenState)
if err != nil {
return nil, nil, fmt.Errorf("failed to marshal evm genesis state: %w", err)
}
appState[evmtypes.ModuleName] = evmGenStateBz

// bank module genesis
bankGenState := banktypes.DefaultGenesisState()
bankGenState.Params = banktypes.DefaultParams()
Expand Down Expand Up @@ -271,7 +283,9 @@ func PrepareGenesis(clientCtx client.Context, appState map[string]json.RawMessag
// slashing module genesis
slashingGenState := slashingtypes.DefaultGenesisState()
slashingGenState.Params = slashingtypes.DefaultParams()
slashingGenState.Params.SignedBlocksWindow = 10000
slashingGenState.Params.SignedBlocksWindow = 30000
slashingGenState.Params.MinSignedPerWindow = sdk.NewDecWithPrec(5, 2)
slashingGenState.Params.SlashFractionDowntime = sdk.NewDecWithPrec(1, 3)
slashingGenStateBz, err := cdc.MarshalJSON(slashingGenState)
if err != nil {
return nil, nil, fmt.Errorf("failed to marshal slashing genesis state: %w", err)
Expand Down

0 comments on commit 019d0e2

Please sign in to comment.