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

Add ICAHost to AppModuleBasics #1825

Merged
merged 2 commits into from
Jun 20, 2022
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Breaking Changes

* [#1825](https://github.com/osmosis-labs/osmosis/pull/1825) Fixes Interchain Accounts (host side) by adding it to AppModuleBasics
* [#1699](https://github.com/osmosis-labs/osmosis/pull/1699) Fixes bug in sig fig rounding on spot price queries for small values

#### golang API breaks
Expand Down
2 changes: 2 additions & 0 deletions app/keepers/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts"

_ "github.com/osmosis-labs/osmosis/v7/client/docs/statik"
"github.com/osmosis-labs/osmosis/v7/x/epochs"
Expand Down Expand Up @@ -83,4 +84,5 @@ var AppModuleBasics = []module.AppModuleBasic{
tokenfactory.AppModuleBasic{},
bech32ibc.AppModuleBasic{},
wasm.AppModuleBasic{},
ica.AppModuleBasic{},
}
8 changes: 7 additions & 1 deletion app/upgrades/v9/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ func CreateUpgradeHandler(
return nil, err
}

// save oldIcaVersion, so we can skip icahost.InitModule in longer term tests.
oldIcaVersion := fromVM[icatypes.ModuleName]

// Add Interchain Accounts host module
// set the ICS27 consensus version so InitGenesis is not run
fromVM[icatypes.ModuleName] = mm.Modules[icatypes.ModuleName].ConsensusVersion()
Expand Down Expand Up @@ -79,7 +82,10 @@ func CreateUpgradeHandler(
panic("mm.Modules[icatypes.ModuleName] is not of type ica.AppModule")
}

icamodule.InitModule(ctx, controllerParams, hostParams)
// skip InitModule in upgrade tests after the upgrade has gone through.
if oldIcaVersion != fromVM[icatypes.ModuleName] {
icamodule.InitModule(ctx, controllerParams, hostParams)
}

return mm.RunMigrations(ctx, configurator, fromVM)
}
Expand Down