[TM-125] Tests against reference implementation
Description
We want to make sure that our implementation behaves exactly the same way as the reference implementation. It would be good to have automatic tests for it. We can start with something simple: for example, check that all contracts in contracts/ are well-typed and all contracts in contracts/ill-typed are ill-typed (according to the reference implementation).
In order to achieve this bash script was added. This script runs tezos-client typecheck script
for nearly all contracts
in contracts/
directory (excluding ill-typed morley contracts and annotation_mismatch_iter.tz
contract which is somehow
considered as well-typed by tezos-client
).
During the implementation severeal issues in morley
were discovered:
- Lack of
DUP n
macro (fixed in this MR). - Invalid result type for
int & nat
(fixed in this MR). - Morley is incapable in parsing parameter types with entrypoints (see #35 (closed)).
- Type parser sometimes have exponential complexity (see #64 (closed)).
-
STEPS_TO_QUOTA
is still permitted in morley (see #66 (closed)) - Code parser rejects some contracts that valid for
tezos-client
(see #98 (closed))
Also contracts/tezos_examples
was updated, for now, morley is incapable of handling contracts
in contracts/tezos_examples/entrypoints
(see #35 (closed)).
Related issue(s)
https://issues.serokell.io/issue/TM-125
✅ 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. (New contracts in tezos_examples
cover fixed bugs.)
-
-
Documentation
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.