Skip to content

Commit

Permalink
fix: ibc-go v3.4.x huckleberry patch
Browse files Browse the repository at this point in the history
  • Loading branch information
harish551 authored May 26, 2023
1 parent d409970 commit f09c7ca
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/core/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,13 @@ func (k Keeper) RecvPacket(goCtx context.Context, msg *channeltypes.MsgRecvPacke
// Cache context so that we may discard state changes from callback if the acknowledgement is unsuccessful.
cacheCtx, writeFn = ctx.CacheContext()
ack := cbs.OnRecvPacket(cacheCtx, msg.Packet, relayer)
// NOTE: The context returned by CacheContext() refers to a new EventManager, so it needs to explicitly set events to the original context.
// Events from callback are emitted regardless of acknowledgement success
ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events())
if ack == nil || ack.Success() {
// write application state changes for asynchronous and successful acknowledgements
writeFn()

// NOTE: The context returned by CacheContext() refers to a new EventManager, so it needs to explicitly set events to the original context.
// Events from callback are emitted regardless of acknowledgement success
ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events())
}

// Set packet acknowledgement only if the acknowledgement is not nil.
Expand Down

0 comments on commit f09c7ca

Please sign in to comment.