Skip to content

[#538] Fix serialization of micheline expressions with `edo` instructions

Diogo Castro requested to merge diogo/#538-fix-encoding-edo-instrs into master

Description

This MR fixes the (de)serialization of the recently-introduced edo instructions to/from JSON.

This happened because they were added in the wrong order/index to the list of Micheline primitives.

This MR:

  1. Fixes the list of Micheline primitives
  2. Adds a script for automating the generation of the list (we can use this whenever a new protocol is released)
  3. Refactors the Test.Serialization.Michelson test suite. At the moment, this suite tests 1) parsing from michelson text, 2) serializing to binary, and 3) unserializing from binary. After this refactor this suite also tests 4) serializing to json and 5) deserilizing to json. This should make it harder to forget to test these scenarios in the future.
  4. Added some example .tz contracts with the new instructions, which are tested by the Test.Interpreter.Reference test suite.
  5. Fixed some small bugs in the expression parser

Related issue(s)

Resolves #538 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Diogo Castro

Merge request reports