Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/learn/learn-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,21 @@ Vesting funds are on a release schedule that unlocks a constant number of tokens
(**linear vesting**) or the full amount after a specific block number (**cliff vesting**). In all
vesting cases, the lock decreases over time until all the funds are transferable.

### Batch Transfers
Comment thread
filippoweb3 marked this conversation as resolved.
Outdated

Batch transfers are transfers that include multiple calls. The `utility` pallet is used to dispatch batched calls, and there are three ways of doing it:
Comment thread
filippoweb3 marked this conversation as resolved.
Outdated
- `utility.batch()`: stops execution if it encounters an error and emits an event with the number of executed calls and the error of the failed call.
Comment thread
filippoweb3 marked this conversation as resolved.
Outdated
- `utility.batchAll()`: atomic batch execution, meaning that if a call within the batch fails, everything is rolled back as if nothing happened.
Comment thread
filippoweb3 marked this conversation as resolved.
Outdated
- `utility.forceBatch()`: All calls before and after one fails will be executed.
Comment thread
filippoweb3 marked this conversation as resolved.
Outdated

| Function | Stops on Error | Atomic | Events for Debugging |
|--------|--------|--------|--------|
| `batch`| Yes | No | Yes |
| `batchAll`| Yes | Yes | Not needed |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why it is not needed here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an "all or nothing" situation. No need to emit an event, as it will be 100% success or 100% failure

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a detailed table about events triggered for each case

|`forceBatch`| No | No | No |

For more detailed information about the arguments accepted by each of these calls, see [the Metadata Explorer](../general/metadata.md).

## Verifying Extrinsics

!!!danger
Expand Down