Skip to content

[#805] Better tests for `PACK`

Nikolay Yakimov requested to merge lierdakil/#805-pack-tests into master

This did uncover a couple bugs, but not exactly where we expected 😅

It might be a good idea to add property tests, too. It's at least feasible.

Description

Problem: It's important to make sure our implementation of PACK matches
that of tezos-client

Solution: convert all well-typed contracts into lambdas, pack them, and
compare that against reference.

Problem: Current implementation of CREATE_CONTRACT typechecking doesn't
switch mode when typechecking the contract itself. As a result,
typechecking lambdas that call CREATE_CONTRACT may fail with "SELF not
allowed in lambdas", despite the SELF instruction being inside the
contract.

Solution: set typechecking mode appropriately.

Problem: currently, implementation of CREATE_CONTRACT always uses
readable representation. This isn't quite right.

Solution: pass the selected representation along to `convertContract'`

Problem: we'd like to test our PACK implementation against reference.

Solution: add pack_data endpoint support to morley-client

Related issue(s)

Resolves #805 (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 Nikolay Yakimov

Merge request reports