mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-10 10:05:18 +00:00
26 lines
678 B
Go
26 lines
678 B
Go
|
package earn
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
|
||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||
|
|
||
|
"github.com/kava-labs/kava/x/earn/keeper"
|
||
|
"github.com/kava-labs/kava/x/earn/types"
|
||
|
)
|
||
|
|
||
|
// InitGenesis initializes genesis state
|
||
|
func InitGenesis(ctx sdk.Context, k keeper.Keeper, ak types.AccountKeeper, gs types.GenesisState) {
|
||
|
if err := gs.Validate(); err != nil {
|
||
|
panic(fmt.Sprintf("failed to validate %s genesis state: %s", types.ModuleName, err))
|
||
|
}
|
||
|
|
||
|
k.SetParams(ctx, gs.Params)
|
||
|
}
|
||
|
|
||
|
// ExportGenesis returns a GenesisState for a given context and keeper
|
||
|
func ExportGenesis(ctx sdk.Context, k keeper.Keeper) types.GenesisState {
|
||
|
params := k.GetParams(ctx)
|
||
|
return types.NewGenesisState(params)
|
||
|
}
|