Skip to content

Commit

Permalink
differentiate API call failure from ErrCannotFindCctx
Browse files Browse the repository at this point in the history
  • Loading branch information
ws4charlie committed Jan 11, 2024
1 parent 9de5287 commit 04271a2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions x/crosschain/keeper/msg_server_add_to_outtx_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ func (k msgServer) AddToOutTxTracker(goCtx context.Context, msg *types.MsgAddToO
ChainID: msg.ChainId,
Nonce: msg.Nonce,
})
if err != nil || cctx == nil || cctx.CrossChainTx == nil {
return nil, cosmoserrors.Wrap(types.ErrCannotFindCctx, "cannot add out tx: no corresponding cctx found")
if err != nil {
return nil, cosmoserrors.Wrap(err, "CcxtByNonce failed")
}
if cctx == nil || cctx.CrossChainTx == nil {
return nil, cosmoserrors.Wrapf(types.ErrCannotFindCctx, "no corresponding cctx found for chain %d, nonce %d", msg.ChainId, msg.Nonce)
}
// tracker submission is only allowed when the cctx is pending
if !IsPending(*cctx.CrossChainTx) {
Expand Down

0 comments on commit 04271a2

Please sign in to comment.