[go: up one dir, main page]

Kernel SDK: allow to enqueue heterogeneous batches of messages to outbox

What

This MR introduces a way to submit an atomic batch of outbox messages that can have different Michelson types in their parameters.

Why

Currently it's only possible to construct an outbox transaction batch with a static Michelson type as generic argument. This does not allow to e.g. call two different smart contracts with different parameter types.

How

OutboxMessage enum is renamed to OutboxMessageFull and refactored to allow different AtomicBatch backend implementations.
OutboxMessage remains as an alias for the homogeneous batch backend OutboxMessageTransactionBatch.

AtomicBatch is a new marker trait which requires serialization/deserialization traits implemented.

For tuples of size 2-5 new AtomicBatchN structures are macro generated, each type:

  • Wraps a tuple of OutboxMessageTransaction with potentially different parameter types
  • Implements AtomicBatch trait (and all the traits required by it)

Manually testing the MR

cargo test

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Michael Zaikin

Merge request reports

Loading