Skip to content

Commit b8ec5ec

Browse files
committed
Switch to internal ganache-core and update solidity-coverage to 0.7.0
1 parent 22ee50d commit b8ec5ec

File tree

6 files changed

+3278
-146
lines changed

6 files changed

+3278
-146
lines changed

.solcover.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
module.exports = {
2-
testCommand: 'node --max-old-space-size=4096 ../node_modules/.bin/truffle test --network coverage',
3-
compileCommand: 'node --max-old-space-size=4096 ../node_modules/.bin/truffle compile --network coverage',
2+
testCommand: 'node --max-old-space-size=4096 ../node_modules/.bin/truffle run coverage',
3+
compileCommand: 'node --max-old-space-size=4096 ../node_modules/.bin/truffle compile',
44
copyPackages: ['@openzeppelin/contracts'],
55
norpc: true,
66
skipFiles: [
77
'tests'
8-
]
8+
],
9+
providerOptions: {
10+
total_accounts: 30,
11+
defaultEtherBalance: 1000
12+
}
913
};

package.json

+7-10
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,19 @@
1515
"!contracts/tests"
1616
],
1717
"scripts": {
18-
"test": "scripts/test.sh",
19-
"coverage": "scripts/coverage.sh",
20-
"profile": "WITH_GAS_PROFILER=true scripts/test.sh",
21-
"compile": "./node_modules/.bin/truffle compile",
18+
"test": "truffle test",
19+
"coverage": "truffle run coverage",
20+
"profile": "WITH_GAS_PROFILER=true yarn test",
21+
"compile": "truffle compile",
2222
"lint": "yarn lint:js && yarn lint:sol",
2323
"lint:js": "./node_modules/.bin/eslint .",
2424
"lint:sol": "./node_modules/.bin/solhint --max-warnings 0 \"contracts/**/*.sol\""
2525
},
26-
"dependencies": {
26+
"dependencies": {},
27+
"devDependencies": {
2728
"babel-polyfill": "^6.26.0",
2829
"babel-preset-env": "^1.7.0",
2930
"babel-register": "^6.26.0",
30-
"openzeppelin-solidity": "2.5.0",
31-
"truffle": "5.1.12"
32-
},
33-
"devDependencies": {
3431
"bn.js": "^5.1.1",
3532
"chai": "^4.2.0",
3633
"chai-as-promised": "^7.1.1",
@@ -42,7 +39,7 @@
4239
"eslint-plugin-jsx-a11y": "^6.2.3",
4340
"eslint-plugin-react": "^7.18.3",
4441
"eth-gas-reporter": "^0.2.14",
45-
"ganache-cli": "^6.9.0",
42+
"ganache-core": "^2.9.2",
4643
"mocha-lcov-reporter": "^1.3.0",
4744
"@openzeppelin/contracts": "2.3.0",
4845
"@openzeppelin/test-helpers": "^0.5.4",

scripts/coverage.sh

-3
This file was deleted.

scripts/test.sh

-42
This file was deleted.

truffle-config.js

+7-9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ require('chai')
77
.use(require('chai-bn')(require('bn.js')))
88
.use(require('dirty-chai'))
99
.expect();
10+
11+
const ganache = require('ganache-core');
1012
/* eslint-enable import/no-extraneous-dependencies */
1113

1214
const process = require('process');
@@ -30,18 +32,14 @@ if (WITH_GAS_PROFILER) {
3032
module.exports = {
3133
networks: {
3234
development: {
33-
host: 'localhost',
34-
port: 7545,
35-
network_id: '*',
36-
},
37-
coverage: {
38-
host: 'localhost',
3935
network_id: '*',
40-
port: 7555,
41-
gas: 0xfffffffffff,
42-
gasPrice: 0x01,
36+
provider: ganache.provider({
37+
total_accounts: 30,
38+
defaultEtherBalance: 1000,
39+
}),
4340
},
4441
},
42+
plugins: ['solidity-coverage'],
4543
compilers: {
4644
solc: {
4745
version: '0.5.16',

0 commit comments

Comments
 (0)