Skip to content

Commit

Permalink
Merge pull request ComposableFi#206 from notional-labs/dang/upgrade-h…
Browse files Browse the repository at this point in the history
…andler

Add ICA host to upgrade handler
  • Loading branch information
vuong177 authored Jul 20, 2023
2 parents a5f8a8d + 87cace3 commit 9c8fca3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/upgrades/v4/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package v4
import (
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
store "github.com/cosmos/cosmos-sdk/store/types"
icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types"
"github.com/notional-labs/centauri/v4/app/upgrades"
ibchookstypes "github.com/notional-labs/centauri/v4/x/ibc-hooks/types"
ratelimitmoduletypes "github.com/notional-labs/centauri/v4/x/ratelimit/types"
Expand All @@ -17,7 +18,7 @@ var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{wasmtypes.StoreKey, ibchookstypes.StoreKey, ratelimitmoduletypes.StoreKey},
Added: []string{wasmtypes.StoreKey, ibchookstypes.StoreKey, ratelimitmoduletypes.StoreKey, icahosttypes.StoreKey},
Deleted: []string{},
},
}
5 changes: 5 additions & 0 deletions app/upgrades/v4/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/notional-labs/centauri/v4/app/keepers"
"github.com/notional-labs/centauri/v4/app/upgrades"
tfmdtypes "github.com/notional-labs/centauri/v4/x/transfermiddleware/types"
)

func CreateUpgradeHandler(
Expand All @@ -15,6 +16,10 @@ func CreateUpgradeHandler(
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
// Add params for transfer middleware
transmiddlewareParams := tfmdtypes.DefaultParams()
keepers.TransferMiddlewareKeeper.SetParams(ctx, transmiddlewareParams)

return mm.RunMigrations(ctx, configurator, vm)
}
}

0 comments on commit 9c8fca3

Please sign in to comment.