Skip to content

Commit

Permalink
nothunks ^>= 0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Unisay committed Jul 26, 2024
1 parent c7eb24c commit c48d9a1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
5 changes: 0 additions & 5 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,4 @@ constraints:
-- The API has changed for version 2.2, ledger depends on the old version and ledger will not
-- be updated until after the Conway release.
, cardano-crypto-class ^>= 2.1
-- Later versions have API changes.
, nothunks ^>= 0.1.5

allow-newer:
, nothunks:containers

2 changes: 1 addition & 1 deletion plutus-core/plutus-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ library
, monoidal-containers
, mtl
, multiset
, nothunks ^>=0.1.5
, nothunks ^>=0.2
, parser-combinators >=0.4.0
, prettyprinter >=1.1.0.1
, prettyprinter-configurable ^>=1.31
Expand Down
2 changes: 1 addition & 1 deletion plutus-core/plutus-core/src/PlutusCore/Builtin/Runtime.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ instance NoThunks (BuiltinRuntime val) where
wNoThunks ctx = \case
-- Unreachable, because we don't allow nullary builtins and the 'BuiltinArrow' case only
-- checks for WHNF without recursing. Hence we can throw if we reach this clause somehow.
BuiltinCostedResult _ _ -> pure . Just $ ThunkInfo ctx
BuiltinCostedResult _ _ -> pure . Just . ThunkInfo $ Left ctx
-- This one doesn't do much. It only checks that the function stored in the 'BuiltinArrow'
-- is in WHNF. The function may contain thunks inside of it. Not sure if it's possible to do
-- better, since the final 'BuiltinCostedResult' contains a thunk for the result of the
Expand Down
4 changes: 2 additions & 2 deletions plutus-ledger-api/test/Spec/Eval.hs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ evaluationContextCacheIsComplete =

failIfThunk :: Show a => Maybe a -> IO ()
failIfThunk mbThunkInfo =
whenJust mbThunkInfo $ \thunkInfo ->
assertFailure $ "Unexpected thunk: " <> show thunkInfo
whenJust mbThunkInfo $ \thunk ->
assertFailure $ "Unexpected thunk: " <> show thunk

-- | Ensure that no 'EvaluationContext' has thunks in it for all language versions.
evaluationContextNoThunks :: TestTree
Expand Down

0 comments on commit c48d9a1

Please sign in to comment.