Skip to content

Commit f4a3ba4

Browse files
authored
Merge pull request CosmosContracts#525 from CosmosContracts/reece/fix-v12-upgrade
Fix v12 Upgrade Handler
2 parents 0e77692 + 5d1dc01 commit f4a3ba4

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

app/upgrades/v12/upgrades.go

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/cosmos/cosmos-sdk/x/authz"
1212

1313
// ICA
14-
ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts"
14+
1515
icacontrollertypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/types"
1616
icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"
1717
icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"
@@ -58,12 +58,7 @@ func CreateV12UpgradeHandler(
5858
vm[icatypes.ModuleName] = mm.Modules[icatypes.ModuleName].ConsensusVersion()
5959
logger.Info("upgraded icatypes version")
6060

61-
// create ICS27 Controller submodule params, controller module not enabled.
62-
controllerParams := icacontrollertypes.Params{
63-
ControllerEnabled: true,
64-
}
65-
66-
// create ICS27 Host submodule params
61+
// Update ICS27 Host submodule params
6762
hostParams := icahosttypes.Params{
6863
HostEnabled: true,
6964
AllowMessages: []string{
@@ -123,13 +118,10 @@ func CreateV12UpgradeHandler(
123118

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

126-
// initialize ICS27 module
127-
icamodule, correctTypecast := mm.Modules[icatypes.ModuleName].(ica.AppModule)
128-
if !correctTypecast {
129-
panic("mm.Modules[icatypes.ModuleName] is not of type ica.AppModule")
130-
}
131-
icamodule.InitModule(ctx, controllerParams, hostParams)
132-
logger.Info("upgraded ica module")
121+
// Set ICA Params
122+
keepers.ICAHostKeeper.SetParams(ctx, hostParams)
123+
keepers.ICAControllerKeeper.SetParams(ctx, icacontrollertypes.Params{ControllerEnabled: true})
124+
logger.Info("upgraded ICAHostKeeper params")
133125

134126
// GlobalFee
135127
minGasPrices := sdk.DecCoins{

0 commit comments

Comments
 (0)