@@ -123,16 +123,10 @@ import (
123
123
ibckeeper "github.com/cosmos/ibc-go/v9/modules/core/keeper"
124
124
solomachine "github.com/cosmos/ibc-go/v9/modules/light-clients/06-solomachine"
125
125
ibctm "github.com/cosmos/ibc-go/v9/modules/light-clients/07-tendermint"
126
- "github.com/cosmos/ibc-go/v9/testing/mock"
127
126
)
128
127
129
128
const appName = "SimApp"
130
129
131
- // IBC application testing ports
132
- const (
133
- MockFeePort string = mock .ModuleName + ibcfeetypes .ModuleName
134
- )
135
-
136
130
var (
137
131
// DefaultNodeHome default home directories for the application daemon
138
132
DefaultNodeHome string
@@ -148,7 +142,6 @@ var (
148
142
ibctransfertypes .ModuleName : {authtypes .Minter , authtypes .Burner },
149
143
ibcfeetypes .ModuleName : nil ,
150
144
icatypes .ModuleName : nil ,
151
- mock .ModuleName : nil ,
152
145
}
153
146
)
154
147
@@ -167,9 +160,8 @@ type SimApp struct {
167
160
interfaceRegistry types.InterfaceRegistry
168
161
169
162
// keys to access the substores
170
- keys map [string ]* storetypes.KVStoreKey
171
- tkeys map [string ]* storetypes.TransientStoreKey
172
- memKeys map [string ]* storetypes.MemoryStoreKey
163
+ keys map [string ]* storetypes.KVStoreKey
164
+ tkeys map [string ]* storetypes.TransientStoreKey
173
165
174
166
// keepers
175
167
AccountKeeper authkeeper.AccountKeeper
@@ -194,12 +186,6 @@ type SimApp struct {
194
186
ConsensusParamsKeeper consensusparamkeeper.Keeper
195
187
CircuitKeeper circuitkeeper.Keeper
196
188
197
- // make IBC modules public for test purposes
198
- // these modules are never directly routed to by the IBC Router
199
- IBCMockModule mock.IBCModule
200
- ICAAuthModule mock.IBCModule
201
- FeeMockModule mock.IBCModule
202
-
203
189
// the module manager
204
190
ModuleManager * module.Manager
205
191
BasicModuleManager module.BasicManager
@@ -293,7 +279,6 @@ func NewSimApp(
293
279
}
294
280
295
281
tkeys := storetypes .NewTransientStoreKeys (paramstypes .TStoreKey )
296
- memKeys := storetypes .NewMemoryStoreKeys (mock .MemStoreKey )
297
282
298
283
app := & SimApp {
299
284
BaseApp : bApp ,
@@ -303,7 +288,6 @@ func NewSimApp(
303
288
interfaceRegistry : interfaceRegistry ,
304
289
keys : keys ,
305
290
tkeys : tkeys ,
306
- memKeys : memKeys ,
307
291
}
308
292
309
293
app .ParamsKeeper = initParamsKeeper (appCodec , legacyAmino , keys [paramstypes .StoreKey ], tkeys [paramstypes .TStoreKey ])
@@ -430,25 +414,6 @@ func NewSimApp(
430
414
authtypes .NewModuleAddress (govtypes .ModuleName ).String (),
431
415
)
432
416
433
- // Mock Module Stack
434
-
435
- // Mock Module setup for testing IBC and also acts as the interchain accounts authentication module
436
- // NOTE: the IBC mock keeper and application module is used only for testing core IBC. Do
437
- // not replicate if you do not need to test core IBC or light clients.
438
- mockModule := mock .NewAppModule ()
439
-
440
- // The mock module is used for testing IBC
441
- mockIBCModule := mock .NewIBCModule (& mockModule , mock .NewIBCApp (mock .ModuleName ))
442
- app .IBCMockModule = mockIBCModule
443
- ibcRouter .AddRoute (mock .ModuleName , mockIBCModule )
444
-
445
- // Mock IBC app wrapped with a middleware which does not implement the UpgradeableModule interface.
446
- // NOTE: this is used to test integration with apps which do not yet fulfill the UpgradeableModule interface and error when
447
- // an upgrade is tried on the channel.
448
- mockBlockUpgradeIBCModule := mock .NewIBCModule (& mockModule , mock .NewIBCApp (mock .MockBlockUpgrade ))
449
- mockBlockUpgradeMw := mock .NewBlockUpgradeMiddleware (& mockModule , mockBlockUpgradeIBCModule .IBCApp )
450
- ibcRouter .AddRoute (mock .MockBlockUpgrade , mockBlockUpgradeMw )
451
-
452
417
// Create Transfer Stack
453
418
// SendPacket, since it is originating from the application to core IBC:
454
419
// transferKeeper.SendPacket -> fee.SendPacket -> channel.SendPacket
@@ -471,15 +436,7 @@ func NewSimApp(
471
436
// Create Interchain Accounts Stack
472
437
// SendPacket, since it is originating from the application to core IBC:
473
438
// icaControllerKeeper.SendTx -> fee.SendPacket -> channel.SendPacket
474
-
475
- // initialize ICA module with mock module as the authentication module on the controller side
476
439
var icaControllerStack porttypes.IBCModule
477
- icaControllerStack = mock .NewIBCModule (& mockModule , mock .NewIBCApp ("" ))
478
- var ok bool
479
- app .ICAAuthModule , ok = icaControllerStack .(mock.IBCModule )
480
- if ! ok {
481
- panic (fmt .Errorf ("cannot convert %T into %T" , icaControllerStack , app .ICAAuthModule ))
482
- }
483
440
icaControllerStack = icacontroller .NewIBCMiddleware (app .ICAControllerKeeper )
484
441
icaControllerStack = ibcfee .NewIBCMiddleware (icaControllerStack , app .IBCFeeKeeper )
485
442
@@ -493,23 +450,7 @@ func NewSimApp(
493
450
// Add host, controller & ica auth modules to IBC router
494
451
ibcRouter .
495
452
AddRoute (icacontrollertypes .SubModuleName , icaControllerStack ).
496
- AddRoute (icahosttypes .SubModuleName , icaHostStack ).
497
- AddRoute (mock .ModuleName + icacontrollertypes .SubModuleName , icaControllerStack ) // ica with mock auth module stack route to ica (top level of middleware stack)
498
-
499
- // Create Mock IBC Fee module stack for testing
500
- // SendPacket, mock module cannot send packets
501
-
502
- // OnRecvPacket, message that originates from core IBC and goes down to app, the flow is the otherway
503
- // channel.RecvPacket -> fee.OnRecvPacket -> mockModule.OnRecvPacket
504
-
505
- // OnAcknowledgementPacket as this is where fee's are paid out
506
- // mockModule.OnAcknowledgementPacket -> fee.OnAcknowledgementPacket -> channel.OnAcknowledgementPacket
507
-
508
- // create fee wrapped mock module
509
- feeMockModule := mock .NewIBCModule (& mockModule , mock .NewIBCApp (MockFeePort ))
510
- app .FeeMockModule = feeMockModule
511
- feeWithMockModule := ibcfee .NewIBCMiddleware (feeMockModule , app .IBCFeeKeeper )
512
- ibcRouter .AddRoute (MockFeePort , feeWithMockModule )
453
+ AddRoute (icahosttypes .SubModuleName , icaHostStack )
513
454
514
455
// Seal the IBC Router
515
456
app .IBCKeeper .SetRouter (ibcRouter )
@@ -566,7 +507,6 @@ func NewSimApp(
566
507
transfer .NewAppModule (app .TransferKeeper ),
567
508
ibcfee .NewAppModule (app .IBCFeeKeeper ),
568
509
ica .NewAppModule (& app .ICAControllerKeeper , & app .ICAHostKeeper ),
569
- mockModule ,
570
510
571
511
// IBC light clients
572
512
ibctm .NewAppModule (tmLightClientModule ),
@@ -611,7 +551,6 @@ func NewSimApp(
611
551
authz .ModuleName ,
612
552
icatypes .ModuleName ,
613
553
ibcfeetypes .ModuleName ,
614
- mock .ModuleName ,
615
554
)
616
555
app .ModuleManager .SetOrderEndBlockers (
617
556
crisistypes .ModuleName ,
@@ -623,7 +562,6 @@ func NewSimApp(
623
562
feegrant .ModuleName ,
624
563
icatypes .ModuleName ,
625
564
ibcfeetypes .ModuleName ,
626
- mock .ModuleName ,
627
565
group .ModuleName ,
628
566
)
629
567
@@ -635,7 +573,7 @@ func NewSimApp(
635
573
banktypes .ModuleName , distrtypes .ModuleName , stakingtypes .ModuleName ,
636
574
slashingtypes .ModuleName , govtypes .ModuleName , minttypes .ModuleName , crisistypes .ModuleName ,
637
575
ibcexported .ModuleName , genutiltypes .ModuleName , evidencetypes .ModuleName , authz .ModuleName , ibctransfertypes .ModuleName ,
638
- icatypes .ModuleName , ibcfeetypes .ModuleName , mock . ModuleName , feegrant .ModuleName , paramstypes .ModuleName , upgradetypes .ModuleName ,
576
+ icatypes .ModuleName , ibcfeetypes .ModuleName , feegrant .ModuleName , paramstypes .ModuleName , upgradetypes .ModuleName ,
639
577
vestingtypes .ModuleName , group .ModuleName , consensusparamtypes .ModuleName , circuittypes .ModuleName ,
640
578
}
641
579
app .ModuleManager .SetOrderInitGenesis (genesisModuleOrder ... )
@@ -680,7 +618,6 @@ func NewSimApp(
680
618
// initialize stores
681
619
app .MountKVStores (keys )
682
620
app .MountTransientStores (tkeys )
683
- app .MountMemoryStores (memKeys )
684
621
685
622
// initialize BaseApp
686
623
app .SetInitChainer (app .InitChainer )
@@ -949,7 +886,6 @@ func BlockedAddresses() map[string]bool {
949
886
950
887
// allow the following addresses to receive funds
951
888
delete (modAccAddrs , authtypes .NewModuleAddress (govtypes .ModuleName ).String ())
952
- delete (modAccAddrs , authtypes .NewModuleAddress (mock .ModuleName ).String ())
953
889
954
890
return modAccAddrs
955
891
}
@@ -968,10 +904,3 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
968
904
969
905
return paramsKeeper
970
906
}
971
-
972
- // GetMemKey returns the MemStoreKey for the provided mem key.
973
- //
974
- // NOTE: This is solely used for testing purposes.
975
- func (app * SimApp ) GetMemKey (storeKey string ) * storetypes.MemoryStoreKey {
976
- return app .memKeys [storeKey ]
977
- }
0 commit comments