[Haskell-cafe] [ANN] plutus-simple-model - unit test linrary for plutus with resource estimation

Anton Kholomiov anton.kholomiov at gmail.com
Tue Jan 11 14:12:10 UTC 2022


I’d like to announce the unit test library plutus-simple-model
<https://github.com/mlabs-haskell/plutus-simple-model> for plutus that is a
joy to use [1].
It’s simple and easy to grasp and it can estimate resource usage for TX
(size and execution units).

Main idea is to implement a simple blockchain model that updates UTXOs
inside a pure State monad if
TX is valid. To check TX cardano node functions are used so the check is
the same as if node would check it and it produces useful stats for
resource usage.

Benefits comparing to EmulatorTrace to me:

   - I find resource usage stats are useful to know in production and this
   is missing in Emulator tests
   - EmulatorTrace approach makes it hard to query run-time information and
   with given lib it’s super easy
   - Having to define separate API and use lookups/constraints seems clumsy
   to me. It often leads to writing lots of boilerplate code.
   - it’s much faster to run

I’ve tested it successfully in one project and using it for the second one.
It has great docs and tutorials.
Enjoy! I hope it will improve your testing experience with plutus.

[1] plutus-simple-model
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20220111/2188692f/attachment.html>

More information about the Haskell-Cafe mailing list