From ee91bedd0aa5c6aa60de22da022b1eeb4e6e0a17 Mon Sep 17 00:00:00 2001 From: Marko Date: Tue, 28 Mar 2023 22:41:12 +0200 Subject: [PATCH] refactor: migrate consensus to collections (#15553) --- app.go | 2 +- upgrades.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app.go b/app.go index f4734dc4e957..ab37061b6067 100644 --- a/app.go +++ b/app.go @@ -286,7 +286,7 @@ func NewSimApp( // set the BaseApp's parameter store app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), authtypes.NewModuleAddress(govtypes.ModuleName).String()) - bApp.SetParamStore(&app.ConsensusParamsKeeper) + bApp.SetParamStore(app.ConsensusParamsKeeper.Params) // add keepers app.AccountKeeper = authkeeper.NewAccountKeeper(appCodec, runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, sdk.Bech32MainPrefix, authtypes.NewModuleAddress(govtypes.ModuleName).String()) diff --git a/upgrades.go b/upgrades.go index 891d72d4767a..fac518315d08 100644 --- a/upgrades.go +++ b/upgrades.go @@ -64,7 +64,9 @@ func (app SimApp) RegisterUpgradeHandlers() { UpgradeName, func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { // Migrate CometBFT consensus parameters from x/params module to a dedicated x/consensus module. - baseapp.MigrateParams(ctx, baseAppLegacySS, &app.ConsensusParamsKeeper) + if err := baseapp.MigrateParams(ctx, baseAppLegacySS, app.ConsensusParamsKeeper.Params); err != nil { + return nil, err + } // Note: this migration is optional, // You can include x/gov proposal migration documented in [UPGRADING.md](https://github.com/cosmos/cosmos-sdk/blob/main/UPGRADING.md)