Skip to content

[#470] Unpacking of right-combed pairs

Diogo Castro requested to merge diogo/#470-right-comb-notation into master

Description

This MR updates the unpacking logic to handle the 2 new binary representations for right-combed pairs (introduced in edo, more details here).

Because the Micheline decoding logic is implemented using the unpacking logic, we can now parse the 2 new Micheline representations as well.

Examples of the new Micheline representation:

$ tezos-client convert data 'Pair 1 2 3' from michelson to json --type 'pair int int int'
{ "prim": "Pair",
  "args": [ { "int": "1" }, { "int": "2" }, { "int": "3" } ] }
$ tezos-client convert data '{1 ; 2 ; 3}' from michelson to json --type 'pair int int int'
[ { "int": "1" }, { "int": "2" }, { "int": "3" } ]

For comparison, here's the "normal" notation:

$ tezos-client convert data 'Pair 1 (Pair 2 3)' from michelson to json --type 'pair int int int'
{ "prim": "Pair",
  "args":
    [ { "int": "1" },
      { "prim": "Pair", "args": [ { "int": "2" }, { "int": "3" } ] } ] }

Related issue(s)

Resolves part of #470 (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