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

chore: docs for HandshakeRoute/PacketRoute #7111

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all 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
7 changes: 6 additions & 1 deletion modules/core/05-port/types/router_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ func (rtr *AppRouter) AddRoute(module string, cbs IBCModule) *AppRouter {
return rtr
}

// PacketRoute returns a list of callbacks. It takes the portID of the packet
// (used for classic IBC packets) and the packet data (used for multi-packetdata's).
// PacketRoute is explicitly seprated from the handshake route which only handles
// ClassicIBCModule's. Non ClassicIBCModule routing does not work on handshakes.
func (rtr *AppRouter) PacketRoute(module string) ([]IBCModule, bool) {
if module == sentinelMultiPacketData {
return rtr.routeMultiPacketData(module)
Expand Down Expand Up @@ -115,7 +119,8 @@ func (rtr *AppRouter) routeToLegacyModule(module string) (ClassicIBCModule, bool
}

// HandshakeRoute returns the ClassicIBCModule which will implement all handshake functions
// and is required only for those callbacks.
// as it is required only for those callbacks. It takes in the portID associated with the
// handshake.
func (rtr *AppRouter) HandshakeRoute(portID string) (ClassicIBCModule, bool) {
route, ok := rtr.routeToLegacyModule(portID)
return route, ok
Expand Down
Loading