Skip to content

Rewrite `importUntypedContract`

Konstantin Ivanov requested to merge martoon/import-cleanup into master

Description

Problem: the current implementation uses prepareContract that for me seems like a thing specific to morley executable (since it in theory allows reading a contract from stdin - we shouldn't use anything like that).

Another problem is that importUntypedContract effectively typechecks the contract and then throws out the typed contract. With the currently developed nettest where, as a baseline, we work with untyped representation and then provide typed layer above that, this may cause the same contract to be typechecked twice.

Solution: rewrite importUntypedContract similarly to the existing importContract for typed contracts.

Related issue(s)

Resolves #

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • [ ] If I added new functionality, I added tests covering it. This is a mere refactoring.
    • 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)

Merge request reports