Update README.md (#958)

This commit is contained in:
Mohammad Amin Khashkhashi Moghaddam 2023-07-17 15:23:16 +02:00 committed by GitHub
parent 6c52eb6606
commit b64090aa75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -33,6 +33,21 @@ npm run install-forge-deps
After installing the dependencies. Run `forge build` to build the contracts and `forge test` to After installing the dependencies. Run `forge build` to build the contracts and `forge test` to
test the contracts using tests in `forge-test` directory. test the contracts using tests in `forge-test` directory.
### Governance tests
There is a separate test suite executed by truffle for testing governance messages and contract upgrades. You can either use tilt to test automatically or run ganache-cli as a blockchain instance and test it manually. To do the latter, run the following commands in the `contracts` folder:
1. Spawn a new network on a seperate terminal (do not close it while running tests):
```bash
npx ganache-cli -e 10000 --deterministic --time="1970-01-02T00:00:00+00:00" --host=0.0.0.0
```
2. deploy the contracts:
```bash
cp .env.test .env && npx truffle compile --all && npx truffle migrate
```
3. Run the test suite:
```bash
npm run test-contract
```
### Gas Benchmark ### Gas Benchmark
You can use foundry to run benchmark tests written in [`forge-test/GasBenchmark.t.sol`](./forge-test/GasBenchmark.t.sol). To run the tests with gas report You can use foundry to run benchmark tests written in [`forge-test/GasBenchmark.t.sol`](./forge-test/GasBenchmark.t.sol). To run the tests with gas report