Skip to content

Commit

Permalink
refactor: migrate consensus to collections (cosmos#15553)
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Mar 28, 2023
1 parent e2ea6fa commit ee91bed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
4 changes: 3 additions & 1 deletion upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ee91bed

Please sign in to comment.