To run the tests, install foundry and run forge test
from the root of this repository.
To get an estimate of the gas consumption of each test, see the output from forge test
. Each passing test produces a line ending in
(gas: _)
. Alternatively, run forge snapshot
and view the results.
- Update the
leaves
&leafIndex
in the test data generator, optionally changing theleafEncoding
if necessary. - Ensure pnpm is installed and run the test data generator from its directory with
cd test/data/ && pnpm start && cd -
. - Use the output of the test data generator to update the following variables in the tests:
- At the top level of the contract:
leafIndex
leaves
- Within each test case:
expectedRoot
proof
hashSides
(for the test that uses this)
- At the top level of the contract:
- Run
forge test
orforge snapshot
as before.