add sol-coverage

This commit is contained in:
Drygin 2022-03-05 20:33:06 +03:00
parent 896fc224ff
commit 10aeb05417
6 changed files with 647 additions and 14 deletions

2
.gitignore vendored
View File

@ -96,3 +96,5 @@ typings/
ERC20Tornado_flat.sol
ETHTornado_flat.sol
coverage.json

View File

@ -5,3 +5,5 @@ contracts/Verifier.sol
scripts/ganacheHelper.js
cli.js
index.js
coverage
coverage.json

View File

@ -143,6 +143,30 @@ and @jbaylina for awesome [Circom](https://github.com/iden3/circom) & [Websnark]
1. `npm run migrate:dev`
1. `node minimal-demo.js`
## Run tests/coverage
Prepare test environment:
```
yarn install
yarn download
cp .env.example .env
npx ganache-cli > /dev/null &
npm run migrate:dev
```
Run tests:
```
yarn test
```
Run coverage:
```
yarn coverage
```
## Emulate MPC trusted setup ceremony
```bash

View File

@ -24,7 +24,8 @@
"prettier:fix": "prettier --write . --config .prettierrc",
"lint": "yarn eslint && yarn prettier:check",
"flat": "npx truffle-flattener contracts/ETHTornado.sol > ETHTornado_flat.sol && npx truffle-flattener contracts/ERC20Tornado.sol > ERC20Tornado_flat.sol",
"download": "node scripts/downloadKeys.js"
"download": "node scripts/downloadKeys.js",
"coverage": "yarn truffle run coverage"
},
"keywords": [],
"author": "",
@ -57,6 +58,7 @@
"truffle-flattener": "^1.4.2",
"web3": "^1.3.4",
"web3-utils": "^1.3.4",
"websnark": "git+https://github.com/tornadocash/websnark.git#4c0af6a8b65aabea3c09f377f63c44e7a58afa6d"
"websnark": "git+https://github.com/tornadocash/websnark.git#4c0af6a8b65aabea3c09f377f63c44e7a58afa6d",
"solidity-coverage": "^0.7.20"
}
}

View File

@ -93,4 +93,6 @@ module.exports = {
],
},
},
plugins: ['solidity-coverage'],
}

625
yarn.lock

File diff suppressed because it is too large Load Diff