Skip to content

[#739] Delete unnecessary `HasStorage` constraints

Diogo Castro requested to merge diogo/#739-remove-has-annotation into master

Description

A Lorentz.Contract has:

  • a NiceStorage constraint, which implies a HasAnnotation st constraint.
  • a NiceParameterFull constraint, which implies a ParameterDeclaresEntrypoints constraint.

However, HasAnnotation st and ParameterDeclaresEntrypoints aren't always needed.

When a lorentz contract is imported from a file, the annotations are extracted from the .tz file.

This means that functions like importContract and embedContract require the user to declare HasAnnotation and ParameterDeclaresEntrypoints instances, even though they're ignored and never used.

This MR aims to remove these constraints, and use them only where they're actually needed.

Related issue(s)

Resolves #739 (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