[#459] Omit empty lists in the json representation of `Expression`
Description
Problem: When serializing large Micheline Expression
s, we can get
really bloated JSONs, with lots of annots
and args
fields with empty
lists.
Due to the introduction of TZIP-16, which says views should be stored as micheline expressions (possibly inside the contract's storage), we now have to be very careful to produce compact JSON values.
Solution: Change the ToJSON instance of MichelinePrimAp
to omit
annots
and args
when these lists are empty.
Related issue(s)
Resolves #459 (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.