@@ -111,6 +111,9 @@ import (
111
111
icacontroller "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller"
112
112
icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper"
113
113
icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"
114
+ icahost "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host"
115
+ icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper"
116
+ icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"
114
117
icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"
115
118
ibcfee "github.com/cosmos/ibc-go/v8/modules/apps/29-fee"
116
119
ibcfeekeeper "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/keeper"
@@ -244,6 +247,7 @@ func StoreKeys() (
244
247
// ica keys
245
248
icacontrollertypes .StoreKey ,
246
249
icaauthtypes .StoreKey ,
250
+ icahosttypes .StoreKey ,
247
251
// ethermint keys
248
252
evmtypes .StoreKey , feemarkettypes .StoreKey ,
249
253
// this line is used by starport scaffolding # stargate/app/storeKey
@@ -299,6 +303,7 @@ type App struct {
299
303
IBCKeeper * ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
300
304
IBCFeeKeeper ibcfeekeeper.Keeper
301
305
ICAControllerKeeper icacontrollerkeeper.Keeper
306
+ ICAHostKeeper icahostkeeper.Keeper
302
307
ICAAuthKeeper icaauthkeeper.Keeper
303
308
EvidenceKeeper evidencekeeper.Keeper
304
309
TransferKeeper ibctransferkeeper.Keeper
@@ -424,6 +429,7 @@ func New(
424
429
scopedIBCKeeper := app .CapabilityKeeper .ScopeToModule (ibcexported .ModuleName )
425
430
scopedTransferKeeper := app .CapabilityKeeper .ScopeToModule (ibctransfertypes .ModuleName )
426
431
scopedICAControllerKeeper := app .CapabilityKeeper .ScopeToModule (icacontrollertypes .SubModuleName )
432
+ scopedICAHostKeeper := app .CapabilityKeeper .ScopeToModule (icahosttypes .SubModuleName )
427
433
scopedICAAuthKeeper := app .CapabilityKeeper .ScopeToModule (icaauthtypes .ModuleName )
428
434
429
435
// Applications that wish to enforce statically created ScopedKeepers should call `Seal` after creating
@@ -550,8 +556,14 @@ func New(
550
556
scopedICAControllerKeeper , app .MsgServiceRouter (),
551
557
authtypes .NewModuleAddress (govtypes .ModuleName ).String (),
552
558
)
553
-
554
- icaModule := ica .NewAppModule (& app .ICAControllerKeeper , nil )
559
+ app .ICAHostKeeper = icahostkeeper .NewKeeper (
560
+ appCodec , keys [icahosttypes .StoreKey ], ICAHostMockSubspace {},
561
+ app .IBCFeeKeeper , // ISC4 Wrapper: fee IBC middleware
562
+ app .IBCKeeper .ChannelKeeper , app .IBCKeeper .PortKeeper ,
563
+ app .AccountKeeper , scopedICAHostKeeper , app .MsgServiceRouter (),
564
+ authtypes .NewModuleAddress (govtypes .ModuleName ).String (),
565
+ )
566
+ icaModule := ica .NewAppModule (& app .ICAControllerKeeper , & app .ICAHostKeeper )
555
567
556
568
// Create Transfer Keepers
557
569
app .TransferKeeper = ibctransferkeeper .NewKeeper (
@@ -665,12 +677,17 @@ func New(
665
677
// we don't limit gas usage here, because the cronos keeper will use network parameter to control it.
666
678
icaControllerStack = ibccallbacks .NewIBCMiddleware (icaControllerStack , app .IBCFeeKeeper , app .CronosKeeper , math .MaxUint64 )
667
679
680
+ var icaHostStack porttypes.IBCModule
681
+ icaHostStack = icahost .NewIBCModule (app .ICAHostKeeper )
682
+ icaHostStack = ibcfee .NewIBCMiddleware (icaHostStack , app .IBCFeeKeeper )
683
+
668
684
// Create static IBC router, add transfer route, then set and seal it
669
685
ibcRouter := porttypes .NewRouter ()
670
686
// Add ontroller & ica auth modules to IBC router
671
687
ibcRouter .
672
688
AddRoute (icaauthtypes .ModuleName , icaControllerStack ).
673
689
AddRoute (icacontrollertypes .SubModuleName , icaControllerStack ).
690
+ AddRoute (icahosttypes .SubModuleName , icaHostStack ).
674
691
AddRoute (ibctransfertypes .ModuleName , transferStack )
675
692
676
693
// this line is used by starport scaffolding # ibc/app/router
0 commit comments