Skip to content

Unit testing with resource estimation for Plutus

License

Notifications You must be signed in to change notification settings

geniusyield/plutus-simple-model

 
 

Repository files navigation

Plutus simple model

Unit test library for Plutus with estimation of resource usage.

Library defines simple mock model of Blockchain to unit test plutus contracts and estimate usage of resources. What are the benefits for this framework comparing to other test frameworks for Plutus? It's:

  • easy to use
  • easy to think about
  • it has minimal dependency set. It depends only on plutus and cardano-ledger. Ain't no plutus-apps or cardano-node or ouroboros
  • works for both Plutus V1 and Plutus V2
  • support for Alonzo and Babbage eras
  • blazing fast
  • can estimate usage of resources with real functions used on Cardano node.
  • pure
  • good for unit testing of on-chain code
  • being fast and pure it's also suitable for property based testing

Quick start guide

See user guide to get started

How to compile the library

Library is compiled with nix, flakes and cabal. Enter developer nix shell with:

nix develop

Inside the nix shell we can run build and tests over make:

make build
make test

It calls cabal under the hood.

How to update docs

Docs are written in mdbook and reside in the docs directory. They are auto-deployed with Git actions on push to main. To run docs locally use mdbook:

cd docs
mdbook serve

About

Unit testing with resource estimation for Plutus

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Haskell 97.2%
  • Makefile 2.1%
  • Nix 0.7%