@@ -12,7 +12,6 @@ import (
12
12
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
13
13
dbm "github.com/cosmos/cosmos-db"
14
14
"github.com/cosmos/gogoproto/proto"
15
- ibccallbacks "github.com/cosmos/ibc-go/modules/apps/callbacks"
16
15
ica "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts"
17
16
icacontroller "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/controller"
18
17
icacontrollerkeeper "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/controller/keeper"
@@ -21,16 +20,16 @@ import (
21
20
icahostkeeper "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/host/keeper"
22
21
icahosttypes "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/host/types"
23
22
icatypes "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/types"
24
- ibcfee "github.com/cosmos/ibc-go/v10/modules/apps/29-fee"
25
- ibcfeekeeper "github.com/cosmos/ibc-go/v10/modules/apps/29-fee/keeper"
26
- ibcfeetypes "github.com/cosmos/ibc-go/v10/modules/apps/29-fee/types"
23
+ ibccallbacks "github.com/cosmos/ibc-go/v10/modules/apps/callbacks"
27
24
"github.com/cosmos/ibc-go/v10/modules/apps/transfer"
28
25
ibctransferkeeper "github.com/cosmos/ibc-go/v10/modules/apps/transfer/keeper"
29
26
ibctransfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types"
27
+ transferv2 "github.com/cosmos/ibc-go/v10/modules/apps/transfer/v2"
30
28
ibc "github.com/cosmos/ibc-go/v10/modules/core"
31
29
ibcclienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types"
32
30
ibcconnectiontypes "github.com/cosmos/ibc-go/v10/modules/core/03-connection/types"
33
31
porttypes "github.com/cosmos/ibc-go/v10/modules/core/05-port/types"
32
+ ibcapi "github.com/cosmos/ibc-go/v10/modules/core/api"
34
33
ibcexported "github.com/cosmos/ibc-go/v10/modules/core/exported"
35
34
ibckeeper "github.com/cosmos/ibc-go/v10/modules/core/keeper"
36
35
ibctm "github.com/cosmos/ibc-go/v10/modules/light-clients/07-tendermint"
@@ -173,7 +172,6 @@ var maccPerms = map[string][]string{
173
172
nft .ModuleName : nil ,
174
173
// non sdk modules
175
174
ibctransfertypes .ModuleName : {authtypes .Minter , authtypes .Burner },
176
- ibcfeetypes .ModuleName : nil ,
177
175
icatypes .ModuleName : nil ,
178
176
wasmtypes .ModuleName : {authtypes .Burner },
179
177
}
@@ -215,7 +213,6 @@ type WasmApp struct {
215
213
CircuitKeeper circuitkeeper.Keeper
216
214
217
215
IBCKeeper * ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
218
- IBCFeeKeeper ibcfeekeeper.Keeper
219
216
ICAControllerKeeper icacontrollerkeeper.Keeper
220
217
ICAHostKeeper icahostkeeper.Keeper
221
218
TransferKeeper ibctransferkeeper.Keeper
@@ -309,7 +306,7 @@ func NewWasmApp(
309
306
evidencetypes .StoreKey , circuittypes .StoreKey ,
310
307
authzkeeper .StoreKey , nftkeeper .StoreKey , group .StoreKey ,
311
308
// non sdk store keys
312
- ibcexported .StoreKey , ibctransfertypes .StoreKey , ibcfeetypes . StoreKey ,
309
+ ibcexported .StoreKey , ibctransfertypes .StoreKey ,
313
310
wasmtypes .StoreKey , icahosttypes .StoreKey ,
314
311
icacontrollertypes .StoreKey ,
315
312
)
@@ -543,21 +540,14 @@ func NewWasmApp(
543
540
// If evidence needs to be handled for the app, set routes in router here and seal
544
541
app .EvidenceKeeper = * evidenceKeeper
545
542
546
- // IBC Fee Module keeper
547
- app .IBCFeeKeeper = ibcfeekeeper .NewKeeper (
548
- appCodec , runtime .NewKVStoreService (keys [ibcfeetypes .StoreKey ]),
549
- app .IBCKeeper .ChannelKeeper , // may be replaced with IBC middleware
550
- app .IBCKeeper .ChannelKeeper ,
551
- app .AccountKeeper , app .BankKeeper ,
552
- )
553
-
554
543
// Create Transfer Keepers
555
544
app .TransferKeeper = ibctransferkeeper .NewKeeper (
556
545
appCodec ,
557
546
runtime .NewKVStoreService (keys [ibctransfertypes .StoreKey ]),
558
547
app .GetSubspace (ibctransfertypes .ModuleName ),
559
- app .IBCFeeKeeper , // ISC4 Wrapper: fee IBC middleware
560
548
app .IBCKeeper .ChannelKeeper ,
549
+ app .IBCKeeper .ChannelKeeper ,
550
+ app .MsgServiceRouter (),
561
551
app .AccountKeeper ,
562
552
app .BankKeeper ,
563
553
authtypes .NewModuleAddress (govtypes .ModuleName ).String (),
@@ -567,7 +557,7 @@ func NewWasmApp(
567
557
appCodec ,
568
558
runtime .NewKVStoreService (keys [icahosttypes .StoreKey ]),
569
559
app .GetSubspace (icahosttypes .SubModuleName ),
570
- app .IBCFeeKeeper , // use ics29 fee as ics4Wrapper in middleware stack
560
+ app .IBCKeeper . ChannelKeeper ,
571
561
app .IBCKeeper .ChannelKeeper ,
572
562
app .AccountKeeper ,
573
563
app .MsgServiceRouter (),
@@ -579,7 +569,7 @@ func NewWasmApp(
579
569
appCodec ,
580
570
runtime .NewKVStoreService (keys [icacontrollertypes .StoreKey ]),
581
571
app .GetSubspace (icacontrollertypes .SubModuleName ),
582
- app .IBCFeeKeeper , // use ics29 fee as ics4Wrapper in middleware stack
572
+ app .IBCKeeper . ChannelKeeper ,
583
573
app .IBCKeeper .ChannelKeeper ,
584
574
app .MsgServiceRouter (),
585
575
authtypes .NewModuleAddress (govtypes .ModuleName ).String (),
@@ -600,7 +590,7 @@ func NewWasmApp(
600
590
app .BankKeeper ,
601
591
app .StakingKeeper ,
602
592
distrkeeper .NewQuerier (app .DistrKeeper ),
603
- app .IBCFeeKeeper , // ISC4 Wrapper: fee IBC middleware
593
+ app .IBCKeeper . ChannelKeeper ,
604
594
app .IBCKeeper .ChannelKeeper ,
605
595
app .TransferKeeper ,
606
596
app .MsgServiceRouter (),
@@ -614,9 +604,7 @@ func NewWasmApp(
614
604
)
615
605
616
606
// Create fee enabled wasm ibc Stack
617
- var wasmStack porttypes.IBCModule
618
- wasmStackIBCHandler := wasm .NewIBCHandler (app .WasmKeeper , app .IBCKeeper .ChannelKeeper , app .IBCFeeKeeper )
619
- wasmStack = ibcfee .NewIBCMiddleware (wasmStackIBCHandler , app .IBCFeeKeeper )
607
+ wasmStackIBCHandler := wasm .NewIBCHandler (app .WasmKeeper , app .IBCKeeper .ChannelKeeper , app .IBCKeeper .ChannelKeeper )
620
608
621
609
// Create Interchain Accounts Stack
622
610
// SendPacket, since it is originating from the application to core IBC:
@@ -628,35 +616,35 @@ func NewWasmApp(
628
616
icaControllerStack = icacontroller .NewIBCMiddlewareWithAuth (noAuthzModule , app .ICAControllerKeeper )
629
617
// app.ICAAuthModule = icaControllerStack.(ibcmock.IBCModule)
630
618
icaControllerStack = icacontroller .NewIBCMiddlewareWithAuth (icaControllerStack , app .ICAControllerKeeper )
631
- icaControllerStack = ibccallbacks .NewIBCMiddleware (icaControllerStack , app .IBCFeeKeeper , wasmStackIBCHandler , wasm .DefaultMaxIBCCallbackGas )
619
+ icaControllerStack = ibccallbacks .NewIBCMiddleware (icaControllerStack , app .IBCKeeper . ChannelKeeper , wasmStackIBCHandler , wasm .DefaultMaxIBCCallbackGas )
632
620
icaICS4Wrapper := icaControllerStack .(porttypes.ICS4Wrapper )
633
- icaControllerStack = ibcfee .NewIBCMiddleware (icaControllerStack , app .IBCFeeKeeper )
634
621
// Since the callbacks middleware itself is an ics4wrapper, it needs to be passed to the ica controller keeper
635
622
app .ICAControllerKeeper .WithICS4Wrapper (icaICS4Wrapper )
636
623
637
624
// RecvPacket, message that originates from core IBC and goes down to app, the flow is:
638
- // channel.RecvPacket -> fee.OnRecvPacket -> icaHost.OnRecvPacket
639
- var icaHostStack porttypes.IBCModule
640
- icaHostStack = icahost .NewIBCModule (app .ICAHostKeeper )
641
- icaHostStack = ibcfee .NewIBCMiddleware (icaHostStack , app .IBCFeeKeeper )
625
+ // channel.RecvPacket -> icaHost.OnRecvPacket
626
+ icaHostStack := icahost .NewIBCModule (app .ICAHostKeeper )
642
627
643
628
// Create Transfer Stack
644
629
var transferStack porttypes.IBCModule
645
630
transferStack = transfer .NewIBCModule (app .TransferKeeper )
646
- transferStack = ibccallbacks .NewIBCMiddleware (transferStack , app .IBCFeeKeeper , wasmStackIBCHandler , wasm .DefaultMaxIBCCallbackGas )
631
+ transferStack = ibccallbacks .NewIBCMiddleware (transferStack , app .IBCKeeper . ChannelKeeper , wasmStackIBCHandler , wasm .DefaultMaxIBCCallbackGas )
647
632
transferICS4Wrapper := transferStack .(porttypes.ICS4Wrapper )
648
- transferStack = ibcfee .NewIBCMiddleware (transferStack , app .IBCFeeKeeper )
649
633
// Since the callbacks middleware itself is an ics4wrapper, it needs to be passed to the ica controller keeper
650
634
app .TransferKeeper .WithICS4Wrapper (transferICS4Wrapper )
651
635
652
636
// Create static IBC router, add app routes, then set and seal it
653
637
ibcRouter := porttypes .NewRouter ().
654
638
AddRoute (ibctransfertypes .ModuleName , transferStack ).
655
- AddRoute (wasmtypes .ModuleName , wasmStack ).
639
+ AddRoute (wasmtypes .ModuleName , wasmStackIBCHandler ).
656
640
AddRoute (icacontrollertypes .SubModuleName , icaControllerStack ).
657
641
AddRoute (icahosttypes .SubModuleName , icaHostStack )
658
642
app .IBCKeeper .SetRouter (ibcRouter )
659
643
644
+ ibcRouterV2 := ibcapi .NewRouter ().
645
+ AddRoute (ibctransfertypes .PortID , transferv2 .NewIBCModule (app .TransferKeeper ))
646
+ app .IBCKeeper .SetRouterV2 (ibcRouterV2 )
647
+
660
648
clientKeeper := app .IBCKeeper .ClientKeeper
661
649
storeProvider := app .IBCKeeper .ClientKeeper .GetStoreProvider ()
662
650
@@ -699,7 +687,6 @@ func NewWasmApp(
699
687
wasm .NewAppModule (appCodec , & app .WasmKeeper , app .StakingKeeper , app .AccountKeeper , app .BankKeeper , app .MsgServiceRouter (), app .GetSubspace (wasmtypes .ModuleName )),
700
688
ibc .NewAppModule (app .IBCKeeper ),
701
689
transfer .NewAppModule (app .TransferKeeper ),
702
- ibcfee .NewAppModule (app .IBCFeeKeeper ),
703
690
ica .NewAppModule (& app .ICAControllerKeeper , & app .ICAHostKeeper ),
704
691
ibctm .NewAppModule (tmLightClientModule ),
705
692
// sdk
@@ -744,7 +731,6 @@ func NewWasmApp(
744
731
ibctransfertypes .ModuleName ,
745
732
ibcexported .ModuleName ,
746
733
icatypes .ModuleName ,
747
- ibcfeetypes .ModuleName ,
748
734
wasmtypes .ModuleName ,
749
735
)
750
736
@@ -759,7 +745,6 @@ func NewWasmApp(
759
745
ibctransfertypes .ModuleName ,
760
746
ibcexported .ModuleName ,
761
747
icatypes .ModuleName ,
762
- ibcfeetypes .ModuleName ,
763
748
wasmtypes .ModuleName ,
764
749
)
765
750
@@ -782,7 +767,6 @@ func NewWasmApp(
782
767
ibctransfertypes .ModuleName ,
783
768
ibcexported .ModuleName ,
784
769
icatypes .ModuleName ,
785
- ibcfeetypes .ModuleName ,
786
770
// wasm after ibc transfer
787
771
wasmtypes .ModuleName ,
788
772
}
0 commit comments