Skip to content

Commit

Permalink
fix!: add missing consensus module registration; register gov hooks (#…
Browse files Browse the repository at this point in the history
…2907)

* fix!: add missing consensus module registration; update hooks registration

* fix!: register params migration
  • Loading branch information
MSalopek authored Feb 2, 2024
1 parent af052c7 commit aae0c6c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,9 @@ func NewAppKeeper(
appKeepers.GovKeeper.SetLegacyRouter(govRouter)

appKeepers.GovKeeper = appKeepers.GovKeeper.SetHooks(
appKeepers.ProviderKeeper.Hooks(),
govtypes.NewMultiGovHooks(
appKeepers.ProviderKeeper.Hooks(),
),
)

evidenceKeeper := evidencekeeper.NewKeeper(
Expand Down
1 change: 1 addition & 0 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ func appModules(
ibc.NewAppModule(app.IBCKeeper),
sdkparams.NewAppModule(app.ParamsKeeper),
globalfee.NewAppModule(app.GetSubspace(globalfee.ModuleName)),
consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),
app.TransferModule,
app.ICAModule,
app.PFMRouterModule,
Expand Down
5 changes: 5 additions & 0 deletions app/upgrades/v15/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package v15
import (
"fmt"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/store/prefix"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -16,6 +17,7 @@ import (
distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
Expand All @@ -40,6 +42,9 @@ func CreateUpgradeHandler(
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info("Starting module migrations...")
baseAppLegacySS := keepers.ParamsKeeper.Subspace(baseapp.Paramspace).
WithKeyTable(paramstypes.ConsensusParamsKeyTable())
baseapp.MigrateParams(ctx, baseAppLegacySS, &keepers.ConsensusParamsKeeper)

vm, err := mm.RunMigrations(ctx, configurator, vm)
if err != nil {
Expand Down

0 comments on commit aae0c6c

Please sign in to comment.