fuels-ts icon indicating copy to clipboard operation
fuels-ts copied to clipboard

Handle decoding multi-contract logs gracefully

Open petertonysmith94 opened this issue 1 year ago • 2 comments

Issue

When dealing with multi-contracts (see this), users might call ContractA, which calls ContractB.

ContractA will require an ABI, ContractB will not. So, if ContractB has some log() calls, those may bubble up to ContractA, which won't be able to decode them due to the lack of an ABI definition, and then we throw.

The issue is that the transaction may have been successful, in which case throwing an error can be confusing.

Original Discussion.

Potential solutions

These solutions are worth considering, but requires more in-depth thought to understand if it can cause other problems.

  • We could print a warning instead of throwing an error when trying to decode ContractB logs as they come via ContractA. This approach could acknowledge the possible successful transaction while alerting the user to the decoding issue.

  • Maybe the better approach would be to not throw it here, and just log a warning.

petertonysmith94 avatar Apr 03 '24 11:04 petertonysmith94

@arboleya I went with bug, but wasn't 💯, please change as you see fit 😄

petertonysmith94 avatar Apr 03 '24 11:04 petertonysmith94

Was this resolved by #1936?

danielbate avatar May 12 '24 06:05 danielbate

@danielbate yes - closed by #1936

petertonysmith94 avatar May 20 '24 10:05 petertonysmith94