Differential testing is used to compare Murky's solidity implementation to reference implementations in other languages. This directory contains the scripts needed to support this testing, as well as the differential tests themselves.
Currently two reference implementations are tested. The first is adapted from Uniswap/merkle-distributor, and the second is from OpenZeppelin/merkle-tree. Both are written in Javascript.
From the scripts directory, run
npm install
npm run compile
From the scripts directory:
- To test that the Uniswap/merkle-distributor differential test will work:
npm run generate-root
- To test that the OpenZeppelin/merkle-tree differential test will work:
npm run generate-complete-root ../data/complete_root_input.json
npm run generate-complete-proof ../data/complete_proof_input.json
If all commands output data without exception, then you are ready to run the differential tests.
Now you can run the tests.
From the root of the Murky repo, run:
forge test --ffi --contracts differential_testing/test/
Note: The differential tests can take some time to run. An extended period of time without output does not necessarily indicate a problem.