Skip to content

Commit

Permalink
fix: enable noop error in v2 timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
gjermundgaraba committed Feb 1, 2025
1 parent 0d58d59 commit f39dac2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions modules/core/04-channel/v2/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,7 @@ func (k *Keeper) Timeout(ctx context.Context, timeout *types.MsgTimeout) (*types
}

cacheCtx, writeFn := sdkCtx.CacheContext()
if err := k.timeoutPacket(cacheCtx, timeout.Packet, timeout.ProofUnreceived, timeout.ProofHeight); err != nil {
sdkCtx.Logger().Error("Timeout packet failed", "source-client", timeout.Packet.SourceClient, "destination-client", timeout.Packet.DestinationClient, "error", errorsmod.Wrap(err, "timeout packet failed"))
return nil, errorsmod.Wrapf(err, "timeout packet failed for source id: %s and destination id: %s", timeout.Packet.SourceClient, timeout.Packet.DestinationClient)
}
err = k.timeoutPacket(cacheCtx, timeout.Packet, timeout.ProofUnreceived, timeout.ProofHeight)

switch err {
case nil:
Expand Down
3 changes: 1 addition & 2 deletions modules/core/04-channel/v2/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ func (suite *KeeperTestSuite) TestMsgTimeout() {
malleate: func() {},
},
{
name: "failure: no-op",
name: "success: no-op",
malleate: func() {
suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.DeletePacketCommitment(suite.chainA.GetContext(), packet.SourceClient, packet.Sequence)

Expand All @@ -402,7 +402,6 @@ func (suite *KeeperTestSuite) TestMsgTimeout() {
return mock.MockApplicationCallbackError
}
},
expError: types.ErrNoOpMsg,
},
{
name: "failure: callback fails",
Expand Down

0 comments on commit f39dac2

Please sign in to comment.