diff --git a/x/posts/module.go b/x/posts/module.go index f7fb3e53a6..7cb9990162 100644 --- a/x/posts/module.go +++ b/x/posts/module.go @@ -151,10 +151,13 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // InitGenesis performs genesis initialization for the posts module. // It returns no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, data json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, _ codec.JSONMarshaler, data json.RawMessage) []abci.ValidatorUpdate { var genesisState types.GenesisState + err := json.Unmarshal(data, &genesisState) + if err != nil { + panic(err) + } - cdc.MustUnmarshalJSON(data, &genesisState) am.keeper.InitGenesis(ctx, genesisState) return []abci.ValidatorUpdate{} } diff --git a/x/profiles/module.go b/x/profiles/module.go index fdca00e444..13fd09ed13 100644 --- a/x/profiles/module.go +++ b/x/profiles/module.go @@ -150,8 +150,10 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // It returns no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, data json.RawMessage) []abci.ValidatorUpdate { var genesisState types.GenesisState - - cdc.MustUnmarshalJSON(data, &genesisState) + err := json.Unmarshal(data, &genesisState) + if err != nil { + panic(err) + } am.keeper.InitGenesis(ctx, genesisState) return []abci.ValidatorUpdate{} } diff --git a/x/reports/module.go b/x/reports/module.go index 6ff71046fa..628676144c 100644 --- a/x/reports/module.go +++ b/x/reports/module.go @@ -153,8 +153,10 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // InitGenesis performs genesis initialization for the reports module. It returns no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, data json.RawMessage) []abci.ValidatorUpdate { var genesisState types.GenesisState - - cdc.MustUnmarshalJSON(data, &genesisState) + err := json.Unmarshal(data, &genesisState) + if err != nil { + panic(err) + } am.keeper.InitGenesis(ctx, genesisState) return []abci.ValidatorUpdate{} }