fetchai / fetchd

Source code for Fetch.ai blockchain nodes
Other
100 stars 38 forks source link

Added upgrade handler for v0.10.7 #311

Closed MissingNO57 closed 1 year ago

MissingNO57 commented 1 year ago

Notes:

In the previous migration to v0.10.4 the Upgrade handler had a part where it ensured no module migration gets triggered. This part is not needed for the current version.

func (app *App) RegisterUpgradeHandlers(cfg module.Configurator) {
    app.UpgradeKeeper.SetUpgradeHandler("fetchd-v0.10.4", func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
        // manually add every existing modules to prevent the migration calling InitGenesis on them
        fromVM[authz.ModuleName] = authzmodule.AppModule{}.ConsensusVersion()
        fromVM[banktypes.ModuleName] = bank.AppModule{}.ConsensusVersion()
        fromVM[capabilitytypes.ModuleName] = capability.AppModule{}.ConsensusVersion()
        fromVM[crisistypes.ModuleName] = crisis.AppModule{}.ConsensusVersion()
        fromVM[distrtypes.ModuleName] = distribution.AppModule{}.ConsensusVersion()
        fromVM[stakingtypes.ModuleName] = staking.AppModule{}.ConsensusVersion()
        fromVM[evidencetypes.ModuleName] = evidence.AppModule{}.ConsensusVersion()
        fromVM[feegrant.ModuleName] = feegrantmodule.AppModule{}.ConsensusVersion()
        fromVM[genutiltypes.ModuleName] = genutil.AppModule{}.ConsensusVersion()
        fromVM[govtypes.ModuleName] = gov.AppModule{}.ConsensusVersion()
        fromVM[ibchost.ModuleName] = ibc.AppModule{}.ConsensusVersion()
        fromVM[minttypes.ModuleName] = mint.AppModule{}.ConsensusVersion()
        fromVM[paramstypes.ModuleName] = params.AppModule{}.ConsensusVersion()
        fromVM[slashingtypes.ModuleName] = slashing.AppModule{}.ConsensusVersion()
        fromVM[ibctransfertypes.ModuleName] = transfer.AppModule{}.ConsensusVersion()
        fromVM[authtypes.ModuleName] = auth.AppModule{}.ConsensusVersion()
        fromVM[upgradetypes.ModuleName] = upgrade.AppModule{}.ConsensusVersion()
        fromVM[vestingtypes.ModuleName] = vesting.AppModule{}.ConsensusVersion()
        fromVM[wasm.ModuleName] = wasm.AppModule{}.ConsensusVersion()
        return app.mm.RunMigrations(ctx, cfg, fromVM)
    })
}
github-actions[bot] commented 1 year ago

Visit the preview URL for this PR (updated for commit d25bb25):

https://fetch-docs-preview--pr311-upgrade-handler-v0-1-jwbt4s26.web.app

(expires Mon, 01 May 2023 09:51:08 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: f2de39fd4e81249941960b74fbab0a62d90d69f8