-
Notifications
You must be signed in to change notification settings - Fork 36
/
genesis.go
30 lines (25 loc) · 877 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
package keeper
import (
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/peggyjv/sommelier/v7/x/cellarfees/types"
)
// InitGenesis initializes the module's state from a provided genesis
// state.
func (k Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState) {
k.SetParams(ctx, gs.Params)
k.SetFeeAccrualCounters(ctx, gs.FeeAccrualCounters)
k.SetLastRewardSupplyPeak(ctx, gs.LastRewardSupplyPeak)
feesAccount := k.GetFeesAccount(ctx)
if feesAccount == nil {
panic(fmt.Sprintf("%s module account has not been set", types.ModuleName))
}
}
// ExportGenesis returns the module's exported genesis.
func (k Keeper) ExportGenesis(ctx sdk.Context) types.GenesisState {
return types.GenesisState{
Params: k.GetParams(ctx),
FeeAccrualCounters: k.GetFeeAccrualCounters(ctx),
LastRewardSupplyPeak: k.GetLastRewardSupplyPeak(ctx),
}
}