From 96def3de16b2bdf59d4d06b15037259bb13090aa Mon Sep 17 00:00:00 2001 From: Adam Wozniak <29418299+adamewozniak@users.noreply.github.com> Date: Wed, 2 Oct 2024 16:40:41 -0700 Subject: [PATCH 1/3] fix 0.5.0 upgrade --- app/upgrades.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/upgrades.go b/app/upgrades.go index 3d6bb94f..24b7537f 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -342,6 +342,10 @@ func (app *App) registerUpgrade0_5_0(upgradeInfo upgradetypes.Plan) { func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) sdkCtx.Logger().Info("Upgrade handler execution", "name", planName) + + // Add this line to set the initial version for the new module + fromVM[gasestimatetypes.ModuleName] = 1 + return app.mm.RunMigrations(ctx, app.configurator, fromVM) }, ) From f2ed988ce32c24a25e01a84e3548b5d55924d978 Mon Sep 17 00:00:00 2001 From: Adam Wozniak <29418299+adamewozniak@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:20:34 -0700 Subject: [PATCH 2/3] set x/gmp defaultgasestimate param in upgrade --- app/upgrades.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/upgrades.go b/app/upgrades.go index 24b7537f..bc2ca8a3 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -68,7 +68,7 @@ func (app *App) registerUpgrade0_1_4(_ upgradetypes.Plan) { ) } -//nolint: all +// nolint: all func (app *App) registerUpgrade0_2_0(upgradeInfo upgradetypes.Plan) { const planName = "v0.2.0" @@ -345,7 +345,9 @@ func (app *App) registerUpgrade0_5_0(upgradeInfo upgradetypes.Plan) { // Add this line to set the initial version for the new module fromVM[gasestimatetypes.ModuleName] = 1 - + params := app.GmpKeeper.GetParams(sdkCtx) + params.DefaultGasEstimate = gmptypes.DefaultParams().DefaultGasEstimate + app.GmpKeeper.SetParams(sdkCtx, params) return app.mm.RunMigrations(ctx, app.configurator, fromVM) }, ) From 301992a55fc4c23afbddf76164e21f11fdb16414 Mon Sep 17 00:00:00 2001 From: Adam Wozniak <29418299+adamewozniak@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:40:08 -0700 Subject: [PATCH 3/3] cleanup --- app/upgrades.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/upgrades.go b/app/upgrades.go index bc2ca8a3..e5438e70 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -68,7 +68,7 @@ func (app *App) registerUpgrade0_1_4(_ upgradetypes.Plan) { ) } -// nolint: all +//nolint: all func (app *App) registerUpgrade0_2_0(upgradeInfo upgradetypes.Plan) { const planName = "v0.2.0" @@ -343,8 +343,6 @@ func (app *App) registerUpgrade0_5_0(upgradeInfo upgradetypes.Plan) { sdkCtx := sdk.UnwrapSDKContext(ctx) sdkCtx.Logger().Info("Upgrade handler execution", "name", planName) - // Add this line to set the initial version for the new module - fromVM[gasestimatetypes.ModuleName] = 1 params := app.GmpKeeper.GetParams(sdkCtx) params.DefaultGasEstimate = gmptypes.DefaultParams().DefaultGasEstimate app.GmpKeeper.SetParams(sdkCtx, params)