[go: up one dir, main page]

Everywhere: Use local (rather than global) return/fail

Context

Following the preparatory MRs

This MR moves the error-monad globals (return, ok, fail, error, >>=, >>?, etc.) into a dedicated Legacy_monad_globals namespace (module because that's what we have for namespaces).

This move prevents access to the globals. Instead, the local values of the syntax modules must be used (let open Lwt_tzresult_syntax in for example). For backwards compatibility, a dedicated struct is added to environments v0-v5 and all the protocol side-code (lib_delegate, bin_accuser, etc.) uses -open Legacy_monad_globals in their dune file.

Note that, with this change included, it is impossible to introduce legacy infix binders in converted code: the build will fail. This is the main aim of the MR.

Manually testing the MR

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 Raphaël Proust

Merge request reports

Loading