Skip to content

Commit

Permalink
Merge branch 'feat/ics20-v2-path-forwarding' into gjermund/6561-use-a…
Browse files Browse the repository at this point in the history
…-transfer-module-account-as-an-intermediary-address-for-forwards
  • Loading branch information
gjermundgaraba authored Jun 25, 2024
2 parents e626e94 + 272c12b commit b1a7a19
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/apps/transfer/keeper/forwarding.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
func (k Keeper) forwardPacket(ctx sdk.Context, data types.FungibleTokenPacketDataV2, packet channeltypes.Packet, receivedCoins sdk.Coins) error {
var nextForwardingPath types.Forwarding
if len(data.Forwarding.Hops) > 1 {
// remove the first hop since it has been completed (this chain has received the packet)
nextForwardingPath = types.NewForwarding(false, data.Forwarding.Hops[1:]...)
}

Expand Down
1 change: 1 addition & 0 deletions modules/apps/transfer/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func (k Keeper) unwindHops(ctx sdk.Context, msg *types.MsgTransfer) (*types.MsgT
return nil, errorsmod.Wrap(types.ErrInvalidForwarding, "cannot unwind a native token")
}
var unwindHops []types.Hop
// remove the first hop in denom as it is the current port/channel on this chain
for _, trace := range token.Denom.Trace[1:] {
unwindHops = append(unwindHops, types.Hop{PortId: trace.PortId, ChannelId: trace.ChannelId}) //nolint: gosimple
}
Expand Down

0 comments on commit b1a7a19

Please sign in to comment.