From 75cc4c9cda87a854d93a072401fae959c8a1216c Mon Sep 17 00:00:00 2001 From: pr0n00gler Date: Wed, 12 Jun 2024 18:33:43 +0300 Subject: [PATCH] fix nil consensus param --- app/upgrades/v4.0.0/upgrades.go | 5 +++++ app/upgrades/v4.0.0/upgrades_test.go | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/upgrades/v4.0.0/upgrades.go b/app/upgrades/v4.0.0/upgrades.go index caf023e85..613ce7213 100644 --- a/app/upgrades/v4.0.0/upgrades.go +++ b/app/upgrades/v4.0.0/upgrades.go @@ -232,6 +232,11 @@ func enableVoteExtensions(ctx sdk.Context, consensusKeeper *consensuskeeper.Keep return err } + oldParams.Params.Version = &comettypes.VersionParams{App: 0} + if err := consensusKeeper.ParamsStore.Set(ctx, *oldParams.Params); err != nil { + return err + } + // we need to enable VoteExtensions for Slinky oldParams.Params.Abci = &comettypes.ABCIParams{VoteExtensionsEnableHeight: ctx.BlockHeight() + 4} diff --git a/app/upgrades/v4.0.0/upgrades_test.go b/app/upgrades/v4.0.0/upgrades_test.go index 099aca379..e38f91b9c 100644 --- a/app/upgrades/v4.0.0/upgrades_test.go +++ b/app/upgrades/v4.0.0/upgrades_test.go @@ -133,13 +133,6 @@ func (suite *UpgradeTestSuite) TestDynamicFeesUpgrade() { ctx := suite.ChainA.GetContext() t := suite.T() - oldParams, err := app.ConsensusParamsKeeper.Params(ctx, &types.QueryParamsRequest{}) - suite.Require().NoError(err) - // it is automatically tracked in upgrade handler, we need to set it manually for tests - oldParams.Params.Version = &comettypes.VersionParams{App: 0} - // we need to properly set consensus params for tests or we get a panic - suite.Require().NoError(app.ConsensusParamsKeeper.ParamsStore.Set(ctx, *oldParams.Params)) - upgrade := upgradetypes.Plan{ Name: v400.UpgradeName, Info: "some text here",