From 0dbd3f811928b216418a45ea164d184eec86cc67 Mon Sep 17 00:00:00 2001 From: srdtrk <59252793+srdtrk@users.noreply.github.com> Date: Thu, 17 Aug 2023 12:42:41 +0300 Subject: [PATCH] docs(simapp): fixed inline middleware wiring comments (#4361) * docs(callbacks/simapp): fixed inline stack documentation * docs(testing/simapp): fixed inline stack documentation * docs(testing/simapp): fixed icacontroller inline stack documentation * docs(simapp): improved icaController stack's documentation * docs(callbacks/simapp): review fixes --- modules/apps/callbacks/testing/simapp/app.go | 13 ++++++------- testing/simapp/app.go | 5 ++--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/modules/apps/callbacks/testing/simapp/app.go b/modules/apps/callbacks/testing/simapp/app.go index 7d1d6013b6b..bbe9e17d252 100644 --- a/modules/apps/callbacks/testing/simapp/app.go +++ b/modules/apps/callbacks/testing/simapp/app.go @@ -522,7 +522,7 @@ func NewSimApp( // Create Transfer Stack // SendPacket, since it is originating from the application to core IBC: - // transferKeeper.SendPacket -> fee.SendPacket -> callbacks.SendPacket -> channel.SendPacket + // transferKeeper.SendPacket -> callbacks.SendPacket -> feeKeeper.SendPacket -> channel.SendPacket // RecvPacket, message that originates from core IBC and goes down to app, the flow is the other way // channel.RecvPacket -> callbacks.OnRecvPacket -> fee.OnRecvPacket -> transfer.OnRecvPacket @@ -545,7 +545,7 @@ func NewSimApp( // Create Interchain Accounts Stack // SendPacket, since it is originating from the application to core IBC: - // icaAuthModuleKeeper.SendTx -> icaController.SendPacket -> fee.SendPacket -> callbacks.SendPacket -> channel.SendPacket + // icaControllerKeeper.SendTx -> callbacks.SendPacket -> fee.SendPacket -> channel.SendPacket // initialize ICA module with mock module as the authentication module on the controller side var icaControllerStack porttypes.IBCModule @@ -558,7 +558,7 @@ func NewSimApp( app.ICAControllerKeeper.WithICS4Wrapper(icaControllerStack.(porttypes.Middleware)) // RecvPacket, message that originates from core IBC and goes down to app, the flow is: - // channel.RecvPacket -> callbacks.OnRecvPacket -> fee.OnRecvPacket -> icaHost.OnRecvPacket + // channel.RecvPacket -> fee.OnRecvPacket -> icaHost.OnRecvPacket var icaHostStack porttypes.IBCModule icaHostStack = icahost.NewIBCModule(app.ICAHostKeeper) @@ -574,14 +574,13 @@ func NewSimApp( AddRoute(ibcmock.ModuleName+icacontrollertypes.SubModuleName, icaControllerStack) // ica with mock auth module stack route to ica (top level of middleware stack) // Create Mock IBC Fee module stack for testing - // SendPacket, since it is originating from the application to core IBC: - // mockModule.SendPacket -> fee.SendPacket -> channel.SendPacket + // SendPacket, mock module cannot send packets // OnRecvPacket, message that originates from core IBC and goes down to app, the flow is the otherway - // channel.RecvPacket -> fee.OnRecvPacket -> mockModule.OnRecvPacket + // channel.RecvPacket -> callbacks.OnRecvPacket -> fee.OnRecvPacket -> mockModule.OnRecvPacket // OnAcknowledgementPacket as this is where fee's are paid out - // mockModule.OnAcknowledgementPacket -> fee.OnAcknowledgementPacket -> channel.OnAcknowledgementPacket + // mockModule.OnAcknowledgementPacket -> callbacks.OnAcknowledgementPacket -> fee.OnAcknowledgementPacket -> channel.OnAcknowledgementPacket // create fee wrapped mock module feeMockModule := ibcmock.NewIBCModule(&mockModule, ibcmock.NewIBCApp(MockFeePort, scopedFeeMockKeeper)) diff --git a/testing/simapp/app.go b/testing/simapp/app.go index b267158af08..04486fe65d4 100644 --- a/testing/simapp/app.go +++ b/testing/simapp/app.go @@ -534,7 +534,7 @@ func NewSimApp( // Create Interchain Accounts Stack // SendPacket, since it is originating from the application to core IBC: - // icaAuthModuleKeeper.SendTx -> icaController.SendPacket -> fee.SendPacket -> channel.SendPacket + // icaControllerKeeper.SendTx -> fee.SendPacket -> channel.SendPacket // initialize ICA module with mock module as the authentication module on the controller side var icaControllerStack porttypes.IBCModule @@ -560,8 +560,7 @@ func NewSimApp( AddRoute(ibcmock.ModuleName+icacontrollertypes.SubModuleName, icaControllerStack) // ica with mock auth module stack route to ica (top level of middleware stack) // Create Mock IBC Fee module stack for testing - // SendPacket, since it is originating from the application to core IBC: - // mockModule.SendPacket -> fee.SendPacket -> channel.SendPacket + // SendPacket, mock module cannot send packets // OnRecvPacket, message that originates from core IBC and goes down to app, the flow is the otherway // channel.RecvPacket -> fee.OnRecvPacket -> mockModule.OnRecvPacket