[#805] Better tests for `PACK`
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
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.
Edited by Nikolay Yakimov