From 303da15cfcb02bd5f0c2309f7fd200af0ac28c33 Mon Sep 17 00:00:00 2001 From: Barry <122767193+BarryTong65@users.noreply.github.com> Date: Tue, 28 May 2024 18:37:57 +0930 Subject: [PATCH] fix: veld hardfork (#631) --- app/upgrade.go | 17 +++++++++++++++++ deployment/localup/localup.sh | 1 + 2 files changed, 18 insertions(+) diff --git a/app/upgrade.go b/app/upgrade.go index 5ebb20570..f3e3ef774 100644 --- a/app/upgrade.go +++ b/app/upgrade.go @@ -34,6 +34,7 @@ func (app *App) RegisterUpgradeHandlers(chainID string, serverCfg *serverconfig. app.registerPawneeUpgradeHandler() app.registerSerengetiUpgradeHandler() app.registerErdosUpgradeHandler() + app.registerVeldUpgradeHandler() // app.register...() // ... return nil @@ -262,3 +263,19 @@ func (app *App) registerErdosUpgradeHandler() { return nil }) } + +func (app *App) registerVeldUpgradeHandler() { + // Register the upgrade handler + app.UpgradeKeeper.SetUpgradeHandler(upgradetypes.Veld, + func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + app.Logger().Info("upgrade to ", plan.Name) + return app.mm.RunMigrations(ctx, app.configurator, fromVM) + }) + + // Register the upgrade initializer + app.UpgradeKeeper.SetUpgradeInitializer(upgradetypes.Veld, + func() error { + app.Logger().Info("Init Veld upgrade") + return nil + }) +} diff --git a/deployment/localup/localup.sh b/deployment/localup/localup.sh index bbdc9d9bd..40e8ab56d 100644 --- a/deployment/localup/localup.sh +++ b/deployment/localup/localup.sh @@ -180,6 +180,7 @@ function generate_genesis() { echo -e '[[upgrade]]\nname = "Pawnee"\nheight = 23\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml echo -e '[[upgrade]]\nname = "Serengeti"\nheight = 24\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml echo -e '[[upgrade]]\nname = "Erdos"\nheight = 25\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml + echo -e '[[upgrade]]\nname = "Veld"\nheight = 26\ninfo = ""' >> ${workspace}/.local/validator${i}/config/app.toml done # enable swagger API for validator0