Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
TransferFailure
Predicates
Synopsis
- data TransferFailurePredicateDesc = TransferFailurePredicateDesc {
- _tfpdNegated :: Bool
- _tfpdDescription :: Doc
- data TransferFailurePredicate
- tfpdDescription :: Lens' TransferFailurePredicateDesc Doc
- tfpdNegated :: Lens' TransferFailurePredicateDesc Bool
- tfpd :: Doc -> TransferFailurePredicateDesc
- transferFailureReasonPredicate :: Doc -> (TransferFailureReason -> Bool) -> TransferFailurePredicate
- shiftOverflow :: TransferFailurePredicate
- emptyTransaction :: TransferFailurePredicate
- badParameter :: TransferFailurePredicate
- gasExhaustion :: TransferFailurePredicate
- failedWith :: SomeConstant -> TransferFailurePredicate
- failedWithPredicate :: Doc -> (Expression -> Bool) -> TransferFailurePredicate
- addressIs :: ToAddress addr => addr -> TransferFailurePredicate
- constant :: forall err. NiceConstant err => err -> SomeConstant
- lerror :: forall err. IsError err => err -> SomeConstant
- customError :: forall arg tag. (IsError (CustomError tag), MustHaveErrorArg tag (MText, arg)) => Label tag -> arg -> SomeConstant
- customError_ :: (IsError (CustomError tag), MustHaveErrorArg tag (MText, ())) => Label tag -> SomeConstant
- customErrorNoArg :: (IsError (CustomError tag), MustHaveErrorArg tag MText) => Label tag -> SomeConstant
- numericError :: forall err. IsError err => ErrorTagMap -> err -> SomeConstant
Documentation
data TransferFailurePredicateDesc Source #
Instances
IsString TransferFailurePredicateDesc Source # | |
Buildable TransferFailurePredicateDesc Source # | |
Defined in Test.Cleveland.Internal.Actions.TransferFailurePredicate build :: TransferFailurePredicateDesc -> Doc buildList :: [TransferFailurePredicateDesc] -> Doc |
data TransferFailurePredicate Source #
A predicate that checks whether a transfer operation failed for the expected reason.
Predicates can be combined using the &&
and ||
operators.
TransferFailurePredicate | Predicate with a description |
| |
AndPredicate (NonEmpty TransferFailurePredicate) | |
OrPredicate (NonEmpty TransferFailurePredicate) |
Instances
Boolean TransferFailurePredicate Source # | |
tfpd :: Doc -> TransferFailurePredicateDesc Source #
transferFailureReasonPredicate :: Doc -> (TransferFailureReason -> Bool) -> TransferFailurePredicate Source #
shiftOverflow :: TransferFailurePredicate Source #
Asserts that interpretation of a contract failed due to an overflow error.
emptyTransaction :: TransferFailurePredicate Source #
Asserts that an action failed due to an attempt to transfer 0tz towards a simple address.
badParameter :: TransferFailurePredicate Source #
Asserts that an action failed due to an attempt to call a contract with an invalid parameter.
gasExhaustion :: TransferFailurePredicate Source #
Asserts that interpretation of a contract failed due to gas exhaustion.
failedWith :: SomeConstant -> TransferFailurePredicate Source #
Asserts that interpretation of a contract ended with FAILWITH
, throwing the given error.
This function should be used together with one of the "FAILWITH
constructors"
(e.g. constant
, customError
).
failedWithPredicate :: Doc -> (Expression -> Bool) -> TransferFailurePredicate Source #
Asserts that interpretation of a contract ended with FAILWITH
, and the
error satisfies the given predicate.
:: ToAddress addr | |
=> addr | The expected address. |
-> TransferFailurePredicate |
Asserts that the error occurred while interpreting the contract with the given address.
constant :: forall err. NiceConstant err => err -> SomeConstant Source #
A constant michelson value that a contract threw with FAILWITH
.
customError :: forall arg tag. (IsError (CustomError tag), MustHaveErrorArg tag (MText, arg)) => Label tag -> arg -> SomeConstant Source #
A custom lorentz error.
customError_ :: (IsError (CustomError tag), MustHaveErrorArg tag (MText, ())) => Label tag -> SomeConstant Source #
A custom lorentz error with a unit
argument.
customErrorNoArg :: (IsError (CustomError tag), MustHaveErrorArg tag MText) => Label tag -> SomeConstant Source #
A custom lorentz error with no argument.
numericError :: forall err. IsError err => ErrorTagMap -> err -> SomeConstant Source #
A lorentz numeric error.