refactor: move x/auth, x/authz, x/slashing and x/mint Init/Export genesis to keeper (#11871)

This commit is contained in:
likhita-809
2022-05-04 12:50:33 -04:00
committed by GitHub
parent 710b57c0fb
commit 6e18f582bf
10 changed files with 73 additions and 71 deletions
+2 -2
View File
@@ -136,14 +136,14 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate {
var genesisState types.GenesisState
cdc.MustUnmarshalJSON(data, &genesisState)
InitGenesis(ctx, am.accountKeeper, genesisState)
am.accountKeeper.InitGenesis(ctx, genesisState)
return []abci.ValidatorUpdate{}
}
// ExportGenesis returns the exported genesis state as raw bytes for the auth
// module.
func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage {
gs := ExportGenesis(ctx, am.accountKeeper)
gs := am.accountKeeper.ExportGenesis(ctx)
return cdc.MustMarshalJSON(gs)
}