Skip to content

[TM-288] Add `parseLorentzValue`

Ivan Gromakovskii requested to merge gromak/tm288-parse-lorentz-value into master

Description

Problem: it's not easy to convert Michelson values into Lorentz values. We have printLorentzValue which does the opposite (Lorentz → textual Michelson), but no function for parsing. Such a function is useful when you know that something happened in the network and want to figure out what it means in terms of your application.

Solution: add parseLorentzValue which parses a string into untyped Michelson value, typechecks it and converts to a plain Haskell value. Also a helper function has been added for simple value parsing.

Related issue(s)

https://issues.serokell.io/issue/TM-288

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:

Stylistic guide (mandatory)

Merge request reports