Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Oct 12, 2024
1 parent 3e82ab1 commit 7159636
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,28 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"
)

func (app *ChainApp) RegisterUpgradeHandlers(cdc codec.BinaryCodec) {
planName := "v5.0"
app.UpgradeKeeper.SetUpgradeHandler(planName, func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
m, err := app.ModuleManager.RunMigrations(ctx, app.configurator, fromVM)
if err != nil {
return m, err
}
sdkCtx := sdk.UnwrapSDKContext(ctx)
{
params := app.ICAHostKeeper.GetParams(sdkCtx)
var params types.Params
params = app.ICAHostKeeper.GetParams(sdkCtx)
msg := "/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe"
if !slices.Contains(params.AllowMessages, msg) {
if (len(params.AllowMessages) > 1 || params.AllowMessages[0] != "*") &&
!slices.Contains(params.AllowMessages, msg) {
params.AllowMessages = append(params.AllowMessages, msg)
app.ICAHostKeeper.SetParams(sdkCtx, params)
}
}
return app.ModuleManager.RunMigrations(ctx, app.configurator, fromVM)
return m, nil
})

upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
Expand Down

0 comments on commit 7159636

Please sign in to comment.