-
Notifications
You must be signed in to change notification settings - Fork 574
/
genesis.go
29 lines (26 loc) · 895 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
package incentives
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/osmosis-labs/osmosis/v8/x/incentives/keeper"
"github.com/osmosis-labs/osmosis/v8/x/incentives/types"
)
// InitGenesis initializes the capability module's state from a provided genesis
// state.
func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) {
k.SetParams(ctx, genState.Params)
k.SetLockableDurations(ctx, genState.LockableDurations)
for _, gauge := range genState.Gauges {
err := k.SetGaugeWithRefKey(ctx, &gauge)
if err != nil {
panic(err)
}
}
}
// ExportGenesis returns the capability module's exported genesis.
func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState {
return &types.GenesisState{
Params: k.GetParams(ctx),
LockableDurations: k.GetLockableDurations(ctx),
Gauges: k.GetNotFinishedGauges(ctx),
}
}