forked from cerc-io/laconicd-deprecated
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:
parent
417640e814
commit
010036457c
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user