Skip to content
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

### BUG FIXES

- Use `TruncateInt` to compute `uphotonToMint` [250](https://github.com/atomone-hub/atomone/pull/250)
- Use `TruncateInt` to compute `uphotonToMint` [#250](https://github.com/atomone-hub/atomone/pull/250)
- Fix missing ICA controller configuration [#257](https://github.com/atomone-hub/atomone/pull/257)

### DEPENDENCIES

Expand Down
23 changes: 21 additions & 2 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ package keepers

import (
ica "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts"
icacontroller "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/controller"
icacontrollerkeeper "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/controller/keeper"
icacontrollertypes "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/controller/types"
icahost "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/host"
icahostkeeper "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/host/keeper"
icahosttypes "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/host/types"
Expand Down Expand Up @@ -84,6 +87,7 @@ type AppKeepers struct {
// IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
IBCKeeper *ibckeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper
ICAControllerKeeper icacontrollerkeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
Expand Down Expand Up @@ -301,6 +305,16 @@ func NewAppKeeper(
bApp.GRPCQueryRouter(),
authorityStr,
)
// ICA Controller keeper
appKeepers.ICAControllerKeeper = icacontrollerkeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(appKeepers.keys[icacontrollertypes.StoreKey]),
appKeepers.GetSubspace(icacontrollertypes.SubModuleName),
appKeepers.IBCKeeper.ChannelKeeper, // ICS4Wrapper
appKeepers.IBCKeeper.ChannelKeeper,
bApp.MsgServiceRouter(),
authorityStr,
)

appKeepers.TransferKeeper = ibctransferkeeper.NewKeeper(
appCodec,
Expand All @@ -322,7 +336,7 @@ func NewAppKeeper(
)

// Middleware Stacks
appKeepers.ICAModule = ica.NewAppModule(nil, &appKeepers.ICAHostKeeper)
appKeepers.ICAModule = ica.NewAppModule(&appKeepers.ICAControllerKeeper, &appKeepers.ICAHostKeeper)
appKeepers.TransferModule = transfer.NewAppModule(appKeepers.TransferKeeper)

// create IBC module from bottom to top of stack
Expand All @@ -334,11 +348,15 @@ func NewAppKeeper(
// Add transfer stack to IBC Router

// Create Interchain Accounts Stack
var icaHostStack porttypes.IBCModule = icahost.NewIBCModule(appKeepers.ICAHostKeeper)
var (
icaHostStack porttypes.IBCModule = icahost.NewIBCModule(appKeepers.ICAHostKeeper)
icaControllerStack porttypes.IBCModule = icacontroller.NewIBCMiddleware(appKeepers.ICAControllerKeeper)
)

// Create IBC Router & seal
ibcRouter := porttypes.NewRouter().
AddRoute(icahosttypes.SubModuleName, icaHostStack).
AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
AddRoute(ibctransfertypes.ModuleName, transferStack)

ibcv2Router := ibcapi.NewRouter().
Expand Down Expand Up @@ -383,6 +401,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibcexported.ModuleName)
paramsKeeper.Subspace(icahosttypes.SubModuleName)
paramsKeeper.Subspace(icacontrollertypes.SubModuleName).WithKeyTable(icacontrollertypes.ParamKeyTable())

return paramsKeeper
}
2 changes: 2 additions & 0 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package keepers

import (
icacontrollertypes "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/controller/types"
icahosttypes "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/host/types"
ibctransfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types"
ibcexported "github.com/cosmos/ibc-go/v10/modules/core/exported"
Expand Down Expand Up @@ -43,6 +44,7 @@ func (appKeepers *AppKeepers) GenerateKeys() {
evidencetypes.StoreKey,
ibctransfertypes.StoreKey,
icahosttypes.StoreKey,
icacontrollertypes.StoreKey,
feegrant.StoreKey,
authzkeeper.StoreKey,
consensusparamtypes.StoreKey,
Expand Down
Loading