From 59451b262bbe2ef24b9259d629927c06a28b1191 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Thu, 5 Dec 2019 18:06:20 +0100 Subject: [PATCH] use new solc version. Update the interface --- package-lock.json | 41 +++++-------------- remix-debug/package.json | 2 +- remix-debugger/package.json | 2 +- remix-lib/package.json | 2 +- remix-solidity/package.json | 2 +- .../src/compiler/compiler-worker.js | 7 ++-- remix-solidity/src/compiler/compiler.js | 2 +- 7 files changed, 20 insertions(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index 114920eb62..83549b2260 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1721,8 +1721,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -1743,14 +1742,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1765,20 +1762,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -1895,8 +1889,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -1908,7 +1901,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -1923,7 +1915,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -1931,14 +1922,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -1957,7 +1946,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -2038,8 +2026,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -2051,7 +2038,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -2137,8 +2123,7 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -2174,7 +2159,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -2194,7 +2178,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -2238,14 +2221,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, diff --git a/remix-debug/package.json b/remix-debug/package.json index 122401f4d8..65e8948f25 100644 --- a/remix-debug/package.json +++ b/remix-debug/package.json @@ -35,7 +35,7 @@ "babel-eslint": "^7.1.1", "babelify": "^10.0.0", "notify-error": "^1.2.0", - "solc": "^0.5.0", + "solc": "^0.5.13", "standard": "^7.0.1", "standard-reporter": "^1.0.5", "tape": "^4.6.0" diff --git a/remix-debugger/package.json b/remix-debugger/package.json index a5cdaf390a..510ded7e33 100644 --- a/remix-debugger/package.json +++ b/remix-debugger/package.json @@ -41,7 +41,7 @@ "remix-lib": "^0.2.9", "remix-solidity": "^0.1.11", "selenium-standalone": "^6.0.1", - "solc": "^0.4.13", + "solc": "^0.5.13", "standard": "^7.0.1", "standard-reporter": "^1.0.5", "tape": "^4.6.0", diff --git a/remix-lib/package.json b/remix-lib/package.json index 2441417a0a..d1bb595479 100644 --- a/remix-lib/package.json +++ b/remix-lib/package.json @@ -22,7 +22,7 @@ "ethers": "^4.0.27", "events": "^3.0.0", "fast-async": "^6.1.2", - "solc": "^0.5.0", + "solc": "^0.5.13", "web3": "0.20.6" }, "devDependencies": { diff --git a/remix-solidity/package.json b/remix-solidity/package.json index 84983366aa..6cbaffc93d 100644 --- a/remix-solidity/package.json +++ b/remix-solidity/package.json @@ -15,7 +15,7 @@ "main": "./index.js", "dependencies": { "remix-lib": "0.4.15", - "solc": "^0.5.0", + "solc": "^0.5.13", "webworkify": "^1.2.1" }, "devDependencies": { diff --git a/remix-solidity/src/compiler/compiler-worker.js b/remix-solidity/src/compiler/compiler-worker.js index 4a4e0242a9..70e3623f9d 100644 --- a/remix-solidity/src/compiler/compiler-worker.js +++ b/remix-solidity/src/compiler/compiler-worker.js @@ -17,15 +17,16 @@ module.exports = function (self) { compileJSON = null self.importScripts(data.data) - + var compiler = solc(self.Module) compileJSON = function (input) { try { - return compiler.compile(input, function (path) { + let missingInputsCallback = function (path) { missingInputs.push(path) return { 'error': 'Deferred import' } - }) + } + return compiler.compile(input, { import: missingInputsCallback }) } catch (exception) { return JSON.stringify({ error: 'Uncaught JavaScript exception:\n' + exception }) } diff --git a/remix-solidity/src/compiler/compiler.js b/remix-solidity/src/compiler/compiler.js index 51ab3778db..488fb92fac 100644 --- a/remix-solidity/src/compiler/compiler.js +++ b/remix-solidity/src/compiler/compiler.js @@ -101,7 +101,7 @@ function Compiler (handleImportCall) { var result try { var input = compilerInput(source.sources, {optimize: optimize, evmVersion: evmVersion, language: language, target: source.target}) - result = compiler.compile(input, missingInputsCallback) + result = compiler.compile(input, { import: missingInputsCallback }) result = JSON.parse(result) } catch (exception) { result = { error: { formattedMessage: 'Uncaught JavaScript exception:\n' + exception, severity: 'error', mode: 'panic' } }