Skip to content

Commit

Permalink
fix build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximilianAlgehed committed Oct 12, 2021
1 parent 92f8ad5 commit d27344e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions plutus-contract/src/Plutus/Contract/Test/ContractModel.hs
Expand Up @@ -1213,13 +1213,13 @@ checkErrorWhitelistWithOptions :: forall m. ContractModel m
-> Property
checkErrorWhitelistWithOptions opts handleSpecs whitelist acts = property $ go check acts
where
check :: Predicate
check :: TracePredicate
check = checkOnchain .&&. (assertNoFailedTransactions .||. checkOffchain)

checkOnChain :: Predicate
checkOnchain :: TracePredicate
checkOnchain = assertChainEvents checkEvents

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

checkEvent :: ScriptError -> Bool
Expand All @@ -1231,7 +1231,7 @@ checkErrorWhitelistWithOptions opts handleSpecs whitelist acts = property $ go c
checkEvents :: [ChainEvent] -> Bool
checkEvents events = all checkEvent [ f | (TxnValidationFail _ _ _ (ScriptFailure f) _) <- events ]

go :: Predicate -> Actions m -> Property
go :: TracePredicate -> Actions m -> Property
go check actions = monadic (flip State.evalState mempty) $ finalChecks opts check $ do
QC.run $ setHandles $ activateWallets handleSpecs
void $ runActionsInState StateModel.initialState (toStateModelActions actions)
2 changes: 1 addition & 1 deletion plutus-contract/test/Spec/ErrorChecking.hs
Expand Up @@ -42,7 +42,7 @@ tests = testGroup "error checking"
, testProperty "Failure due to head [] not allowed" $ withMaxSuccess 1 $ expectFailure prop_FailHeadNil
, testProperty "Division by zero not allowed" $ withMaxSuccess 1 $ expectFailure prop_DivZero
, testProperty "Normal success allowed" $ withMaxSuccess 1 prop_Success
, assertBool "defaultWhitelist OK" $ whitelistOk defaultWhitelist ]
, testCase "Check defaultWhitelist is ok" $ assertBool "whitelistOk defaultWhitelist" $ whitelistOk defaultWhitelist ]

-- | Normal failures should be allowed
prop_FailFalse :: Property
Expand Down

0 comments on commit d27344e

Please sign in to comment.