Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions tasty-plutus/src/Test/Tasty/Plutus/Internal/Feedback.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module Test.Tasty.Plutus.Internal.Feedback (
unexpectedFailure,
scriptException,
malformedScript,
noOutcome,
unexpectedSuccess,
internalError,
Expand Down Expand Up @@ -62,12 +61,6 @@ scriptException name msg =
"Unexpected behaviour in script:" <+> text name
$+$ hang "Description" 4 (text msg)

malformedScript :: String -> String
malformedScript msg =
renderStyle ourStyle $
"Script was malformed"
$+$ hang "Details" 4 (text msg)

noOutcome ::
forall (a :: Type).
(a -> Doc) ->
Expand Down
5 changes: 2 additions & 3 deletions tasty-plutus/src/Test/Tasty/Plutus/Script/Property.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE Trustworthy #-}
{-# OPTIONS_GHC -Wno-error=incomplete-patterns #-}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why disable this warning?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disabled the warning becoming an error because I didn't want to update the versions of dependencies, and the old version still has the constructor.


{- |
Module: Test.Tasty.Plutus.Script.Property
Expand Down Expand Up @@ -51,7 +52,7 @@ import Data.Sequence qualified as Seq
import Data.Tagged (Tagged (Tagged))
import Data.Text (Text)
import Plutus.V1.Ledger.Contexts (ScriptContext)
import Plutus.V1.Ledger.Scripts (ScriptError (EvaluationError, EvaluationException, MalformedScript))
import Plutus.V1.Ledger.Scripts (ScriptError (EvaluationError, EvaluationException))
import Test.Plutus.ContextBuilder (
ContextBuilder,
Purpose (ForMinting, ForSpending),
Expand Down Expand Up @@ -82,7 +83,6 @@ import Test.Tasty.Plutus.Internal.Env (
import Test.Tasty.Plutus.Internal.Feedback (
dumpState',
internalError,
malformedScript,
noOutcome,
noParse,
ourStyle,
Expand Down Expand Up @@ -567,7 +567,6 @@ produceResult sr = do
Pass -> asks (counter . unexpectedFailure (getDumpedState logs) msg)
Fail -> pass
EvaluationException name msg -> pure . counter $ scriptException name msg
MalformedScript msg -> pure . counter $ malformedScript msg
Right (logs, res) -> case (outcome, res) of
(_, NoOutcome) -> asks (counter . noOutcome state)
(Fail, ScriptPassed) -> asks (counter . unexpectedSuccess state)
Expand Down
6 changes: 2 additions & 4 deletions tasty-plutus/src/Test/Tasty/Plutus/Script/Unit.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE Trustworthy #-}
{-# OPTIONS_GHC -Wno-error=incomplete-patterns #-}

{- |
Module: Test.Tasty.Plutus.Script.Unit
Expand Down Expand Up @@ -44,8 +45,7 @@ import Plutus.V1.Ledger.Api (ScriptContext)
import Plutus.V1.Ledger.Scripts (
ScriptError (
EvaluationError,
EvaluationException,
MalformedScript
EvaluationException
),
)
import Test.Plutus.ContextBuilder (
Expand All @@ -70,7 +70,6 @@ import Test.Tasty.Plutus.Internal.Feedback (
doPass,
dumpState,
internalError,
malformedScript,
noOutcome,
noParse,
scriptException,
Expand Down Expand Up @@ -326,7 +325,6 @@ handleError = \case
Pass -> asks (testFailed . unexpectedFailure (getDumpedState logs) msg)
Fail -> asks getMPred >>= (`tryPass` logs)
EvaluationException name msg -> pure . testFailed $ scriptException name msg
MalformedScript msg -> pure . testFailed $ malformedScript msg

deliverResult ::
forall (p :: Purpose).
Expand Down