Skip to content

Commit

Permalink
Fix error wrapping on recursive calls (#1973)
Browse files Browse the repository at this point in the history
  • Loading branch information
pinosu authored Aug 28, 2024
1 parent cf2becd commit 66fd394
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion x/wasm/keeper/handler_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ type callDepthMessageHandler struct {
func (h callDepthMessageHandler) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmvmtypes.CosmosMsg) (events []sdk.Event, data [][]byte, msgResponses [][]*codectypes.Any, err error) {
ctx, err = checkAndIncreaseCallDepth(ctx, h.MaxCallDepth)
if err != nil {
return nil, nil, nil, err
return nil, nil, nil, errorsmod.Wrap(err, "dispatch")
}

return h.Messenger.DispatchMsg(ctx, contractAddr, contractIBCPortID, msg)
Expand Down
4 changes: 2 additions & 2 deletions x/wasm/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ func (k Keeper) execute(ctx context.Context, contractAddress, caller sdk.AccAddr

data, err := k.handleContractResponse(sdkCtx, contractAddress, contractInfo.IBCPortID, res.Ok.Messages, res.Ok.Attributes, res.Ok.Data, res.Ok.Events)
if err != nil {
return nil, errorsmod.Wrap(err, "dispatch")
return nil, err
}

return data, nil
Expand Down Expand Up @@ -1481,7 +1481,7 @@ func (h DefaultWasmVMContractResponseHandler) Handle(ctx sdk.Context, contractAd
result := origRspData
switch rsp, err := h.md.DispatchSubmessages(ctx, contractAddr, ibcPort, messages); {
case err != nil:
return nil, errorsmod.Wrap(err, "submessages")
return nil, err
case rsp != nil:
result = rsp
}
Expand Down

0 comments on commit 66fd394

Please sign in to comment.