Skip to content

Proto/Client: refactor & fix injection

Context

Manager operations have attributes: fees, gas limit, storage limit, counter, source. The user doesn't need to specify all these attributes manually: the client will take care of automatically assigning them. Attributes can be in two abstract states:

  • unknown (not set by the user)
  • set by the user (possibly to an invalid value) Currently, these abstract states are encoded using optional arguments, extra variables and special values which makes this part of the code hard to understand and to maintain.

This MR proposes a refactor making the state of an manager operation attribute (unknown/set by the user) explicit. A noticeable change is that the automatic patching mechanism, currently called from inject_operation, is know only called from inject_manager_operation.

Fix #1143 (closed)

Manually testing the MR

This patch should preserve existing semantics.

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • 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, the Development Version section of CHANGES.md for everything else).
  • Select suitable reviewers using the Reviewers field below.
Edited by Mehdi Bouaziz

Merge request reports