Skip to content

Commit

Permalink
Add ICAHost to AppModuleBasics (#1825)
Browse files Browse the repository at this point in the history
* Add ICAHost to AppModuleBasics

* Add changelog entry
  • Loading branch information
ValarDragon authored Jun 20, 2022
1 parent 3eeeade commit d4913ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
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

0 comments on commit d4913ba

Please sign in to comment.