Skip to content

Commit

Permalink
fix: use UTC time for packet timeout error (#4476) (#4496)
Browse files Browse the repository at this point in the history
(cherry picked from commit 674d832)

Co-authored-by: Tom <54514587+GAtom22@users.noreply.github.com>
  • Loading branch information
mergify[bot] and GAtom22 committed Aug 29, 2023
1 parent 9403a8b commit ec70e62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/core/04-channel/keeper/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (k Keeper) SendPacket(
if packet.GetTimeoutTimestamp() != 0 && latestTimestamp >= packet.GetTimeoutTimestamp() {
return 0, sdkerrors.Wrapf(
types.ErrPacketTimeout,
"receiving chain block timestamp >= packet timeout timestamp (%s >= %s)", time.Unix(0, int64(latestTimestamp)), time.Unix(0, int64(packet.GetTimeoutTimestamp())),
"receiving chain block timestamp >= packet timeout timestamp (%s >= %s)", time.Unix(0, int64(latestTimestamp)).UTC(), time.Unix(0, int64(packet.GetTimeoutTimestamp())).UTC(),
)
}

Expand Down Expand Up @@ -189,7 +189,7 @@ func (k Keeper) RecvPacket(
if packet.GetTimeoutTimestamp() != 0 && uint64(ctx.BlockTime().UnixNano()) >= packet.GetTimeoutTimestamp() {
return sdkerrors.Wrapf(
types.ErrPacketTimeout,
"block timestamp >= packet timeout timestamp (%s >= %s)", ctx.BlockTime(), time.Unix(0, int64(packet.GetTimeoutTimestamp())),
"block timestamp >= packet timeout timestamp (%s >= %s)", ctx.BlockTime(), time.Unix(0, int64(packet.GetTimeoutTimestamp())).UTC(),
)
}

Expand Down

0 comments on commit ec70e62

Please sign in to comment.