[#305] Fix handling of the default entrypoint in SELF
Description
Problem: it turned out that SELF %default
instruction is permitted
in Michelson. It's semantically equivalent to the SELF
instruction
(with no entrypoint reference), but is not entirely equivalent in
binary format (that forms the blockchain). Specifically,
SELF %default
is more expensive to typecheck and consumes more
storage size. Hence, we should distinguish them.
Solution:
- Update
EpName
invariants and permit"default"
there. - Define
isDefEpName
as a better way to check whetherEpName
refers to the default entrypoint. Document theDefEpName
pattern. - Define
epNameFromSelfAnn
to constructEpName
fromSELF
annotation. Use it inSELF
typechecking.
And there are some other small changes.
Related issue(s)
Resolves #305 (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 Ivan Gromakovskii