Skip to content

Commit

Permalink
set params in upgrade handler with logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rbajollari committed Jun 13, 2024
1 parent 8750ba7 commit 5f88c6b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import (
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
ibc "github.com/cosmos/ibc-go/v8/modules/core"
ibctypes "github.com/cosmos/ibc-go/v8/modules/core/types"
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
gmptypes "github.com/ojo-network/ojo/x/gmp/types"

oraclekeeper "github.com/ojo-network/ojo/x/oracle/keeper"
Expand Down Expand Up @@ -210,9 +209,13 @@ func (app *App) registerUpgrade0_4_0(upgradeInfo upgradetypes.Plan) {
sdkCtx := sdk.UnwrapSDKContext(ctx)
sdkCtx.Logger().Info("Upgrade handler execution", "name", planName)

// explicitly update the IBC 02-client params with init genesis
ibcGenesis := ibctypes.DefaultGenesisState()
ibc.InitGenesis(sdkCtx, *app.IBCKeeper, ibcGenesis)
// explicitly update the IBC 02-client params
params := ibcclienttypes.DefaultParams()
sdkCtx.Logger().Info("Setting default IBC client parameters", "params", params)
app.IBCKeeper.ClientKeeper.SetParams(sdkCtx, params)

storedParams := app.IBCKeeper.ClientKeeper.GetParams(sdkCtx)
sdkCtx.Logger().Info("IBC client parameters set", "storedParams", storedParams)

return app.mm.RunMigrations(ctx, app.configurator, fromVM)
},
Expand Down

0 comments on commit 5f88c6b

Please sign in to comment.