From 08a1ec59566b4cadc5f97327b7dee547060eadc2 Mon Sep 17 00:00:00 2001 From: Justin Tieri <37750742+jtieri@users.noreply.github.com> Date: Wed, 4 Sep 2024 14:08:22 -0500 Subject: [PATCH] refactor: ensure the underlying apps `OnRecvPacket` callback is invoked --- .../packetforward/ibc_middleware.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/middleware/packet-forward-middleware/packetforward/ibc_middleware.go b/middleware/packet-forward-middleware/packetforward/ibc_middleware.go index db77d1e..b370b69 100644 --- a/middleware/packet-forward-middleware/packetforward/ibc_middleware.go +++ b/middleware/packet-forward-middleware/packetforward/ibc_middleware.go @@ -211,6 +211,11 @@ func (im IBCMiddleware) OnRecvPacket( return newErrorAcknowledgement(fmt.Errorf("failed to construct override receiver: %w", err)) } + if err := im.receiveFunds(ctx, packet, data, overrideReceiver, relayer); err != nil { + logger.Error("packetForwardMiddleware OnRecvPacket error receiving packet", "error", err) + return newErrorAcknowledgement(fmt.Errorf("error receiving packet: %w", err)) + } + // if this packet's token denom is already the base denom for some native token on this chain, // we do not need to do any further composition of the denom before forwarding the packet denomOnThisChain := data.Denom