feat: add macaroon and oracle genesis states

This commit is contained in:
Prad Nukala
2024-09-30 15:28:27 -04:00
parent 78900c0b68
commit dfc30b9754
6 changed files with 120 additions and 105 deletions
+37
View File
@@ -0,0 +1,37 @@
package keeper
import (
"context"
"cosmossdk.io/log"
"github.com/onsonr/sonr/x/macaroon/types"
)
func (k Keeper) Logger() log.Logger {
return k.logger
}
// InitGenesis initializes the module's state from a genesis state.
func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error {
// this line is used by starport scaffolding # genesis/module/init
if err := data.Params.Validate(); err != nil {
return err
}
return k.Params.Set(ctx, data.Params)
}
// ExportGenesis exports the module's state to a genesis state.
func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState {
params, err := k.Params.Get(ctx)
if err != nil {
panic(err)
}
// this line is used by starport scaffolding # genesis/module/export
return &types.GenesisState{
Params: params,
}
}