Skip to content

Commit

Permalink
Merge pull request #525 from CosmosContracts/reece/fix-v12-upgrade
Browse files Browse the repository at this point in the history
Fix v12 Upgrade Handler
  • Loading branch information
faddat authored Jan 21, 2023
2 parents 0e77692 + 5d1dc01 commit f4a3ba4
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions app/upgrades/v12/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/authz"

// ICA
ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts"

icacontrollertypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/types"
icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"
icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"
Expand Down Expand Up @@ -58,12 +58,7 @@ func CreateV12UpgradeHandler(
vm[icatypes.ModuleName] = mm.Modules[icatypes.ModuleName].ConsensusVersion()
logger.Info("upgraded icatypes version")

// create ICS27 Controller submodule params, controller module not enabled.
controllerParams := icacontrollertypes.Params{
ControllerEnabled: true,
}

// create ICS27 Host submodule params
// Update ICS27 Host submodule params
hostParams := icahosttypes.Params{
HostEnabled: true,
AllowMessages: []string{
Expand Down Expand Up @@ -123,13 +118,10 @@ func CreateV12UpgradeHandler(

// New modules run AFTER the migrations, so to set the correct params after the default.

// initialize ICS27 module
icamodule, correctTypecast := mm.Modules[icatypes.ModuleName].(ica.AppModule)
if !correctTypecast {
panic("mm.Modules[icatypes.ModuleName] is not of type ica.AppModule")
}
icamodule.InitModule(ctx, controllerParams, hostParams)
logger.Info("upgraded ica module")
// Set ICA Params
keepers.ICAHostKeeper.SetParams(ctx, hostParams)
keepers.ICAControllerKeeper.SetParams(ctx, icacontrollertypes.Params{ControllerEnabled: true})
logger.Info("upgraded ICAHostKeeper params")

// GlobalFee
minGasPrices := sdk.DecCoins{
Expand Down

0 comments on commit f4a3ba4

Please sign in to comment.