Skip to content

Commit 8b7e5b4

Browse files
authored
Update and lock dependency versions (#138)
* Lock and update some dependencies * Remove ganache dependency
1 parent d3bb11b commit 8b7e5b4

File tree

4 files changed

+39
-51
lines changed

4 files changed

+39
-51
lines changed

api.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// For require('solidity-coverage/api');
21
const api = require("./src/api");
32

43
module.exports = api;

package.json

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -50,43 +50,41 @@
5050
"dependencies": {
5151
"@solidity-parser/parser": "0.14.5",
5252
"@syntest/core": "0.2.0",
53-
"@truffle/config": "^1.2.44",
54-
"@truffle/provider": "^0.1.17",
53+
"@truffle/config": "1.3.49",
54+
"@truffle/provider": "0.3.3",
5555
"bignumber.js": "9.0.1",
56-
"chalk": "^2.4.2",
57-
"clear": "^0.1.0",
58-
"detect-port": "^1.3.0",
59-
"figlet": "^1.5.0",
60-
"fs-extra": "^8.1.0",
61-
"ganache-cli": "^6.12.2",
56+
"chalk": "4.1.1",
57+
"clear": "0.1.0",
58+
"detect-port": "1.3.0",
59+
"figlet": "1.5.2",
60+
"fs-extra": "11.1.0",
6261
"global-modules": "^2.0.0",
63-
"globby": "^10.0.1",
64-
"lodash": "^4.17.15",
65-
"mocha": "^8.3.1",
66-
"pify": "^4.0.1",
62+
"globby": "^11.0.4",
63+
"lodash.clonedeep": "4.5.0",
64+
"mocha": "10.2.0",
6765
"recursive-readdir": "^2.2.2",
6866
"sc-istanbul": "^0.4.5",
6967
"semver": "^7.3.5",
7068
"solidity-coverage": "^0.7.16",
7169
"truffle": "5.1.65",
72-
"web3": "^1.3.4",
73-
"web3-utils": "^1.5.2"
70+
"web3": "1.8.1",
71+
"web3-utils": "1.8.1"
7472
},
7573
"devDependencies": {
76-
"@types/chai": "^4.2.15",
77-
"@types/chai-as-promised": "^7.1.4",
78-
"@types/mocha": "^8.2.2",
79-
"@types/node": "^14.17.4",
80-
"@types/sinon": "^9.0.11",
81-
"@typescript-eslint/eslint-plugin": "^4.28.1",
82-
"@typescript-eslint/parser": "^4.28.1",
83-
"chai": "^4.3.3",
84-
"eslint": "^7.30.0",
85-
"eslint-config-prettier": "^8.1.0",
74+
"@types/chai": "4.3.4",
75+
"@types/chai-as-promised": "7.1.1",
76+
"@types/mocha": "10.0.1",
77+
"@types/node": "18.11.17",
78+
"@types/sinon": "10.0.13",
79+
"@typescript-eslint/eslint-plugin": "5.45.1",
80+
"@typescript-eslint/parser": "5.45.1",
81+
"chai": "4.3.7",
82+
"eslint": "8.29.0",
83+
"eslint-config-prettier": "8.5.0",
8684
"mocha": "10.2.0",
87-
"nyc": "^15.1.0",
88-
"prettier": "^2.3.2",
89-
"sinon": "^9.2.4",
85+
"nyc": "15.1.0",
86+
"prettier": "2.8.1",
87+
"sinon": "15.0.1",
9088
"ts-node": "10.9.1",
9189
"typescript": "4.9.4"
9290
},

src/SolidityLauncher.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ import {
9191

9292
const pkg = require("../package.json");
9393
const Web3 = require("web3");
94-
const { outputFileSync } = require("fs-extra");
9594

9695
export class SolidityLauncher {
9796
private readonly _program = "syntest-solidity";
@@ -340,17 +339,6 @@ export class SolidityLauncher {
340339

341340
// Instrument
342341
await targetPool.prepareAndInstrument(this.api);
343-
// const instrumented = this.api.instrument(targetPool, targetPaths);
344-
345-
// for (const instrumentedTarget of instrumented) {
346-
// const _path = path
347-
// .normalize(instrumentedTarget.canonicalPath)
348-
// .replace(
349-
// this.config.contracts_directory,
350-
// Properties.temp_instrumented_directory
351-
// );
352-
// await outputFileSync(_path, instrumentedTarget.source);
353-
// }
354342

355343
this.config.contracts_directory = Properties.temp_instrumented_directory;
356344
this.config.build_directory = this.tempArtifactsDir;

src/api.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const pify = require("pify");
21
const fs = require("fs");
32
const path = require("path");
43
const istanbul = require("sc-istanbul");
@@ -125,20 +124,20 @@ class API {
125124
: true;
126125

127126
// Attach to vm step of supplied client
128-
try {
129-
if (this.config.forceBackupServer) throw new Error();
130-
await this.attachToVM(client);
131-
} catch (err) {
132-
// Fallback to ganache-cli)
133-
const _ganache = require("ganache-cli");
134-
await this.attachToVM(_ganache);
135-
}
127+
await this.attachToVM(client);
136128

137129
if (autoLaunchServer === false || this.autoLaunchServer === false) {
138130
return this.server;
139131
}
140132

141-
await pify(this.server.listen)(this.port);
133+
await new Promise((resolve, reject) => {
134+
this.server.listen(this.port, (err) => {
135+
if (err) {
136+
return reject()
137+
}
138+
resolve()
139+
})
140+
})
142141

143142
return `http://${this.host}:${this.port}`;
144143
}
@@ -190,7 +189,11 @@ class API {
190189
*/
191190
async finish() {
192191
if (this.server && this.server.close) {
193-
await pify(this.server.close)();
192+
await new Promise((resolve) => {
193+
this.server.close(() => {
194+
resolve()
195+
})
196+
})
194197
}
195198
}
196199
// ------------------------------------------ Utils ----------------------------------------------

0 commit comments

Comments
 (0)