Make it easier to handle CustomError in nettest
Clarification and motivation
Our smart contracts typically fail with CustomError
. We have lExpectCustomError
and lExpectCustomError_
in Lorentz.Test.Integrational
. However, we don't have anything like that in nettest. You have to call expectFailure
passing NettestFailure
to it. There is NettestFailedWith
constructor, but it's not convenient to use. You have to call errorToVal
which takes a callback. Also NettestFailedWith
has NiceUnpackedValue t
constraint, so it expects a Lorentz value, but errorToVal
returns Typed.Value
. And CustomError
is not a Lorentz value, IsoValue
is not defined for it.
Acceptance criteria
There should be functions similar to lExpectCustomError
and lExpectCustomError_
, but for nettest interface.