Skip to content

Commit 2749602

Browse files
feat: Unit tests for Packet Forward Middleware (#8313)
Co-authored-by: Gjermund Garaba <gjermund@garaba.net>
1 parent 1f5a087 commit 2749602

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

testing/simapp/app.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,8 @@ func NewSimApp(
385385

386386
app.PFMKeeper.SetTransferKeeper(app.TransferKeeper)
387387

388+
app.PFMKeeper.SetTransferKeeper(app.TransferKeeper)
389+
388390
// Mock Module Stack
389391

390392
// Mock Module setup for testing IBC and also acts as the interchain accounts authentication module
@@ -437,11 +439,14 @@ func NewSimApp(
437439

438440
var icaHostStack porttypes.IBCModule = icahost.NewIBCModule(app.ICAHostKeeper)
439441

442+
pfmStack := packetforward.NewIBCMiddleware(transferStack, app.PFMKeeper, 0, packetforwardkeeper.DefaultForwardTransferPacketTimeoutTimestamp)
443+
440444
// Add host, controller & ica auth modules to IBC router
441445
ibcRouter.
442446
AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
443447
AddRoute(icahosttypes.SubModuleName, icaHostStack).
444-
AddRoute(ibcmock.ModuleName+icacontrollertypes.SubModuleName, icaControllerStack) // ica with mock auth module stack route to ica (top level of middleware stack)
448+
AddRoute(ibcmock.ModuleName+icacontrollertypes.SubModuleName, icaControllerStack). // ica with mock auth module stack route to ica (top level of middleware stack)
449+
AddRoute(packetforwardtypes.ModuleName, pfmStack)
445450

446451
// create two separate mock v2 applications so that it is possible to test multi packet data.
447452
mockV2A := mockv2.NewIBCModule()

0 commit comments

Comments
 (0)