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

[Benchmark] Include 'mkTermToEvaluate' in 'benchmark-decode' #6667

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
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