Skip to content

[TM-125] Tests against reference implementation

Roman Melnikov requested to merge rvem/tm125-tezos-client-in-ci into master

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

    • I checked whether I should update the docs and did so if necessary:
    • I updated the changelog if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Roman Melnikov

Merge request reports