Skip to content

[#653] Deprecate `Unit` modules from Cleveland

Nikolay Yakimov requested to merge lierdakil/#653-deprecate-unit into master

This MR is based off !1029 (merged), but the target is master, since AFAIK GitLab doesn't allow changing the target branch for MR. So a few first commits are from !1029 (merged).

The reason for basing it on !1029 (merged) is the need to extend error handling in PureM, which unfortunately is considerably messier without !1029 (merged).

One contention point is I had to add lorentz to the dependencies of morley-test. Theoretically, I could very well do without, but rewriting interpreter tests is that much easier when some Lorentz types are in scope, specifically HasEntrypointArg, NiceParameter, NiceParameterFull, NiceStorage, NiceUnpackedValue, see Test.Interpreter in morley-test. This may be relevant for #713.

Description

This MR deprecates Test.Cleveland.Michelson.Unit and Test.Cleveland.Michelson.Dummy modules, moves stuff we don't want to deprecate in Test.Cleveland.Michelson.Unit to Test.Cleveland.Michelson.Entrypoints, renames Test.Cleveland.Lorentz.Unit to Test.Cleveland.Lorentz.Entrypoints, and updates tests that used those.

The test update exposed the fact that we don't provide enough information on failures in PureM:

Problem: PureM doesn't properly report all the errors we check for in tests, and in some cases it strips data we need.

Solution: Extend TransferFailure to handle more errors (for now, only with PureM). Also, to simplify working with TransferFailure a little, split off actual failure reason into a separate sum type, and make TransferFailure into a record.

Problem: Test.Cleveland.Michelson.Unit and Test.Cleveland.Michelson.Dummy modules expose an old testing interface we're aiming to deprecate and eventually remove.

Solution: Deprectate ...Michelson.Dummy module entirely. If the user really needs dummy values used by the morley interpreter, they can get those from Morley.Michelson.Runtime.Dummy directly.

Move entrypoint-related functions from ...Michelson.Unit to ...Michelson.Entrypoints.

Rename ...Lorentz.Unit to ...Lorentz.Entrypoints for consistency.

Deprecate the rest of ...Michelson.Unit.

While at it, deprectate hspec support functions from ...Michelson.Import.

Related issue(s)

Resolves #653 (closed) (eventually, together with !1029 (merged))

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.

N/A

Stylistic guide (mandatory)

Edited by Nikolay Yakimov

Merge request reports