[#383] Update error approach in Lorentz
Description
Problem: Long ago we came up with a standard representation for
errors: pair string x
where string
is there error tag and x
can be arbitrary. It has an obvious drawback: when there is no data
to attach to an error, x
is set to unit
and it's more expensive
to work with pair string unit
than just string
. The advantage of
this approach is that it's more uniform that contract users can expect
only pair string x
. However, nowadays FA2 standard permits two types
of errors: string
or pair string x
.
Solution: Add machinary to be able to both fail with string
and pair string x
in Lorentz by using NoErrorArg
in ErrorArg
instances. To
failwith pair string unit
, use UnitErrorArg
or ()
, but
UnitErrorArg
is preferred.
Related issue(s)
Resolves #383 (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.