Add convenient instances to test packages
Clarification and motivation
In our source code, we tend to omit some instances that would be convenient to have, but they are unsafe. However, safety requirements to the test code are much weaker, so we could provide them there.
I propose to add some Test.Instances
module that will contain
instance IsString MText
instance Num Mutez
Since tests use constants of those types very often, providing those instances should make the code much less boilerplate-y.
Also:
- Move
noAnn
,ann
andinstance IsString Annotation
to tests. This makes sense sinceann
has been used several times incorrectly directly in the lib. We have to use methods that returnEither
in the lib instead.
Consider getting rid of ann
and noAnn
altogether, we have them due to historical reasons and IsString
instance has appeared later.
Acceptance criteria
- The mentioned instances are added/moved, methods are moved.
- They are not available in non-test code.
- The tests are updated (there are no
[mt|..|]
things,toMutez
and otherMutez
constructors, e.t.c)
Edited by Konstantin Ivanov