Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: haddock error #6323

Merged
merged 1 commit into from
Jul 23, 2024
Merged
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
54 changes: 27 additions & 27 deletions plutus-ledger-api/testlib/PlutusLedgerApi/Test/EvaluationEvent.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}

module PlutusLedgerApi.Test.EvaluationEvent (
ScriptEvaluationEvents (..),
ScriptEvaluationEvent (..),
ScriptEvaluationData (..),
ScriptEvaluationResult (..),
UnexpectedEvaluationResult (..),
TestFailure (..),
renderTestFailure,
renderTestFailures,
checkEvaluationEvent,
) where
module PlutusLedgerApi.Test.EvaluationEvent
( ScriptEvaluationEvents (..)
, ScriptEvaluationEvent (..)
, ScriptEvaluationData (..)
, ScriptEvaluationResult (..)
, UnexpectedEvaluationResult (..)
, TestFailure (..)
, renderTestFailure
, renderTestFailures
, checkEvaluationEvent
) where

import PlutusCore.Data qualified as PLC
import PlutusCore.Pretty
Expand Down Expand Up @@ -98,14 +98,14 @@ data ScriptEvaluationEvents = ScriptEvaluationEvents
data UnexpectedEvaluationResult
= UnexpectedEvaluationSuccess
ScriptEvaluationEvent
-- | Cost parameters
[Int64]
-- | Actual budget consumed
-- ^ Cost parameters
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the crux of this PR, the rest is formatting.

ExBudget
-- ^ Actual budget consumed
| UnexpectedEvaluationFailure
ScriptEvaluationEvent
-- | Cost parameters
[Int64]
-- ^ Cost parameters
EvaluationError
| DecodeError ScriptDecodeError
deriving stock (Show)
Expand Down Expand Up @@ -157,12 +157,12 @@ renderTestFailures testFailures =
++ unwords (map renderTestFailure (toList testFailures))

-- | Re-evaluate an on-chain script evaluation event.
checkEvaluationEvent ::
EvaluationContext ->
-- | Cost parameters
[Int64] ->
ScriptEvaluationEvent ->
Maybe UnexpectedEvaluationResult
checkEvaluationEvent
:: EvaluationContext
-> [Int64]
-- ^ Cost parameters
-> ScriptEvaluationEvent
-> Maybe UnexpectedEvaluationResult
checkEvaluationEvent ctx params ev = case ev of
PlutusEvent PlutusV1 ScriptEvaluationData{..} expected ->
case deserialiseScript PlutusV1 dataProtocolVersion dataScript of
Expand Down Expand Up @@ -207,10 +207,10 @@ checkEvaluationEvent ctx params ev = case ev of
dataInput
verify expected actual
Left err -> Just (DecodeError err)
where
verify ScriptEvaluationSuccess (Left err) =
Just $ UnexpectedEvaluationFailure ev params err
verify ScriptEvaluationFailure (Right budget) =
Just $ UnexpectedEvaluationSuccess ev params budget
verify _ _ =
Nothing
where
verify ScriptEvaluationSuccess (Left err) =
Just $ UnexpectedEvaluationFailure ev params err
verify ScriptEvaluationFailure (Right budget) =
Just $ UnexpectedEvaluationSuccess ev params budget
verify _ _ =
Nothing
Loading