4

In Polkadot and Kusama emitted module events has the phase property so we can correlate them with the extrinsic that triggered that event but I can not do the same when the extrinsic is included in a utility.batch (https://polkadot.js.org/docs/substrate/extrinsics#batchcalls-veccall) extrinsic (as far as I know all the events are related to the utility.batch call so you can not correlate them individually).

Is there a way to correlate an event with the related extrinsic included in a utility.batch call?

1 Answer 1

5

The utility.batch call emits events which allow you to organize which extrinsic events are coming from each extrinsic.

Between each call, you should see an Event::ItemCompleted after an extrinsic as successfully completed, or a Event::BatchInterrupted if one of the items in the batch caused the whole batch to stop. After the whole batch is done, you will see Event::BatchCompleted.

You can see an example of that here: https://polkadot.subscan.io/extrinsic/8997424-2

enter image description here

Here you can see ItemCompleted between the crowdloan contribution (the first extrinsic), the memo being updated (the second extrinsic).

So it is just a matter of using these as delimiters, and organizing the events to the appropriate sub-batch call.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.