Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(simapp): fixed inline middleware wiring comments #4361

Merged
merged 6 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions modules/apps/callbacks/testing/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.sendTransfer -> callbacks.SendPacket -> feeKeeper.SendPacket -> channel.SendPacket
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be best considering its the public name available

Suggested change
// transferKeeper.sendTransfer -> callbacks.SendPacket -> feeKeeper.SendPacket -> channel.SendPacket
// transferKeeper.Transfer -> callbacks.SendPacket -> feeKeeper.SendPacket -> channel.SendPacket

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be happy with keeping it as SendPacket to avoid any confusion


// 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
Expand All @@ -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
Expand Down Expand Up @@ -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.OnRecvPacket -> fee.OnAcknowledgementPacket -> channel.OnAcknowledgementPacket
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// mockModule.OnAcknowledgementPacket -> callbacks.OnRecvPacket -> 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))
Expand Down
3 changes: 1 addition & 2 deletions testing/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down