https://github.com/mlabs-haskell/plutus-simple-model
Unit testing with resource estimation for Plutus
https://github.com/mlabs-haskell/plutus-simple-model
Last synced: 9 months ago
JSON representation
Unit testing with resource estimation for Plutus
- Host: GitHub
- URL: https://github.com/mlabs-haskell/plutus-simple-model
- Owner: mlabs-haskell
- License: bsd-3-clause
- Created: 2021-12-27T11:30:29.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-08T21:58:19.000Z (over 1 year ago)
- Last Synced: 2025-01-08T22:38:40.373Z (over 1 year ago)
- Language: Haskell
- Size: 1.86 MB
- Stars: 31
- Watchers: 33
- Forks: 16
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Roadmap: ROADMAP.md
Awesome Lists containing this project
README
# Deprecation note
PSM library has been decommissioned in favor of
[CLB](https://github.com/mlabs-haskell/clb) emulator.
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](https://mlabs-haskell.github.io/plutus-simple-model/) 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](https://github.com/rust-lang/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
```