Skip to content

Commit

Permalink
Update plutus-contract/src/Plutus/Contract/Test/ContractModel.hs
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
  • Loading branch information
MaximilianAlgehed and michaelpj committed Oct 12, 2021
1 parent 57149ef commit 571eb45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plutus-contract/src/Plutus/Contract/Test/ContractModel.hs
Expand Up @@ -1217,7 +1217,9 @@ checkErrorWhitelistWithOptions opts handleSpecs whitelist acts = property $ go c

checkOffchain = assertFailedTransaction (\ _ _ -> all (either checkEvent (const True) . sveResult))

checkEvent (EvaluationError log e) = maybe False (listToMaybe (reverse log) `isAcceptedBy`) (Map.lookup e whitelist)
checkEvent (EvaluationError log e) = case Map.lookup e whitelist of
Just wl -> listToMaybe (reverse log) `isAcceptedBy` wl
Nothing -> False
checkEvent _ = True

checkEvents events = all checkEvent [ f | (TxnValidationFail _ _ _ (ScriptFailure f) _) <- events ]
Expand Down

0 comments on commit 571eb45

Please sign in to comment.