aergo icon indicating copy to clipboard operation
aergo copied to clipboard

Discard events from failed protected calls

Open kroggen opened this issue 3 years ago • 2 comments

Suppose this case:

Contract A calls contract B via a protected call (pcall) Contract B emits an event and then fails on an assertion The execution returns to contract A, which continues normally and the transaction succeeds

The event emitted on the failed call to contract B should NOT be present on the receipt

As an example, the failed call could be an ARC1 transfer. If it fails, no event should be added


Case 2:

Contract A --> Contract B --> Contract C

Similar as before The first call (A -> B) is done via pcall and the second (B -> C) is done via a normal call

If contract C emits an event and succeeds, but contract B fails, then no events from both B and C should be on the receipt

kroggen avatar Jun 28 '22 02:06 kroggen

The same applies for both pcall and contract.pcall

kroggen avatar Dec 26 '22 16:12 kroggen

It is implemented on the fix/pcall-event branch

Waiting tests, merge and release

kroggen avatar May 03 '23 04:05 kroggen