Skip to content

Commit

Permalink
[Benchmark] Include 'mkTermToEvaluate' in 'benchmark-decode'
Browse files Browse the repository at this point in the history
  • Loading branch information
effectfully committed Nov 14, 2024
1 parent 1d9a758 commit a803b77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plutus-benchmark/validation/bench/BenchDec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ main = benchWith mkDecBM
!(benchScript :: SerialisedScript) =
force (serialiseUPLC $ UPLC.Program () v unsaturated)

-- The validation benchmarks were all created from PlutusV1 scripts
ll = PlutusV1
pv = ledgerLanguageIntroducedIn ll

-- Deserialize using 'FakeNamedDeBruijn' to get the fake names added
in whnf (either throw id . void . deserialiseScript futurePV
) benchScript
in flip whnf benchScript $ \scriptBytes ->
let scriptForEval = either throw id $ deserialiseScript pv scriptBytes
in either throw id . void $ mkTermToEvaluate ll pv scriptForEval []
2 changes: 2 additions & 0 deletions plutus-ledger-api/src/PlutusLedgerApi/Common/Eval.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ data EvaluationError =
deriving stock (Show, Eq)
makeClassyPrisms ''EvaluationError

instance Exception EvaluationError

instance AsScriptDecodeError EvaluationError where
_ScriptDecodeError = _CodecError

Expand Down

0 comments on commit a803b77

Please sign in to comment.