forked from evmos/evmos
-
Notifications
You must be signed in to change notification settings - Fork 3
/
genesis.go
34 lines (28 loc) · 886 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
30
31
32
33
34
package feemarket
import (
errorsmod "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/EscanBE/evermint/v12/x/feemarket/keeper"
"github.com/EscanBE/evermint/v12/x/feemarket/types"
)
// InitGenesis initializes genesis state based on exported genesis
func InitGenesis(
ctx sdk.Context,
k keeper.Keeper,
data types.GenesisState,
) []abci.ValidatorUpdate {
err := k.SetParams(ctx, data.Params)
if err != nil {
panic(errorsmod.Wrap(err, "could not set parameters at genesis"))
}
k.SetBlockGasWanted(ctx, data.BlockGas)
return []abci.ValidatorUpdate{}
}
// ExportGenesis exports genesis state of the fee market module
func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState {
return &types.GenesisState{
Params: k.GetParams(ctx),
BlockGas: k.GetBlockGasWanted(ctx),
}
}