Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(v2.9): upstream migration #274

Merged
merged 3 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/upgrade_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
app.GetModuleManager(),
app.GetConfigurator(),
app.GetAppCodec(),
app.Keepers.ICQKeeper,
),
)
}
Expand All @@ -96,7 +97,7 @@
func (app *TerraApp) RegisterUpgradeStores() {
upgradeInfo, err := app.Keepers.UpgradeKeeper.ReadUpgradeInfoFromDisk()
if err != nil {
panic(err)

Check failure on line 100 in app/upgrade_handler.go

View workflow job for this annotation

GitHub Actions / test-coverage-upload

not enough arguments in call to v2_9.CreateUpgradeHandler

Check failure on line 100 in app/upgrade_handler.go

View workflow job for this annotation

GitHub Actions / test-simulation

not enough arguments in call to v2_9.CreateUpgradeHandler
}

// Add stores for new modules
Expand All @@ -121,7 +122,7 @@
storeUpgrades := storetypes.StoreUpgrades{Added: []string{icqtypes.StoreKey}}
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
} else if upgradeInfo.Name == terraappconfig.Upgrade2_9 && !app.Keepers.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
storeUpgrades := storetypes.StoreUpgrades{Deleted: []string{"builder"}}
storeUpgrades := storetypes.StoreUpgrades{Deleted: []string{"builder"}, Added: []string{icqtypes.StoreKey}}
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
}
}
8 changes: 8 additions & 0 deletions app/upgrades/v2.9/upgrade.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package v2_9

import (
icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v7/keeper"
icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
Expand All @@ -11,8 +14,13 @@ func CreateUpgradeHandler(
mm *module.Manager,
cfg module.Configurator,
cdc codec.Codec,
icqkeeper icqkeeper.Keeper,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// Interchain Queries
icqParams := icqtypes.NewParams(true, nil)
icqkeeper.SetParams(ctx, icqParams)

return mm.RunMigrations(ctx, cfg, fromVM)
}
}
Loading