app: call SetModuleVersionMap in InitChainer (#422)

keep the scaffolding up-to-date:
https://github.com/cosmos/cosmos-sdk/blob/release/v0.43.x/simapp/app.go#L433

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
yihuang 2021-08-10 19:23:22 +08:00 committed by GitHub
parent 417640e814
commit 010036457c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
package app package app
import ( import (
"encoding/json"
"io" "io"
"net/http" "net/http"
"os" "os"
@ -534,7 +535,10 @@ func (app *EthermintApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) a
// InitChainer updates at chain initialization // InitChainer updates at chain initialization
func (app *EthermintApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { func (app *EthermintApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
var genesisState simapp.GenesisState var genesisState simapp.GenesisState
app.cdc.MustUnmarshalJSON(req.AppStateBytes, &genesisState) if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
panic(err)
}
app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
return app.mm.InitGenesis(ctx, app.appCodec, genesisState) return app.mm.InitGenesis(ctx, app.appCodec, genesisState)
} }