-
Notifications
You must be signed in to change notification settings - Fork 75
/
genesis.go
34 lines (28 loc) · 891 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 fee
import (
errorsmod "cosmossdk.io/errors"
"github.com/artela-network/artela/x/fee/keeper"
abci "github.com/cometbft/cometbft/abci/types"
cosmos "github.com/cosmos/cosmos-sdk/types"
"github.com/artela-network/artela/x/fee/types"
)
// InitGenesis initializes genesis states based on exported genesis
func InitGenesis(
ctx cosmos.Context,
k *keeper.Keeper,
genState types.GenesisState,
) []abci.ValidatorUpdate {
err := k.SetParams(ctx, genState.Params)
if err != nil {
panic(errorsmod.Wrap(err, "could not set parameters at genesis"))
}
k.SetBlockGasWanted(ctx, genState.BlockGas)
return []abci.ValidatorUpdate{}
}
// ExportGenesis exports genesis states of the fee market module
func ExportGenesis(ctx cosmos.Context, k *keeper.Keeper) *types.GenesisState {
return &types.GenesisState{
Params: k.GetParams(ctx),
BlockGas: k.GetBlockGasWanted(ctx),
}
}