Skip to content

Commit

Permalink
chore: clean up case for v1.
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisJim committed Aug 26, 2024
1 parent eb58206 commit dae4f7f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions modules/core/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1149,18 +1149,19 @@ func convertToErrorEvents(events sdk.Events) sdk.Events {
// version is not supported.
func (k *Keeper) getPacketHandlerAndModule(ctx sdk.Context, protocolVersion channeltypes.IBCVersion, port, channel string) (PacketHandler, string, *capabilitytypes.Capability, error) {
var (
packetHandler PacketHandler
module string
capability *capabilitytypes.Capability
err error
module string
capability *capabilitytypes.Capability
err error
)

switch protocolVersion {
case channeltypes.IBC_VERSION_UNSPECIFIED, channeltypes.IBC_VERSION_1:
packetHandler = k.ChannelKeeper
// Lookup module by channel capability
module, capability, err = k.ChannelKeeper.LookupModuleByChannel(ctx, port, channel)
return packetHandler, module, capability, err
if err != nil {
return nil, "", nil, err
}
return k.ChannelKeeper, module, capability, nil
case channeltypes.IBC_VERSION_2:
return k.PacketServerKeeper, port, nil, nil
default:
Expand Down

0 comments on commit dae4f7f

Please sign in to comment.