Add general-purpose assertion helpers to Morley.Nettest
Clarification and motivation
Right now there are only a couple of things you can assert in Morley.Nettest
:
- That an account's balance matches an exact value (with
checkBalance
) - That a contract's storage matches an exact value (with
checkStorage
) - That an operation fails (with
expectFailure
)
However, sometimes you need to assert more specific things, such as:
- Check that this timestamp is greater than this one (this would simplify the testing of #351 (closed))
- Check that a storage's specific field matches a value, and ignore the other fields (@rinn7e has run into a need for this while working on BaseDAO)
- Check that a storage's specific field is greater than
x
- Check that the balance is greater than
x
We should add some general-purpose assertion helpers (like hedgehog
/hunit
/etc do) to allow users to write their own custom assertions, and be as expressive as possible.
Acceptance criteria
Morley.Nettest
provides some general-purpose assertion helpers.
This is purposefully vague, we should investigate what other frameworks offer and decide what we want to offer.
The bare minimum is something resembling failed :: Text -> m ()
.