From 4adcf54ca5792ffd9601c2f4c4c4ffd6f92ede7c Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 2 Jul 2018 08:41:29 +0200 Subject: [PATCH 01/98] fix displaying call in terminal --- src/app/execution/txLogger.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/execution/txLogger.js b/src/app/execution/txLogger.js index 9e7d698747..68f0a9b774 100644 --- a/src/app/execution/txLogger.js +++ b/src/app/execution/txLogger.js @@ -371,7 +371,7 @@ function txDetails (e, tx, data, obj) { log.appendChild(arrowUp) table = createTable({ hash: data.tx.hash, - status: data.receipt.status, + status: data.receipt ? data.receipt.status : null, isCall: data.tx.isCall, contractAddress: data.tx.contractAddress, data: data.tx, From 4f505ab9c7960ee5b5b19321edc43d8917dc3727 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 2 Jul 2018 08:55:02 +0200 Subject: [PATCH 02/98] fix import with firefox --- src/app/compiler/compiler-imports.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/app/compiler/compiler-imports.js b/src/app/compiler/compiler-imports.js index c1fb53de46..97fb1ab1a6 100644 --- a/src/app/compiler/compiler-imports.js +++ b/src/app/compiler/compiler-imports.js @@ -12,10 +12,7 @@ module.exports = class CompilerImports { return request.get( { url: 'https://api.github.com/repos/' + root + '/contents/' + path, - json: true, - headers: { - 'User-Agent': 'Remix' - } + json: true }, (err, r, data) => { if (err) { From 410f68fe808683e74d94d8bcb2ff6e66418b64e4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 13 Jun 2018 15:27:09 +0200 Subject: [PATCH 03/98] Update release-process.md --- release-process.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/release-process.md b/release-process.md index a5e0ffdb6e..80c3281cf2 100644 --- a/release-process.md +++ b/release-process.md @@ -43,3 +43,17 @@ This is not strictly speaking a release. Updating the remix-alpha site is done t - Select `Master` - Click `Trigger custom build` - Once the build is finished (can take a while) and successful, check remix-alpha.ethereum.org is updated accordingly + +# beta testing remix + +We publish a new release roughly every month and greatly appreciate support on beta testing. + +By giving report, beta testers help to: + - verify viabilty (in term core and UX design) of new features + - track possible regression + - propose new update + - contribute on reviewing / building Pull Request + +Current Beta testers: + + From d3bbc39a7ab2a00dbb7b3ea5267defcb502fac9a Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 5 Jul 2018 10:06:41 +0200 Subject: [PATCH 04/98] v0.6.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index edc97afef8..dee4cd811d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "remix-ide", - "version": "v0.6.4-alpha.1", + "version": "v0.6.4", "description": "Minimalistic browser-based Solidity IDE", "devDependencies": { "async": "^2.1.2", From cac04cf240db66bd14383a3859360c17507802fc Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 6 Jun 2018 22:32:30 -0400 Subject: [PATCH 05/98] Add ability to filter out compiler warnings --- src/app/tabs/compile-tab.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 9d7b71e0f5..7b85d9708a 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -35,6 +35,7 @@ module.exports = class CompileTab { maxTime: 1000, timeout: 300 } + self._opts.config.set('hideWarnings', false) self._events.editor.register('contentChanged', scheduleCompilation) self._events.editor.register('sessionSwitched', scheduleCompilation) function scheduleCompilation () { @@ -113,7 +114,13 @@ module.exports = class CompileTab { if (data.errors && data.errors.length) { error = true data.errors.forEach(function (err) { - self._opts.renderer.error(err.formattedMessage, self._view.errorContainer, {type: err.severity}) + if (self._opts.config.get('hideWarnings')) { + if (err.severity !== 'warning') { + self._opts.renderer.error(err.formattedMessage, self._view.errorContainer, {type: err.severity}) + } + } else { + self._opts.renderer.error(err.formattedMessage, self._view.errorContainer, {type: err.severity}) + } }) } if (!error && data.contracts) { @@ -137,6 +144,7 @@ module.exports = class CompileTab { self._view.compileIcon = yo`` self._view.compileButton = yo`
${self._view.compileIcon} Start to compile
` self._view.autoCompile = yo`` + self._view.hideWarningsBox = yo`` if (self.data.autoCompile) self._view.autoCompile.setAttribute('checked', '') self._view.compileContainer = yo`
@@ -147,6 +155,10 @@ module.exports = class CompileTab { Auto compile
${self._view.warnCompilationSlow} +
+ ${self._view.hideWarningsBox} + Hide warnings +
` self._view.errorContainer = yo`
` @@ -181,6 +193,10 @@ module.exports = class CompileTab { } function updateAutoCompile (event) { self._opts.config.set('autoCompile', self._view.autoCompile.checked) } function compile (event) { self._api.runCompiler() } + function hideWarnings (event) { + self._opts.config.set('hideWarnings', !self._opts.config.get('hideWarnings')) + self._api.runCompiler() + } function details () { const select = self._view.contractNames if (select.children.length > 0 && select.selectedIndex >= 0) { @@ -277,6 +293,11 @@ const css = csjs` display: flex; align-items: center; } + .hideWarningsContainer { + display: flex; + align-items: center; + margin-left: 2% + } .autocompile {} .autocompileTitle { font-weight: bold; From d7649d221d586229e5b24a1a98d3b9cd82b8c916 Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 6 Jun 2018 23:17:39 -0400 Subject: [PATCH 06/98] Mimic logic of autoCompile button --- src/app/tabs/compile-tab.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 7b85d9708a..ec977223e9 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -29,13 +29,13 @@ module.exports = class CompileTab { contractEl: null } self.data = { + hideWarnings: self._opts.config.get('hideWarnings') || false, autoCompile: self._opts.config.get('autoCompile'), compileTimeout: null, contractsDetails: {}, maxTime: 1000, timeout: 300 } - self._opts.config.set('hideWarnings', false) self._events.editor.register('contentChanged', scheduleCompilation) self._events.editor.register('sessionSwitched', scheduleCompilation) function scheduleCompilation () { @@ -146,6 +146,7 @@ module.exports = class CompileTab { self._view.autoCompile = yo`` self._view.hideWarningsBox = yo`` if (self.data.autoCompile) self._view.autoCompile.setAttribute('checked', '') + if (self.data.hideWarnings) self._view.hideWarningsBox.setAttribute('checked', '') self._view.compileContainer = yo`
@@ -194,7 +195,7 @@ module.exports = class CompileTab { function updateAutoCompile (event) { self._opts.config.set('autoCompile', self._view.autoCompile.checked) } function compile (event) { self._api.runCompiler() } function hideWarnings (event) { - self._opts.config.set('hideWarnings', !self._opts.config.get('hideWarnings')) + self._opts.config.set('hideWarnings', self._view.hideWarningsBox.checked) self._api.runCompiler() } function details () { From 6f8d0cc7e6bd57bf9ac4f17955a4c4e41458b011 Mon Sep 17 00:00:00 2001 From: greg Date: Thu, 7 Jun 2018 12:23:20 -0400 Subject: [PATCH 07/98] move styles to global file --- src/app/tabs/compile-tab.js | 5 ----- src/universal-dapp-styles.js | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index ec977223e9..29a46055d7 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -294,11 +294,6 @@ const css = csjs` display: flex; align-items: center; } - .hideWarningsContainer { - display: flex; - align-items: center; - margin-left: 2% - } .autocompile {} .autocompileTitle { font-weight: bold; diff --git a/src/universal-dapp-styles.js b/src/universal-dapp-styles.js index 3ccca94d34..13d15666da 100644 --- a/src/universal-dapp-styles.js +++ b/src/universal-dapp-styles.js @@ -241,6 +241,11 @@ var css = csjs` padding-right: 26px; padding-top: 5px; float: right; + }, + .hideWarningsContainer { + display: flex; + align-items: center; + margin-left: 2% } ` From 3ccb0dbf51e744f42a408c895e88179d38a1e903 Mon Sep 17 00:00:00 2001 From: Edward Grech Date: Sun, 10 Jun 2018 17:11:06 +0200 Subject: [PATCH 08/98] Fixed issue #1292; terminal scrollbar may now be scrolled * Removed div.terminal_bg whose purpose was to hold the background SVG, as this div was occluding the scrollbar, and instead set SVG as the background-image of div.terminal_container using CSS. * As CSS does not have a background-opacity directive, manually decoded, edited and re-encoded the SVGs (light, dark) so that all s are wrapped in a top-level * Improved the rules of how the background image resizes --- src/app/panels/styles/terminal-styles.js | 23 ++++------------------- src/app/panels/terminal.js | 2 -- src/app/ui/styles-guide/style-guide.js | 2 +- src/app/ui/styles-guide/styleGuideDark.js | 2 +- 4 files changed, 6 insertions(+), 23 deletions(-) diff --git a/src/app/panels/styles/terminal-styles.js b/src/app/panels/styles/terminal-styles.js index f44083f01e..fab6475816 100644 --- a/src/app/panels/styles/terminal-styles.js +++ b/src/app/panels/styles/terminal-styles.js @@ -57,25 +57,10 @@ var css = csjs` overflow-y : auto; font-family : monospace; margin : 0px; - } - .terminal_bg { - display : flex; - flex-direction : column; - height : 100%; - padding-left : 5px; - padding-right : 5px; - padding-bottom : 3px; - overflow-y : auto; - font-family : monospace; - background-image : ${styles.terminal.backgroundImage_Terminal}; - opacity : 0.1; - top : 15%; - left : 33%; - bottom : 0; - right : 0; - position : absolute; - background-repeat : no-repeat; - background-size : 45%; + background-image : ${styles.terminal.backgroundImage_Terminal}; + background-repeat : no-repeat; + background-position : center 15%; + background-size : auto calc(75% - 1.7em); } .terminal { position: relative; diff --git a/src/app/panels/terminal.js b/src/app/panels/terminal.js index 1745496ba2..4dce6b3c58 100644 --- a/src/app/panels/terminal.js +++ b/src/app/panels/terminal.js @@ -145,8 +145,6 @@ class Terminal { self._view.term = yo`
-
-
${self._view.journal} ${self._view.cli} diff --git a/src/app/ui/styles-guide/style-guide.js b/src/app/ui/styles-guide/style-guide.js index 41bf21fb2d..9398008644 100644 --- a/src/app/ui/styles-guide/style-guide.js +++ b/src/app/ui/styles-guide/style-guide.js @@ -448,7 +448,7 @@ function styleGuide () { backgroundColor_Menu: appProperties.secondary_BackgroundColor, backgroundColor_Terminal: appProperties.seventh_BackgroundColor, backgroundColor_TerminalCLI: appProperties.seventh_BackgroundColor, - backgroundImage_Terminal: "url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS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color, text_Secondary: appProperties.supportText_Color, diff --git a/src/app/ui/styles-guide/styleGuideDark.js b/src/app/ui/styles-guide/styleGuideDark.js index 53170c9e30..70ad6b8b43 100644 --- a/src/app/ui/styles-guide/styleGuideDark.js +++ b/src/app/ui/styles-guide/styleGuideDark.js @@ -455,7 +455,7 @@ function styleGuideDark () { backgroundColor_Menu: appProperties.secondary_BackgroundColor, backgroundColor_Terminal: appProperties.seventh_BackgroundColor, backgroundColor_TerminalCLI: appProperties.seventh_BackgroundColor, - backgroundImage_Terminal: "url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iNTEycHgiIGhlaWdodD0iNTEycHgiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik03MC41ODIsNDI4LjkwNGMwLjgxMSwwLDEuNjIyLDAuMjg1LDIuNDM3LDAuODU0YzAuODEyLDAuNTcsMS4yMTg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CAyNTUuOTY5LDEyNi43ODIgMjU1Ljk2OSwwLjAwMSIvPg0KCQkJCQk8L2c+DQoJCQkJPC9nPg0KCQkJCTxnIG9wYWNpdHk9IjAuOCI+DQoJCQkJCTxnPg0KCQkJCQkJPHBvbHlnb24gZmlsbD0iI0ZGRkZGRiIgcG9pbnRzPSIyNTUuOTY5LDAgMjU1Ljk2OSwxMjYuNzgxIDI1NS45NjksMjM2LjgxOCAzNjEuMjA0LDE3NC42MTEiLz4NCgkJCQkJPC9nPg0KCQkJCTwvZz4NCgkJCTwvZz4NCgkJPC9nPg0KCTwvZz4NCjwvc3ZnPg0K')", text_Primary: appProperties.mainText_Color, text_Secondary: appProperties.supportText_Color, From 2610705c27e3086cb5bb5ab7b783000358011edb Mon Sep 17 00:00:00 2001 From: bakaoh Date: Mon, 25 Jun 2018 09:45:09 +0700 Subject: [PATCH 09/98] Remove id from MultiParam input --- src/multiParamManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multiParamManager.js b/src/multiParamManager.js index 6e62253c08..dd4e55559d 100644 --- a/src/multiParamManager.js +++ b/src/multiParamManager.js @@ -100,7 +100,7 @@ class MultiParamManager { if (this.funABI.inputs) { return yo`
${this.funABI.inputs.map(function (inp) { - return yo`
` + return yo`
` })}
` } From 4a5f4a880de45e7722ff9bc8eedbd668470c56c0 Mon Sep 17 00:00:00 2001 From: Thomas Schoffelen Date: Wed, 13 Jun 2018 20:26:46 +0200 Subject: [PATCH 10/98] Added copy buttons for ABI and Bytecode --- src/app/tabs/compile-tab.js | 69 +++++++++++++++++++++++++++++++++---- 1 file changed, 63 insertions(+), 6 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 29a46055d7..dbf6abbc1b 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -1,5 +1,6 @@ const yo = require('yo-yo') const csjs = require('csjs-inject') +const copy = require('clipboard-copy') const TreeView = require('../ui/TreeView') const modalDialog = require('../ui/modaldialog') @@ -8,6 +9,7 @@ const modalDialogCustom = require('../ui/modal-dialog-custom') const styleGuide = require('../ui/styles-guide/theme-chooser') const parseContracts = require('../contract/contractParser') const publishOnSwarm = require('../contract/publishOnSwarm') +const addTooltip = require('../ui/tooltip') const styles = styleGuide.chooser() @@ -166,10 +168,18 @@ module.exports = class CompileTab { self._view.contractNames = yo`` self._view.contractEl = yo`
- ${self._view.contractNames} -
+
+ ${self._view.contractNames} +
+
Details
Publish on Swarm
+
+ ABI +
+
+ Bytecode +
` self._view.el = yo` @@ -198,6 +208,36 @@ module.exports = class CompileTab { self._opts.config.set('hideWarnings', self._view.hideWarningsBox.checked) self._api.runCompiler() } + function getContractProperty (property) { + const select = self._view.contractNames + if (select.children.length > 0 && select.selectedIndex >= 0) { + const contractName = select.children[select.selectedIndex].innerHTML + const contractProperties = self.data.contractsDetails[contractName] + return contractProperties[property] || null + } + } + function copyContractProperty (property) { + let content = getContractProperty(property) + if (!content) { + addTooltip('No content available for ' + property) + return + } + + try { + if (typeof content !== 'string') { + content = JSON.stringify(content, null, '\t') + } + } catch (e) {} + + copy(content) + addTooltip('Copied value to clipboard') + } + function copyABI () { + copyContractProperty('abi') + } + function copyBytecode () { + copyContractProperty('bytecode') + } function details () { const select = self._view.contractNames if (select.children.length > 0 && select.selectedIndex >= 0) { @@ -331,25 +371,42 @@ const css = csjs` .container { ${styles.rightPanel.compileTab.box_CompileContainer}; margin: 0; + margin-bottom: 2%; + } + .contractContainer { display: flex; align-items: center; + margin-bottom: 2%; } .contractNames { ${styles.rightPanel.compileTab.dropdown_CompileContract}; - margin-right: 5%; } - .contractButtons { + .contractHelperButtons { display: flex; cursor: pointer; - justify-content: center; + justify-content: space-between; text-align: center; } + .copyButton { + ${styles.rightPanel.compileTab.button_Details}; + padding: 0 7px; + min-width: 50px; + width: auto; + margin-left: 5px; + } + .bytecodeButton { + min-width: 80px; + } + .copyIcon { + margin-right: 5px; + } .details { ${styles.rightPanel.compileTab.button_Details}; } .publish { ${styles.rightPanel.compileTab.button_Publish}; - margin-left: 2%; + margin-left: 5px; + margin-right: 5px; width: 120px; } .log { From 0966057c88c7d8e4174ca9b625fd97aec7081713 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 28 Jun 2018 11:32:32 +0200 Subject: [PATCH 11/98] Update compile-tab.js --- src/app/tabs/compile-tab.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index dbf6abbc1b..d425a9bfdd 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -384,7 +384,6 @@ const css = csjs` .contractHelperButtons { display: flex; cursor: pointer; - justify-content: space-between; text-align: center; } .copyButton { From ed9892a568bfc3603d652ee98d69f0ff9e948692 Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 6 Jun 2018 22:32:30 -0400 Subject: [PATCH 12/98] Add ability to filter out compiler warnings --- src/app/tabs/compile-tab.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index d425a9bfdd..2875547175 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -38,6 +38,7 @@ module.exports = class CompileTab { maxTime: 1000, timeout: 300 } + self._opts.config.set('hideWarnings', false) self._events.editor.register('contentChanged', scheduleCompilation) self._events.editor.register('sessionSwitched', scheduleCompilation) function scheduleCompilation () { @@ -334,6 +335,11 @@ const css = csjs` display: flex; align-items: center; } + .hideWarningsContainer { + display: flex; + align-items: center; + margin-left: 2% + } .autocompile {} .autocompileTitle { font-weight: bold; From 3d4ffc9cfe9927e12c1fcf04112b4ab4f7bcea22 Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 6 Jun 2018 23:17:39 -0400 Subject: [PATCH 13/98] Mimic logic of autoCompile button --- src/app/tabs/compile-tab.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 2875547175..71e644259b 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -38,7 +38,6 @@ module.exports = class CompileTab { maxTime: 1000, timeout: 300 } - self._opts.config.set('hideWarnings', false) self._events.editor.register('contentChanged', scheduleCompilation) self._events.editor.register('sessionSwitched', scheduleCompilation) function scheduleCompilation () { From 2ce2aa2a1ede9b3c4b72d0c8a2d41f1e76e8fc71 Mon Sep 17 00:00:00 2001 From: greg Date: Thu, 7 Jun 2018 12:23:20 -0400 Subject: [PATCH 14/98] move styles to global file --- src/app/tabs/compile-tab.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 71e644259b..d425a9bfdd 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -334,11 +334,6 @@ const css = csjs` display: flex; align-items: center; } - .hideWarningsContainer { - display: flex; - align-items: center; - margin-left: 2% - } .autocompile {} .autocompileTitle { font-weight: bold; From da414b7c23e56ec3fca443573f98e49640840a0b Mon Sep 17 00:00:00 2001 From: Thomas Schoffelen Date: Wed, 13 Jun 2018 20:26:46 +0200 Subject: [PATCH 15/98] Added copy buttons for ABI and Bytecode --- src/app/tabs/compile-tab.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index d425a9bfdd..d61a634a06 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -384,6 +384,10 @@ const css = csjs` .contractHelperButtons { display: flex; cursor: pointer; +<<<<<<< HEAD +======= + justify-content: space-between; +>>>>>>> cbfc5f1... Added copy buttons for ABI and Bytecode text-align: center; } .copyButton { From 51519c6c869e3d548ca820ae496ca26aae0aca4c Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 28 Jun 2018 11:32:32 +0200 Subject: [PATCH 16/98] Update compile-tab.js --- src/app/tabs/compile-tab.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index d61a634a06..d425a9bfdd 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -384,10 +384,6 @@ const css = csjs` .contractHelperButtons { display: flex; cursor: pointer; -<<<<<<< HEAD -======= - justify-content: space-between; ->>>>>>> cbfc5f1... Added copy buttons for ABI and Bytecode text-align: center; } .copyButton { From 13ee679c191f72861e4b3b3e48fc14e69d2fb07a Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 14 Jun 2018 16:51:40 +0200 Subject: [PATCH 17/98] add registry --- src/app.js | 2 ++ src/app/editor/editor.js | 18 ++++++------ src/global/registry.js | 1 + src/module-id.js | 8 ++++++ src/registry.js | 62 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 83 insertions(+), 8 deletions(-) create mode 100644 src/global/registry.js create mode 100644 src/module-id.js create mode 100644 src/registry.js diff --git a/src/app.js b/src/app.js index c72a65d1f6..35d531f99a 100644 --- a/src/app.js +++ b/src/app.js @@ -9,6 +9,7 @@ var remixLib = require('remix-lib') var remixTests = require('remix-tests') var EventManager = remixLib.EventManager +var registry = require('./global/registry') var UniversalDApp = require('./universal-dapp.js') var UniversalDAppUI = require('./universal-dapp-ui.js') var Remixd = require('./lib/remixd') @@ -293,6 +294,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org // ----------------- Compiler ----------------- var compiler = new Compiler(importFileCb) + registry.put({api: compiler, name: 'compiler'}) var offsetToLineColumnConverter = new OffsetToLineColumnConverter(compiler.event) // ----------------- UniversalDApp ----------------- diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index a67e5dd4de..a4a35889e8 100644 --- a/src/app/editor/editor.js +++ b/src/app/editor/editor.js @@ -1,9 +1,8 @@ 'use strict' -var remixLib = require('remix-lib') -var EventManager = remixLib.EventManager var yo = require('yo-yo') var csjs = require('csjs-inject') var ace = require('brace') +var registry = require('../../global/registry') require('brace/theme/tomorrow_night_blue') @@ -65,6 +64,10 @@ document.head.appendChild(yo` function Editor (opts = {}) { var self = this + + var eventsName = ['breakpointCleared', 'breakpointAdded', 'sessionSwitched', 'contentChanged'] // not used for legacyEvent + var {uid /* api, */, legacyEvents} = registry.put({api: this, events: eventsName, name: 'editor'}) + self.event = legacyEvents var el = yo`
` var editor = ace.edit(el) if (styles.appProperties.aceTheme) { @@ -85,8 +88,7 @@ function Editor (opts = {}) { el.className += ' ' + css['ace-editor'] el.editor = editor // required to access the editor during tests self.render = function () { return el } - var event = new EventManager() - self.event = event + var sessions = {} var sourceAnnotations = [] var readOnlySessions = {} @@ -103,14 +105,14 @@ function Editor (opts = {}) { var breakpoints = e.editor.session.getBreakpoints() for (var k in breakpoints) { if (k === row.toString()) { - event.trigger('breakpointCleared', [currentSession, row]) + self.event.trigger('breakpointCleared', [currentSession, row]) e.editor.session.clearBreakpoint(row) e.stop() return } } self.setBreakpoint(row) - event.trigger('breakpointAdded', [currentSession, row]) + self.event.trigger('breakpointAdded', [currentSession, row]) e.stop() }) @@ -277,10 +279,10 @@ function Editor (opts = {}) { // Do setup on initialisation here editor.on('changeSession', function () { - event.trigger('sessionSwitched', []) + self.event.trigger('sessionSwitched', []) editor.getSession().on('change', function () { - event.trigger('contentChanged', []) + self.event.trigger('contentChanged', []) }) }) diff --git a/src/global/registry.js b/src/global/registry.js new file mode 100644 index 0000000000..80a033ab23 --- /dev/null +++ b/src/global/registry.js @@ -0,0 +1 @@ +module.exports = new (require('../registry.js'))() diff --git a/src/module-id.js b/src/module-id.js new file mode 100644 index 0000000000..5aea03205e --- /dev/null +++ b/src/module-id.js @@ -0,0 +1,8 @@ +module.exports = stacktrace +function stacktrace () { + var _ = Error.prepareStackTrace + Error.prepareStackTrace = (_, stack) => stack + var callsites = new Error().stack + Error.prepareStackTrace = _ + return callsites.slice(2).map(x => { return x.getFunctionName() }).reverse().join('.') +} diff --git a/src/registry.js b/src/registry.js new file mode 100644 index 0000000000..cec342280f --- /dev/null +++ b/src/registry.js @@ -0,0 +1,62 @@ +const moduleID = require('./module-id.js') +const remixLib = require('remix-lib') +const EventManager = remixLib.EventManager + + +module.exports = class registry { + constructor () { + this.state = {} + } + put ({ api, events, name }) { + const serveruid = moduleID() + '.' + (name || '') + console.log('registering ', serveruid) + if (this.state[serveruid]) return this.state[serveruid] + const server = { + uid: serveruid, + // api: new ApiManager(api), + events: makeEvents(events), + legacyEvents: api.event ? api.event : new EventManager() + } + this.state[serveruid] = { + _name: name, + _api: api, + _events: events, + server: server, + clients: [] + } + return server + } + get (uid) { + const clientuid = moduleID() + const state = this.state[uid] + if (!state) return + const server = state.server + const client = { + uid: clientuid, + api: state._api, + events: server.events, + legacyEvents: server.legacyEvents + } + server.clients.push(client) + return client + } +} + +function makeEvents (events) { + if (!events) return [] + function update (name) { update[name] = new EventManager() } + return events.reduce((fn, x) => { + fn[x] = new EventManager() + var oldTrigger = fn[x].trigger + fn[x].trigger = (name, args) => { + console.log(name) + oldTrigger.call(fn[x], name, args) + } + var oldRegister = fn[x].register + fn[x].register = (name, obj, fn) => { + console.log(name) + oldRegister.call(fn[x], obj, fn) + } + return fn + }, update) +} From 5e769267d01e77180b12bfed0f2426a3e2e2e7e3 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 14 Jun 2018 17:01:25 +0200 Subject: [PATCH 18/98] standard --- src/app/editor/editor.js | 2 +- src/registry.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index a4a35889e8..f56f0341cc 100644 --- a/src/app/editor/editor.js +++ b/src/app/editor/editor.js @@ -66,7 +66,7 @@ function Editor (opts = {}) { var self = this var eventsName = ['breakpointCleared', 'breakpointAdded', 'sessionSwitched', 'contentChanged'] // not used for legacyEvent - var {uid /* api, */, legacyEvents} = registry.put({api: this, events: eventsName, name: 'editor'}) + var {legacyEvents} = registry.put({api: this, events: eventsName, name: 'editor'}) self.event = legacyEvents var el = yo`
` var editor = ace.edit(el) diff --git a/src/registry.js b/src/registry.js index cec342280f..be2fbea5cc 100644 --- a/src/registry.js +++ b/src/registry.js @@ -2,7 +2,6 @@ const moduleID = require('./module-id.js') const remixLib = require('remix-lib') const EventManager = remixLib.EventManager - module.exports = class registry { constructor () { this.state = {} From 220ff6ce7b59f0f5baa3df01902ab3bd7c970053 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 2 Jul 2018 17:13:21 +0200 Subject: [PATCH 19/98] comment moduleid && and use minimal registry --- src/app/editor/editor.js | 7 +++-- src/module-id.js | 3 ++ src/registry.js | 59 ++++++++-------------------------------- 3 files changed, 18 insertions(+), 51 deletions(-) diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index f56f0341cc..98c1630e8d 100644 --- a/src/app/editor/editor.js +++ b/src/app/editor/editor.js @@ -1,4 +1,6 @@ 'use strict' +var remixLib = require('remix-lib') +var EventManager = remixLib.EventManager var yo = require('yo-yo') var csjs = require('csjs-inject') var ace = require('brace') @@ -65,9 +67,6 @@ document.head.appendChild(yo` function Editor (opts = {}) { var self = this - var eventsName = ['breakpointCleared', 'breakpointAdded', 'sessionSwitched', 'contentChanged'] // not used for legacyEvent - var {legacyEvents} = registry.put({api: this, events: eventsName, name: 'editor'}) - self.event = legacyEvents var el = yo`
` var editor = ace.edit(el) if (styles.appProperties.aceTheme) { @@ -84,6 +83,8 @@ function Editor (opts = {}) { // @TODO add here other propositions } } + var event = new EventManager() + self.event = event langTools.addCompleter(flowCompleter) el.className += ' ' + css['ace-editor'] el.editor = editor // required to access the editor during tests diff --git a/src/module-id.js b/src/module-id.js index 5aea03205e..efa2e63238 100644 --- a/src/module-id.js +++ b/src/module-id.js @@ -1,4 +1,7 @@ module.exports = stacktrace +/* + Not used yet +*/ function stacktrace () { var _ = Error.prepareStackTrace Error.prepareStackTrace = (_, stack) => stack diff --git a/src/registry.js b/src/registry.js index be2fbea5cc..951d076165 100644 --- a/src/registry.js +++ b/src/registry.js @@ -1,61 +1,24 @@ -const moduleID = require('./module-id.js') -const remixLib = require('remix-lib') -const EventManager = remixLib.EventManager +// const moduleID = require('./module-id.js') module.exports = class registry { constructor () { this.state = {} } - put ({ api, events, name }) { - const serveruid = moduleID() + '.' + (name || '') - console.log('registering ', serveruid) - if (this.state[serveruid]) return this.state[serveruid] + put ({ api, name }) { + // const serveruid = moduleID() + '.' + (name || '') + if (this.state[name]) return this.state[name] const server = { - uid: serveruid, - // api: new ApiManager(api), - events: makeEvents(events), - legacyEvents: api.event ? api.event : new EventManager() - } - this.state[serveruid] = { - _name: name, - _api: api, - _events: events, - server: server, - clients: [] + // uid: serveruid, + api } + this.state[name] = { server } return server } - get (uid) { - const clientuid = moduleID() - const state = this.state[uid] + get (name) { + // const clientuid = moduleID() + const state = this.state[name] if (!state) return const server = state.server - const client = { - uid: clientuid, - api: state._api, - events: server.events, - legacyEvents: server.legacyEvents - } - server.clients.push(client) - return client + return server } } - -function makeEvents (events) { - if (!events) return [] - function update (name) { update[name] = new EventManager() } - return events.reduce((fn, x) => { - fn[x] = new EventManager() - var oldTrigger = fn[x].trigger - fn[x].trigger = (name, args) => { - console.log(name) - oldTrigger.call(fn[x], name, args) - } - var oldRegister = fn[x].register - fn[x].register = (name, obj, fn) => { - console.log(name) - oldRegister.call(fn[x], obj, fn) - } - return fn - }, update) -} From 317801bfca15b6d8e25ca5505612eb3413609833 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 2 Jul 2018 17:14:08 +0200 Subject: [PATCH 20/98] remove uneeded require --- src/app/editor/editor.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index 98c1630e8d..008a1aa6b1 100644 --- a/src/app/editor/editor.js +++ b/src/app/editor/editor.js @@ -1,10 +1,9 @@ 'use strict' -var remixLib = require('remix-lib') +var remixLib = require('remix-lib') var EventManager = remixLib.EventManager var yo = require('yo-yo') var csjs = require('csjs-inject') var ace = require('brace') -var registry = require('../../global/registry') require('brace/theme/tomorrow_night_blue') @@ -83,13 +82,12 @@ function Editor (opts = {}) { // @TODO add here other propositions } } - var event = new EventManager() - self.event = event langTools.addCompleter(flowCompleter) el.className += ' ' + css['ace-editor'] el.editor = editor // required to access the editor during tests self.render = function () { return el } - + var event = new EventManager() + self.event = event var sessions = {} var sourceAnnotations = [] var readOnlySessions = {} From 911ba041fa121bb12869ff93aa834c3eda13c3ef Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 26 Jun 2018 10:50:59 +0200 Subject: [PATCH 21/98] refactor rhpp --- src/app.js | 189 +++++++++++------------------- src/app/editor/editor.js | 9 +- src/app/panels/editor-panel.js | 4 + src/app/panels/righthand-panel.js | 32 +++-- src/app/plugin/pluginAPI.js | 10 +- src/app/plugin/pluginManager.js | 23 ++-- src/app/tabs/analysis-tab.js | 6 +- src/app/tabs/compile-tab.js | 74 +++++++----- src/app/tabs/debugger-tab.js | 6 +- src/app/tabs/plugin-tab.js | 7 +- src/app/tabs/run-tab.js | 119 ++++++++++--------- src/app/tabs/settings-tab.js | 47 +++++--- src/app/tabs/support-tab.js | 11 +- src/app/tabs/tabbed-menu.js | 15 ++- src/app/tabs/test-tab.js | 23 ++-- src/universal-dapp.js | 11 ++ 16 files changed, 301 insertions(+), 285 deletions(-) diff --git a/src/app.js b/src/app.js index 35d531f99a..5bad821530 100644 --- a/src/app.js +++ b/src/app.js @@ -46,7 +46,6 @@ var BasicReadOnlyExplorer = require('./app/files/basicReadOnlyExplorer') var NotPersistedExplorer = require('./app/files/NotPersistedExplorer') var toolTip = require('./app/ui/tooltip') var CommandInterpreter = require('./lib/cmdInterpreter') -var PluginAPI = require('./app/plugin/pluginAPI') var styleGuide = require('./app/ui/styles-guide/theme-chooser') var styles = styleGuide.chooser() @@ -117,16 +116,26 @@ class App { constructor (api = {}, events = {}, opts = {}) { var self = this self._api = {} + registry.put({api: self, name: 'app'}) var fileStorage = new Storage('sol:') + registry.put({api: fileStorage, name: 'fileStorage'}) + var configStorage = new Storage('config:') + registry.put({api: configStorage, name: 'configStorage'}) + self._api.config = new Config(fileStorage) + registry.put({api: self._api.config, name: 'config'}) + executionContext.init(self._api.config) executionContext.listenOnLastBlock() self._api.filesProviders = {} self._api.filesProviders['browser'] = new Browserfiles(fileStorage) self._api.filesProviders['config'] = new BrowserfilesTree('config', configStorage) self._api.filesProviders['config'].init() + registry.put({api: self._api.filesProviders['browser'], name: 'fileProviders/browser'}) + registry.put({api: self._api.filesProviders['config'], name: 'fileProviders/config'}) var remixd = new Remixd() + registry.put({api: remixd, name: 'remixd/config'}) remixd.event.register('system', (message) => { if (message.error) toolTip(message.error) }) @@ -135,9 +144,15 @@ class App { self._api.filesProviders['github'] = new BasicReadOnlyExplorer('github') self._api.filesProviders['gist'] = new NotPersistedExplorer('gist') self._api.filesProviders['ipfs'] = new BasicReadOnlyExplorer('ipfs') + registry.put({api: self._api.filesProviders['localhost'], name: 'fileProviders/localhost'}) + registry.put({api: self._api.filesProviders['swarm'], name: 'fileProviders/swarm'}) + registry.put({api: self._api.filesProviders['github'], name: 'fileProviders/github'}) + registry.put({api: self._api.filesProviders['gist'], name: 'fileProviders/gist'}) + registry.put({api: self._api.filesProviders['ipfs'], name: 'fileProviders/ipfs'}) self._view = {} self._components = {} self._components.compilerImport = new CompilerImport() + registry.put({api: self._components.compilerImport, name: 'compilerImport'}) self.data = { _layout: { right: { @@ -207,6 +222,34 @@ class App { self._adjustLayout('right', self.data._layout.right.offset) return self._view.el } + runCompiler () { + const self = this + if (self._view.transactionDebugger.isActive) return + + self._components.fileManager.saveCurrentFile() + self._components.editor.clearAnnotations() + var currentFile = self._api.config.get('currentFile') + if (currentFile) { + if (/.(.sol)$/.exec(currentFile)) { + // only compile *.sol file. + var target = currentFile + var sources = {} + var provider = self._components.fileManager.fileProviderOf(currentFile) + if (provider) { + provider.get(target, (error, content) => { + if (error) { + console.log(error) + } else { + sources[target] = { content } + self._components.compiler.compile(sources, target) + } + }) + } else { + console.log('cannot compile ' + currentFile + '. Does not belong to any explorer') + } + } + } + } } module.exports = App @@ -242,7 +285,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org // ctrl+s or command+s if ((e.metaKey || e.ctrlKey) && e.keyCode === 83) { e.preventDefault() - runCompiler() + self.runCompiler() } }) @@ -293,7 +336,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org } // ----------------- Compiler ----------------- - var compiler = new Compiler(importFileCb) + self._components.compiler = new Compiler(importFileCb) + var compiler = self._components.compiler registry.put({api: compiler, name: 'compiler'}) var offsetToLineColumnConverter = new OffsetToLineColumnConverter(compiler.event) @@ -327,6 +371,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org cb(null, $('#gasLimit').val()) } } + // @TODO should put this in runtab + registry.put({api: transactionContextAPI, name: 'transactionContextAPI'}) var udapp = new UniversalDApp({ api: { @@ -346,10 +392,12 @@ Please make a backup of your contracts and start using http://remix.ethereum.org }, opt: { removable: false, removable_instances: true } }) + registry.put({api: udapp, name: 'udapp'}) var udappUI = new UniversalDAppUI(udapp) + registry.put({api: udappUI, name: 'udappUI'}) - udapp.reset({}, transactionContextAPI) + udapp.reset({}) udappUI.reset() udapp.event.register('debugRequested', this, function (txResult) { startdebugging(txResult.transactionHash) @@ -389,6 +437,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org event: { udapp: udapp.event }}) + registry.put({api: txlistener, name: 'txlistener'}) var eventsDecoder = new EventsDecoder({ api: { @@ -397,6 +446,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org } } }) + registry.put({api: eventsDecoder, name: 'eventsDecoder'}) txlistener.startListening() @@ -467,6 +517,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org // ----------------- editor ---------------------------- this._components.editor = new Editor({}) // @TODO: put into editorpanel var editor = self._components.editor // shortcut for the editor + registry.put({api: editor, name: 'editor'}) // ---------------- ContextualListener ----------------------- this._components.contextualListener = new ContextualListener({ @@ -557,6 +608,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org udapp: () => { return udapp } } }) + registry.put({ api: this._components.editorpanel, name: 'editorpanel' }) this._components.editorpanel.event.register('resize', direction => self._adjustLayout(direction)) this._view.centerpanel.appendChild(this._components.editorpanel.render()) @@ -580,12 +632,14 @@ Please make a backup of your contracts and start using http://remix.ethereum.org var config = self._api.config var filesProviders = self._api.filesProviders - var fileManager = new FileManager({ + self._components.fileManager = new FileManager({ config: config, editor: editor, filesProviders: filesProviders, compilerImport: self._components.compilerImport }) + var fileManager = self._components.fileManager + registry.put({api: fileManager, name: 'filemanager'}) // Add files received from remote instance (i.e. another remix-ide) function loadFiles (filesSet, fileProvider, callback) { @@ -715,6 +769,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org } } var renderer = new Renderer(rendererAPI) + registry.put({api: renderer, name: 'renderer'}) // ----------------- StaticAnalysis ----------------- @@ -727,84 +782,10 @@ Please make a backup of your contracts and start using http://remix.ethereum.org } } var staticanalysis = new StaticAnalysis(staticAnalysisAPI, compiler.event) + registry.put({api: staticanalysis, name: 'staticanalysis'}) // ---------------- Righthand-panel -------------------- - - var rhpAPI = { - importFileCb: importFileCb, - filesFromPath: (path, cb) => { - fileManager.filesFromPath(path, cb) - }, - newAccount: (pass, cb) => { - udapp.newAccount(pass, cb) - }, - setEditorSize (delta) { - $('#righthand-panel').css('width', delta) - self._view.centerpanel.style.right = delta + 'px' - document.querySelector(`.${css.dragbar2}`).style.right = delta + 'px' - onResize() - }, - switchFile: function (path) { - fileManager.switchFile(path) - }, - filesProviders: filesProviders, - fileProviderOf: (path) => { - return fileManager.fileProviderOf(path) - }, - fileProvider: (name) => { - return self._api.filesProviders[name] - }, - currentPath: function () { - return fileManager.currentPath() - }, - getBalance: (address, callback) => { - udapp.getBalance(address, (error, balance) => { - if (error) { - callback(error) - } else { - callback(null, executionContext.web3().fromWei(balance, 'ether')) - } - }) - }, - currentCompiledSourceCode: () => { - if (compiler.lastCompilationResult.source) { - return compiler.lastCompilationResult.source.sources[compiler.lastCompilationResult.source.target] - } - return '' - }, - resetDapp: (contracts) => { - udapp.reset(contracts, transactionContextAPI) - udappUI.reset() - }, - setOptimize: (optimize, runCompilation) => { - compiler.setOptimize(optimize) - if (runCompilation) runCompiler() - }, - runCompiler: () => { - runCompiler() - }, - logMessage: (msg) => { - self._components.editorpanel.log({type: 'log', value: msg}) - } - } - var rhpEvents = { - compiler: compiler.event, - app: self.event, - udapp: udapp.event, - editor: editor.event, - staticAnalysis: staticanalysis.event - } - var rhpOpts = { - pluginAPI: new PluginAPI(self, compiler), - udapp: udapp, - udappUI: udappUI, - compiler: compiler, - renderer: renderer, - editor: editor, - config: config - } - - self._components.righthandpanel = new RighthandPanel(rhpAPI, rhpEvents, rhpOpts) + self._components.righthandpanel = new RighthandPanel() self._view.rightpanel.appendChild(self._components.righthandpanel.render()) self._components.righthandpanel.init() self._components.righthandpanel.event.register('resize', delta => self._adjustLayout('right', delta)) @@ -861,11 +842,11 @@ Please make a backup of your contracts and start using http://remix.ethereum.org return offsetToLineColumnConverter.offsetToLineColumn(location, file, compiler.lastCompilationResult) } } - var transactionDebugger = new Debugger('#debugger', debugAPI, editor.event) - transactionDebugger.addProvider('vm', executionContext.vm()) - transactionDebugger.addProvider('injected', executionContext.internalWeb3()) - transactionDebugger.addProvider('web3', executionContext.internalWeb3()) - transactionDebugger.switchProvider(executionContext.getProvider()) + self._view.transactionDebugger = new Debugger('#debugger', debugAPI, editor.event) + self._view.transactionDebugger.addProvider('vm', executionContext.vm()) + self._view.transactionDebugger.addProvider('injected', executionContext.internalWeb3()) + self._view.transactionDebugger.addProvider('web3', executionContext.internalWeb3()) + self._view.transactionDebugger.switchProvider(executionContext.getProvider()) var txLogger = new TxLogger({ api: { @@ -889,34 +870,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org startdebugging(hash) }) - function runCompiler () { - if (transactionDebugger.isActive) return - - fileManager.saveCurrentFile() - editor.clearAnnotations() - var currentFile = config.get('currentFile') - if (currentFile) { - if (/.(.sol)$/.exec(currentFile)) { - // only compile *.sol file. - var target = currentFile - var sources = {} - var provider = fileManager.fileProviderOf(currentFile) - if (provider) { - provider.get(target, (error, content) => { - if (error) { - console.log(error) - } else { - sources[target] = { content } - compiler.compile(sources, target) - } - }) - } else { - console.log('cannot compile ' + currentFile + '. Does not belong to any explorer') - } - } - } - } - var previousInput = '' var saveTimeout = null @@ -950,16 +903,16 @@ Please make a backup of your contracts and start using http://remix.ethereum.org editor.event.register('sessionSwitched', editorOnChange) executionContext.event.register('contextChanged', this, function (context) { - runCompiler() + self.runCompiler() }) executionContext.event.register('web3EndpointChanged', this, function (context) { - runCompiler() + self.runCompiler() }) compiler.event.register('compilerLoaded', this, function (version) { previousInput = '' - runCompiler() + self.runCompiler() if (queryParams.get().context) { let context = queryParams.get().context @@ -987,6 +940,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org function startdebugging (txHash) { self.event.trigger('debuggingRequested', []) - transactionDebugger.debug(txHash) + self._view.transactionDebugger.debug(txHash) } } diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index 008a1aa6b1..a67e5dd4de 100644 --- a/src/app/editor/editor.js +++ b/src/app/editor/editor.js @@ -65,7 +65,6 @@ document.head.appendChild(yo` function Editor (opts = {}) { var self = this - var el = yo`
` var editor = ace.edit(el) if (styles.appProperties.aceTheme) { @@ -104,14 +103,14 @@ function Editor (opts = {}) { var breakpoints = e.editor.session.getBreakpoints() for (var k in breakpoints) { if (k === row.toString()) { - self.event.trigger('breakpointCleared', [currentSession, row]) + event.trigger('breakpointCleared', [currentSession, row]) e.editor.session.clearBreakpoint(row) e.stop() return } } self.setBreakpoint(row) - self.event.trigger('breakpointAdded', [currentSession, row]) + event.trigger('breakpointAdded', [currentSession, row]) e.stop() }) @@ -278,10 +277,10 @@ function Editor (opts = {}) { // Do setup on initialisation here editor.on('changeSession', function () { - self.event.trigger('sessionSwitched', []) + event.trigger('sessionSwitched', []) editor.getSession().on('change', function () { - self.event.trigger('contentChanged', []) + event.trigger('contentChanged', []) }) }) diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index 4762ffa41c..6ecd460c70 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -96,6 +96,10 @@ class EditorPanel { var command = self._components.terminal.commands[data.type] if (typeof command === 'function') command(data.value) } + logMessage (msg) { + var self = this + self.log({type: 'log', value: msg}) + } render () { var self = this if (self._view.el) return self._view.el diff --git a/src/app/panels/righthand-panel.js b/src/app/panels/righthand-panel.js index ae6fc8189e..dbdd6baa71 100644 --- a/src/app/panels/righthand-panel.js +++ b/src/app/panels/righthand-panel.js @@ -2,6 +2,8 @@ const yo = require('yo-yo') const csjs = require('csjs-inject') const remixLib = require('remix-lib') +var globalRegistry = require('../../global/registry') + const styleguide = require('../ui/styles-guide/theme-chooser') const PluginManager = require('../plugin/pluginManager') const TabbedMenu = require('../tabs/tabbed-menu') @@ -18,32 +20,28 @@ const EventManager = remixLib.EventManager const styles = styleguide.chooser() module.exports = class RighthandPanel { - constructor (api = {}, events = {}, opts = {}) { + constructor (localRegistry) { const self = this + self._components = {} + self._components.registry = localRegistry || globalRegistry self.event = new EventManager() - self._api = api - self._api.switchTab = x => { // @TODO: refactor - if (self._components.tabbedMenu) self._components.tabbedMenu.selectTabByClassName(x) - } - self._events = events - self._events.rhp = self.event // @TODO: refactor - self._opts = opts self._view = { element: null, tabbedMenu: null, tabbedMenuViewport: null, dragbar: null } + self._components = { - pluginManager: new PluginManager(self._opts.pluginAPI, self._events), - tabbedMenu: new TabbedMenu(self._api, self._events), - compile: new CompileTab(self._api, self._events, self._opts), - run: new RunTab(self._api, self._events, self._opts), - settings: new SettingsTab(self._api, self._events, self._opts), - analysis: new AnalysisTab(self._api, self._events, self._opts), - debug: new DebuggerTab(self._api, self._events, self._opts), - support: new SupportTab(self._api, self._events, self._opts), - test: new TestTab(self._api, self._events, self._opts) + pluginManager: new PluginManager(), + tabbedMenu: new TabbedMenu(), + compile: new CompileTab(), + run: new RunTab(), + settings: new SettingsTab(), + analysis: new AnalysisTab(), + debug: new DebuggerTab(), + support: new SupportTab(), + test: new TestTab() } self.event.register('plugin-loadRequest', json => { diff --git a/src/app/plugin/pluginAPI.js b/src/app/plugin/pluginAPI.js index eb1f72322f..82119414c4 100644 --- a/src/app/plugin/pluginAPI.js +++ b/src/app/plugin/pluginAPI.js @@ -2,24 +2,24 @@ /* Defines available API. `key` / `type` */ -module.exports = (app, compiler) => { +module.exports = (registry) => { return { config: { setConfig: (mod, path, content, cb) => { - app._api.filesProviders['config'].set(mod + '/' + path, content) + registry.get('fileProviders/config').api.set(mod + '/' + path, content) cb() }, getConfig: (mod, path, cb) => { - cb(null, app._api.filesProviders['config'].get(mod + '/' + path)) + cb(null, registry.get('fileProviders/config').get(mod + '/' + path)) }, removeConfig: (mod, path, cb) => { - cb(null, app._api.filesProviders['config'].remove(mod + '/' + path)) + cb(null, registry.get('fileProviders/config').api.remove(mod + '/' + path)) if (cb) cb() } }, compiler: { getCompilationResult: () => { - return compiler.lastCompilationResult + return registry.get('compiler').api.lastCompilationResult } } } diff --git a/src/app/plugin/pluginManager.js b/src/app/plugin/pluginManager.js index 0c1c5ba955..462b457ea1 100644 --- a/src/app/plugin/pluginManager.js +++ b/src/app/plugin/pluginManager.js @@ -1,4 +1,7 @@ 'use strict' + +var globalRegistry = require('../../global/registry') +var PluginAPI = require('./pluginAPI') /** * Register and Manage plugin: * @@ -76,15 +79,19 @@ * */ module.exports = class PluginManager { - constructor (api = {}, events = {}, opts = {}) { + constructor (localRegistry) { const self = this - self._opts = opts - self._api = api - self._events = events self.plugins = {} + self._components = {} + self._components.registry = localRegistry || globalRegistry + self._components.pluginAPI = new PluginAPI(self._components.registry) + self._deps = { + compiler: self._components.registry.get('compiler').api, + app: self._components.registry.get('app').api + } self.inFocus self.allowedapi = {'setConfig': 1, 'getConfig': 1, 'removeConfig': 1} - self._events.compiler.register('compilationFinished', (success, data, source) => { + self._deps.compiler.event.register('compilationFinished', (success, data, source) => { if (self.inFocus) { // trigger to the current focus self.post(self.inFocus, JSON.stringify({ @@ -96,7 +103,7 @@ module.exports = class PluginManager { } }) - self._events.app.register('tabChanged', (tabName) => { + self._deps.app.event.register('tabChanged', (tabName) => { if (self.inFocus && self.inFocus !== tabName) { // trigger unfocus self.post(self.inFocus, JSON.stringify({ @@ -119,7 +126,7 @@ module.exports = class PluginManager { action: 'notification', key: 'compiler', type: 'compilationData', - value: [api.compiler.getCompilationResult()] + value: [self._deps.compiler.getCompilationResult()] })) } }) @@ -142,7 +149,7 @@ module.exports = class PluginManager { data.value.push((error, result) => { response(data.key, data.type, data.id, error, result) }) - api[data.key][data.type].apply({}, data.value) + self._components.pluginAPI[data.key][data.type].apply({}, data.value) } } }, false) diff --git a/src/app/tabs/analysis-tab.js b/src/app/tabs/analysis-tab.js index f2bda461ca..16a7c06c04 100644 --- a/src/app/tabs/analysis-tab.js +++ b/src/app/tabs/analysis-tab.js @@ -2,17 +2,17 @@ var yo = require('yo-yo') var csjs = require('csjs-inject') var remixLib = require('remix-lib') +var globalRegistry = require('../../global/registry') var EventManager = remixLib.EventManager module.exports = class AnalysisTab { - constructor (opts = { api: {}, events: {} }) { + constructor (localRegistry) { const self = this self.event = new EventManager() - self._api = opts.api - self._events = opts.events self._view = { el: null } self.data = {} self._components = {} + self._components.registry = localRegistry || globalRegistry } render () { const self = this diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index d425a9bfdd..e8d228d781 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -2,6 +2,7 @@ const yo = require('yo-yo') const csjs = require('csjs-inject') const copy = require('clipboard-copy') +var globalRegistry = require('../../global/registry') const TreeView = require('../ui/TreeView') const modalDialog = require('../ui/modaldialog') const copyToClipboard = require('../ui/copy-to-clipboard') @@ -14,11 +15,8 @@ const addTooltip = require('../ui/tooltip') const styles = styleGuide.chooser() module.exports = class CompileTab { - constructor (api = {}, events = {}, opts = {}) { + constructor (localRegistry) { const self = this - self._opts = opts - self._api = api - self._events = events self._view = { el: null, autoCompile: null, @@ -30,22 +28,36 @@ module.exports = class CompileTab { contractNames: null, contractEl: null } + self._components = {} + self._components.registry = localRegistry || globalRegistry + // dependencies + self._deps = { + app: self._components.registry.get('app').api, + udapp: self._components.registry.get('udapp').api, + udappUI: self._components.registry.get('udappUI').api, + editor: self._components.registry.get('editor').api, + config: self._components.registry.get('config').api, + compiler: self._components.registry.get('compiler').api, + staticAnalysis: self._components.registry.get('staticanalysis').api, + renderer: self._components.registry.get('renderer').api, + transactionContextAPI: self._components.registry.get('transactionContextAPI').api + } self.data = { - hideWarnings: self._opts.config.get('hideWarnings') || false, - autoCompile: self._opts.config.get('autoCompile'), + hideWarnings: self._deps.config.get('hideWarnings') || false, + autoCompile: self._deps.config.get('autoCompile'), compileTimeout: null, contractsDetails: {}, maxTime: 1000, timeout: 300 } - self._events.editor.register('contentChanged', scheduleCompilation) - self._events.editor.register('sessionSwitched', scheduleCompilation) + self._deps.editor.event.register('contentChanged', scheduleCompilation) + self._deps.editor.event.register('sessionSwitched', scheduleCompilation) function scheduleCompilation () { - if (!self._opts.config.get('autoCompile')) return + if (!self._deps.config.get('autoCompile')) return if (self.data.compileTimeout) window.clearTimeout(self.data.compileTimeout) - self.data.compileTimeout = window.setTimeout(() => self._api.runCompiler(), self.data.timeout) + self.data.compileTimeout = window.setTimeout(() => self._deps.app.runCompiler(), self.data.timeout) } - self._events.compiler.register('compilationDuration', function tabHighlighting (speed) { + self._deps.compiler.event.register('compilationDuration', function tabHighlighting (speed) { if (!self._view.warnCompilationSlow) return if (speed > self.data.maxTime) { const msg = `Last compilation took ${speed}ms. We suggest to turn off autocompilation.` @@ -55,31 +67,31 @@ module.exports = class CompileTab { self._view.warnCompilationSlow.style.display = 'none' } }) - self._events.editor.register('contentChanged', function changedFile () { + self._deps.editor.event.register('contentChanged', function changedFile () { if (!self._view.compileIcon) return const compileTab = document.querySelector('.compileView') // @TODO: compileView tab compileTab.style.color = styles.colors.red // @TODO: compileView tab self._view.compileIcon.classList.add(`${css.bouncingIcon}`) // @TODO: compileView tab }) - self._events.compiler.register('loadingCompiler', function start () { + self._deps.compiler.event.register('loadingCompiler', function start () { if (!self._view.compileIcon) return self._view.compileIcon.classList.add(`${css.spinningIcon}`) self._view.warnCompilationSlow.style.display = 'none' self._view.compileIcon.setAttribute('title', 'compiler is loading, please wait a few moments.') }) - self._events.compiler.register('compilationStarted', function start () { + self._deps.compiler.event.register('compilationStarted', function start () { if (!self._view.compileIcon) return self._view.errorContainer.innerHTML = '' self._view.compileIcon.classList.remove(`${css.bouncingIcon}`) self._view.compileIcon.classList.add(`${css.spinningIcon}`) self._view.compileIcon.setAttribute('title', 'compiling...') }) - self._events.compiler.register('compilerLoaded', function loaded () { + self._deps.compiler.event.register('compilerLoaded', function loaded () { if (!self._view.compileIcon) return self._view.compileIcon.classList.remove(`${css.spinningIcon}`) self._view.compileIcon.setAttribute('title', '') }) - self._events.compiler.register('compilationFinished', function finish (success, data, source) { + self._deps.compiler.event.register('compilationFinished', function finish (success, data, source) { if (self._view.compileIcon) { const compileTab = document.querySelector('.compileView') compileTab.style.color = styles.colors.black @@ -94,15 +106,17 @@ module.exports = class CompileTab { self._view.contractNames.innerHTML = '' if (success) { self._view.contractNames.removeAttribute('disabled') - self._opts.compiler.visitContracts(contract => { - self.data.contractsDetails[contract.name] = parseContracts(contract.name, contract.object, self._opts.compiler.getSource(contract.file)) + self._deps.compiler.visitContracts(contract => { + self.data.contractsDetails[contract.name] = parseContracts(contract.name, contract.object, self._deps.compiler.getSource(contract.file)) var contractName = yo`` self._view.contractNames.appendChild(contractName) }) - self._api.resetDapp(self.data.contractsDetails) + self._deps.udapp.reset(self.data.contractsDetails, self._deps.transactionContextAPI) + self._deps.udappUI.reset() } else { self._view.contractNames.setAttribute('disabled', true) - self._api.resetDapp({}) + self._deps.udapp.reset({}, self._deps.transactionContextAPI) + self._deps.udappUI.reset() } // hightlight the tab if error if (success) document.querySelector('.compileView').style.color = '' // @TODO: compileView tab @@ -111,31 +125,31 @@ module.exports = class CompileTab { var error = false if (data['error']) { error = true - self._opts.renderer.error(data['error'].formattedMessage, self._view.errorContainer, {type: data['error'].severity}) + self._deps.renderer.error(data['error'].formattedMessage, self._view.errorContainer, {type: data['error'].severity}) } if (data.errors && data.errors.length) { error = true data.errors.forEach(function (err) { - if (self._opts.config.get('hideWarnings')) { + if (self._deps.config.get('hideWarnings')) { if (err.severity !== 'warning') { - self._opts.renderer.error(err.formattedMessage, self._view.errorContainer, {type: err.severity}) + self._deps.renderer.error(err.formattedMessage, self._view.errorContainer, {type: err.severity}) } } else { - self._opts.renderer.error(err.formattedMessage, self._view.errorContainer, {type: err.severity}) + self._deps.renderer.error(err.formattedMessage, self._view.errorContainer, {type: err.severity}) } }) } if (!error && data.contracts) { - self._opts.compiler.visitContracts((contract) => { - self._opts.renderer.error(contract.name, self._view.errorContainer, {type: 'success'}) + self._deps.compiler.visitContracts((contract) => { + self._deps.renderer.error(contract.name, self._view.errorContainer, {type: 'success'}) }) } }) - self._events.staticAnalysis.register('staticAnaysisWarning', (count) => { + self._deps.staticAnalysis.event.register('staticAnaysisWarning', (count) => { if (count) { const msg = `Static Analysis raised ${count} warning(s) that requires your attention. Click here to show the warning(s).` const settings = { type: 'staticAnalysisWarning', click: () => self._api.switchTab('staticanalysisView'), useSpan: true } - self._opts.renderer.error(msg, self._view.errorContainer, settings) + self._deps.renderer.error(msg, self._view.errorContainer, settings) } }) } @@ -202,8 +216,8 @@ module.exports = class CompileTab { 'swarmLocation': 'Swarm url where all metadata information can be found (contract needs to be published first)', 'web3Deploy': 'Copy/paste this code to any JavaScript/Web3 console to deploy this contract' } - function updateAutoCompile (event) { self._opts.config.set('autoCompile', self._view.autoCompile.checked) } - function compile (event) { self._api.runCompiler() } + function updateAutoCompile (event) { self._deps.config.set('autoCompile', self._view.autoCompile.checked) } + function compile (event) { self._deps.app.runCompiler() } function hideWarnings (event) { self._opts.config.set('hideWarnings', self._view.hideWarningsBox.checked) self._api.runCompiler() diff --git a/src/app/tabs/debugger-tab.js b/src/app/tabs/debugger-tab.js index a9fed861c5..ccf7abb35b 100644 --- a/src/app/tabs/debugger-tab.js +++ b/src/app/tabs/debugger-tab.js @@ -2,18 +2,18 @@ var yo = require('yo-yo') var csjs = require('csjs-inject') var remixLib = require('remix-lib') +var globalRegistry = require('../../global/registry') var EventManager = remixLib.EventManager var styles = require('../ui/styles-guide/theme-chooser').chooser() module.exports = class DebuggerTab { - constructor (opts = { api: {}, events: {} }) { + constructor (localRegistry) { const self = this self.event = new EventManager() - self._api = opts.api - self._events = opts.events self._view = { el: null } self.data = {} self._components = {} + self._components.registry = localRegistry || globalRegistry } render () { const self = this diff --git a/src/app/tabs/plugin-tab.js b/src/app/tabs/plugin-tab.js index 9b92233c0c..d4ad06924c 100644 --- a/src/app/tabs/plugin-tab.js +++ b/src/app/tabs/plugin-tab.js @@ -2,17 +2,16 @@ var yo = require('yo-yo') var csjs = require('csjs-inject') var remixLib = require('remix-lib') +var globalRegistry = require('../../global/registry') var EventManager = remixLib.EventManager module.exports = class plugintab { - constructor (api = {}, events = {}, opts = {}) { + constructor (localRegistry) { const self = this self.event = new EventManager() - self._opts = opts - self._api = api - self._events = events self._view = { el: null } self._components = {} + self._components.registry = localRegistry || globalRegistry } render () { const self = this diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 416fa6a4ff..494d7becc0 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -8,6 +8,7 @@ var txExecution = remixLib.execution.txExecution var txFormat = remixLib.execution.txFormat var txHelper = remixLib.execution.txHelper var EventManager = remixLib.EventManager +var globlalRegistry = require('../../global/registry') var helper = require('../../lib/helper.js') var executionContext = require('../../execution-context') var modalDialogCustom = require('../ui/modal-dialog-custom') @@ -18,13 +19,12 @@ var addTooltip = require('../ui/tooltip') var css = require('./styles/run-tab-styles') var MultiParamManager = require('../../multiParamManager') -function runTab (appAPI = {}, appEvents = {}, opts = {}) { +function runTab (localRegistry) { /* ------------------------- VARIABLES --------------------------- */ var self = this var event = new EventManager() - appEvents.eventManager = event self._view = {} self.data = { count: 0, @@ -33,7 +33,18 @@ function runTab (appAPI = {}, appEvents = {}, opts = {}) { another environment. e.g Transactions created in Javascript VM can be replayed in the Injected Web3.` } - + self._components = {} + self._components.registry = localRegistry || globlalRegistry + // dependencies + self._deps = { + compiler: self._components.registry.get('compiler').api, + udapp: self._components.registry.get('udapp').api, + udappUI: self._components.registry.get('udappUI').api, + config: self._components.registry.get('config').api, + fileManager: self._components.registry.get('filemanager').api, + editorPanel: self._components.registry.get('editorpanel').api, + editor: self._components.registry.get('editor').api + } self._view.recorderCount = yo`0` self._view.instanceContainer = yo`
` self._view.clearInstanceElement = yo` @@ -52,7 +63,7 @@ function runTab (appAPI = {}, appEvents = {}, opts = {}) {
` var container = yo`
` - var recorderInterface = makeRecorder(appAPI, appEvents, opts, self) + var recorderInterface = makeRecorder(localRegistry, event, self) self._view.collapsedView = yo`
@@ -92,8 +103,8 @@ function runTab (appAPI = {}, appEvents = {}, opts = {}) { --------------------------- */ var el = yo`
- ${settings(container, appAPI, appEvents, opts)} - ${contractDropdown(event, appAPI, appEvents, opts, self)} + ${settings(container, self)} + ${contractDropdown(event, self)} ${recorderCard.render()} ${self._view.instanceContainer}
@@ -114,7 +125,7 @@ function runTab (appAPI = {}, appEvents = {}, opts = {}) { function setFinalContext () { // set the final context. Cause it is possible that this is not the one we've originaly selected selectExEnv.value = executionContext.getProvider() - fillAccountsList(appAPI, opts, el) + fillAccountsList(el, self) event.trigger('clearInstance', []) } @@ -141,9 +152,9 @@ function runTab (appAPI = {}, appEvents = {}, opts = {}) { setFinalContext() }) - fillAccountsList(appAPI, opts, el) + fillAccountsList(el, self) setInterval(() => { - updateAccountBalances(container, appAPI) + updateAccountBalances(container, self) }, 10000) event.register('clearInstance', () => { @@ -156,10 +167,10 @@ function runTab (appAPI = {}, appEvents = {}, opts = {}) { return { render () { return container } } } -function fillAccountsList (appAPI, opts, container) { +function fillAccountsList (container, self) { var $txOrigin = $(container.querySelector('#txorigin')) $txOrigin.empty() - opts.udapp.getAccounts((err, accounts) => { + self._deps.udapp.getAccounts((err, accounts) => { if (err) { addTooltip(`Cannot get account list: ${err}`) } if (accounts && accounts[0]) { for (var a in accounts) { $txOrigin.append($('
@@ -327,7 +340,7 @@ function contractDropdown (events, appAPI, appEvents, opts, self) { function setInputParamsPlaceHolder () { createPanel.innerHTML = '' - if (opts.compiler.getContract && selectContractNames.selectedIndex >= 0 && selectContractNames.children.length > 0) { + if (self._deps.compiler.getContract && selectContractNames.selectedIndex >= 0 && selectContractNames.children.length > 0) { var ctrabi = txHelper.getConstructorInterface(getSelectedContract().contract.object.abi) var ctrEVMbc = getSelectedContract().contract.object.evm.bytecode.object var createConstructorInstance = new MultiParamManager(0, ctrabi, (valArray, inputsValues) => { @@ -352,44 +365,44 @@ function contractDropdown (events, appAPI, appEvents, opts, self) { } var constructor = txHelper.getConstructorInterface(selectedContract.contract.object.abi) - txFormat.buildData(selectedContract.name, selectedContract.contract.object, opts.compiler.getContracts(), true, constructor, args, (error, data) => { + txFormat.buildData(selectedContract.name, selectedContract.contract.object, self._deps.compiler.getContracts(), true, constructor, args, (error, data) => { if (!error) { - appAPI.logMessage(`creation of ${selectedContract.name} pending...`) - opts.udapp.createContract(data, (error, txResult) => { + self._deps.editorPanel.logMessage(`creation of ${selectedContract.name} pending...`) + self._deps.udapp.createContract(data, (error, txResult) => { if (error) { - appAPI.logMessage(`creation of ${selectedContract.name} errored: ` + error) + self._deps.editorPanel.logMessage(`creation of ${selectedContract.name} errored: ` + error) } else { var isVM = executionContext.isVM() if (isVM) { var vmError = txExecution.checkVMError(txResult) if (vmError.error) { - appAPI.logMessage(vmError.message) + self._deps.editorPanel.logMessage(vmError.message) return } } if (txResult.result.status && txResult.result.status === '0x0') { - appAPI.logMessage(`creation of ${selectedContract.name} errored: transaction execution failed`) + self._deps.editorPanel.logMessage(`creation of ${selectedContract.name} errored: transaction execution failed`) return } var noInstancesText = self._view.noInstancesText if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) } var address = isVM ? txResult.result.createdAddress : txResult.result.contractAddress - instanceContainer.appendChild(opts.udappUI.renderInstance(selectedContract.contract.object, address, selectContractNames.value)) + instanceContainer.appendChild(self._deps.udappUI.renderInstance(selectedContract.contract.object, address, selectContractNames.value)) } }) } else { - appAPI.logMessage(`creation of ${selectedContract.name} errored: ` + error) + self._deps.editorPanel.logMessage(`creation of ${selectedContract.name} errored: ` + error) } }, (msg) => { - appAPI.logMessage(msg) + self._deps.editorPanel.logMessage(msg) }, (data, runTxCallback) => { // called for libraries deployment - opts.udapp.runTx(data, runTxCallback) + self._deps.udapp.runTx(data, runTxCallback) }) } // ACCESS DEPLOYED INSTANCE - function loadFromAddress (editor, config) { + function loadFromAddress () { var noInstancesText = self._view.noInstancesText if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) } var contractNames = document.querySelector(`.${css.contractNames.classNames[0]}`) @@ -400,19 +413,19 @@ function contractDropdown (events, appAPI, appEvents, opts, self) { if (/[a-f]/.test(address) && /[A-F]/.test(address) && !ethJSUtil.isValidChecksumAddress(address)) { return modalDialogCustom.alert('Invalid checksum address.') } - if (/.(.abi)$/.exec(config.get('currentFile'))) { + if (/.(.abi)$/.exec(self._deps.config.get('currentFile'))) { modalDialogCustom.confirm(null, 'Do you really want to interact with ' + address + ' using the current ABI definition ?', () => { var abi try { - abi = JSON.parse(editor.currentContent()) + abi = JSON.parse(self._deps.editor.currentContent()) } catch (e) { return modalDialogCustom.alert('Failed to parse the current file as JSON ABI.') } - instanceContainer.appendChild(opts.udappUI.renderInstanceFromABI(abi, address, address)) + instanceContainer.appendChild(self._deps.udappUI.renderInstanceFromABI(abi, address, address)) }) } else { - var contract = opts.compiler.getContract(contractNames.children[contractNames.selectedIndex].innerHTML) - instanceContainer.appendChild(opts.udappUI.renderInstance(contract.object, address, selectContractNames.value)) + var contract = self._deps.compiler.getContract(contractNames.children[contractNames.selectedIndex].innerHTML) + instanceContainer.appendChild(self._deps.udappUI.renderInstance(contract.object, address, selectContractNames.value)) } } @@ -422,7 +435,7 @@ function contractDropdown (events, appAPI, appEvents, opts, self) { contractNames.innerHTML = '' if (success) { selectContractNames.removeAttribute('disabled') - opts.compiler.visitContracts((contract) => { + self._deps.compiler.visitContracts((contract) => { contractNames.appendChild(yo``) }) } else { @@ -436,7 +449,7 @@ function contractDropdown (events, appAPI, appEvents, opts, self) { /* ------------------------------------------------ section SETTINGS: Environment, Account, Gas, Value ------------------------------------------------ */ -function settings (container, appAPI, appEvents, opts) { +function settings (container, self) { // VARIABLES var net = yo`` const updateNetwork = () => { @@ -511,15 +524,15 @@ function settings (container, appAPI, appEvents, opts) {
` // HELPER FUNCTIONS AND EVENTS - appEvents.udapp.register('transactionExecuted', (error, from, to, data, lookupOnly, txResult) => { + self._deps.udapp.event.register('transactionExecuted', (error, from, to, data, lookupOnly, txResult) => { if (error) return if (!lookupOnly) el.querySelector('#value').value = '0' - updateAccountBalances(container, appAPI) + updateAccountBalances(container, self) }) setInterval(updateNetwork, 5000) function newAccount () { - appAPI.newAccount('', (error, address) => { + self._deps.udapp.newAccount('', (error, address) => { if (!error) { container.querySelector('#txorigin').appendChild(yo``) addTooltip(`account ${address} created`) diff --git a/src/app/tabs/settings-tab.js b/src/app/tabs/settings-tab.js index 1007a4d08a..6a8190585c 100644 --- a/src/app/tabs/settings-tab.js +++ b/src/app/tabs/settings-tab.js @@ -3,6 +3,8 @@ var yo = require('yo-yo') var csjs = require('csjs-inject') var minixhr = require('minixhr') var remixLib = require('remix-lib') + +var globalRegistry = require('../../global/registry') var QueryParams = require('../../lib/query-params') var helper = require('../../lib/helper') var modal = require('../ui/modal-dialog-custom') @@ -15,12 +17,20 @@ var Storage = remixLib.Storage var EventManager = remixLib.EventManager module.exports = class SettingsTab { - constructor (api = {}, events = {}, opts = {}) { + constructor (localRegistry) { const self = this - self._opts = opts - self._api = api - self._events = events self._components = {} + self._components.registry = localRegistry || globalRegistry + // dependencies + self._deps = { + compiler: self._components.registry.get('compiler').api, + udapp: self._components.registry.get('udapp').api, + udappUI: self._components.registry.get('udappUI').api, + config: self._components.registry.get('config').api, + fileManager: self._components.registry.get('filemanager').api, + editorPanel: self._components.registry.get('editorpanel').api, + editor: self._components.registry.get('editor').api + } self._view = { /* eslint-disable */ el: null, optionVM: null, personal: null, optimize: null, warnPersonalMode: null, @@ -41,9 +51,11 @@ module.exports = class SettingsTab { self._components.themeStorage = new Storage('style:') self.data.optimize = !!self._components.queryParams.get().optimize self._components.queryParams.update({ optimize: self.data.optimize }) - self._api.setOptimize(self.data.optimize, false) + self._deps.compiler.setOptimize(self.data.optimize) self.data.currentTheme = self._components.themeStorage.get('theme') || 'light' - self._events.compiler.register('compilerLoaded', (version) => self.setVersionText(version)) + + var compilerEvent = self._components.registry.get('compiler').event + compilerEvent.register('compilerLoaded', (version) => self.setVersionText(version)) self.fetchAllVersion((allversions, selectedVersion) => { self.data.allversions = allversions self.data.selectedVersion = selectedVersion @@ -56,16 +68,16 @@ module.exports = class SettingsTab { // Gist settings var gistAccessToken = yo`` - var token = self._opts.config.get('settings/gist-access-token') + var token = self._deps.config.get('settings/gist-access-token') if (token) gistAccessToken.value = token - var gistAddToken = yo` { self._opts.config.set('settings/gist-access-token', gistAccessToken.value); tooltip('Access token saved') }} value="Save" type="button">` - var gistRemoveToken = yo` { gistAccessToken.value = ''; self._opts.config.set('settings/gist-access-token', ''); tooltip('Access token removed') }} value="Remove" type="button">` - self._view.gistToken = yo`
${gistAccessToken}${copyToClipboard(() => self._opts.config.get('settings/gist-access-token'))}${gistAddToken}${gistRemoveToken}
` + var gistAddToken = yo` { self._deps.config.set('settings/gist-access-token', gistAccessToken.value); tooltip('Access token saved') }} value="Save" type="button">` + var gistRemoveToken = yo` { gistAccessToken.value = ''; self._deps.config.set('settings/gist-access-token', ''); tooltip('Access token removed') }} value="Remove" type="button">` + self._view.gistToken = yo`
${gistAccessToken}${copyToClipboard(() => self._deps.config.get('settings/gist-access-token'))}${gistAddToken}${gistRemoveToken}
` // self._view.optionVM = yo`` - if (self._opts.config.get('settings/always-use-vm')) self._view.optionVM.setAttribute('checked', '') + if (self._deps.config.get('settings/always-use-vm')) self._view.optionVM.setAttribute('checked', '') self._view.personal = yo`` - if (self._opts.config.get('settings/personal-mode')) self._view.personal.setAttribute('checked', '') + if (self._deps.config.get('settings/personal-mode')) self._view.personal.setAttribute('checked', '') self._view.optimize = yo`` if (self.data.optimize) self._view.optimize.setAttribute('checked', '') var warnText = `Transaction sent over Web3 will use the web3.personal API - be sure the endpoint is opened before enabling it. @@ -187,7 +199,7 @@ module.exports = class SettingsTab { ${self._view.config.localremixd}
` function onchangeOption (event) { - self._opts.config.set('settings/always-use-vm', !self._opts.config.get('settings/always-use-vm')) + self._deps.config.set('settings/always-use-vm', !self._deps.config.get('settings/always-use-vm')) } function onloadPlugin (event) { try { @@ -209,14 +221,15 @@ module.exports = class SettingsTab { function onchangeOptimize (event) { self.data.optimize = !!self._view.optimize.checked self._components.queryParams.update({ optimize: self.data.optimize }) - self._api.setOptimize(self.data.optimize, true) + self._deps.compiler.setOptimize(self.data.optimize) + self._deps.app.runCompiler() } function onchangeLoadVersion (event) { self.data.selectedVersion = self._view.versionSelector.value self._updateVersionSelector() } function onchangePersonal (event) { - self._opts.config.set('settings/personal-mode', !self._opts.config.get('settings/personal-mode')) + self._deps.config.set('settings/personal-mode', !self._deps.config.get('settings/personal-mode')) } return self._view.el } @@ -250,10 +263,10 @@ module.exports = class SettingsTab { // Workers cannot load js on "file:"-URLs and we get a // "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium, // resort to non-worker version in that case. - self._opts.compiler.loadVersion(true, url) + self._deps.compiler.loadVersion(true, url) self.setVersionText('(loading using worker)') } else { - self._opts.compiler.loadVersion(false, url) + self._deps.compiler.loadVersion(false, url) self.setVersionText('(loading)') } } diff --git a/src/app/tabs/support-tab.js b/src/app/tabs/support-tab.js index 2f2b651740..85482c533d 100644 --- a/src/app/tabs/support-tab.js +++ b/src/app/tabs/support-tab.js @@ -2,21 +2,22 @@ const yo = require('yo-yo') const csjs = require('csjs-inject') const remixLib = require('remix-lib') +var globalRegistry = require('../../global/registry') const styles = require('../ui/styles-guide/theme-chooser').chooser() const EventManager = remixLib.EventManager module.exports = class SupportTab { - constructor (api = {}, events = {}, opts = {}) { + constructor (localRegistry) { const self = this self.event = new EventManager() - self._api = api - self._events = events - self._opts = opts self._view = { el: null, gitterIframe: '' } self.data = { gitterIsLoaded: false } self._components = {} - self._events.app.register('tabChanged', (tabName) => { + self._components.registry = localRegistry || globalRegistry + + var appEvent = self._components.registry.get('app').event + appEvent.register('tabChanged', (tabName) => { if (tabName !== 'Support' || self.data.gitterIsLoaded) return const iframe = yo` +
` return self._view.el } diff --git a/src/app/tabs/tabbed-menu.js b/src/app/tabs/tabbed-menu.js index bfb3b6b102..ca9f39de28 100644 --- a/src/app/tabs/tabbed-menu.js +++ b/src/app/tabs/tabbed-menu.js @@ -46,13 +46,24 @@ module.exports = class TabbedMenu { if (self._view.el) self._view.el.appendChild(self._view.tabs[title]) if (self._view.viewport) self._view.viewport.appendChild(self._view.contents[title]) } + getTabByClass (tabClass) { + const self = this + return self._view.el.querySelector(`li.${tabClass}`) + } + updateTabTitle (tabClass, title) { + const self = this + var tab = self.getTabByClass(tabClass) + if (tab) tab.innerHTML = title + } selectTabByTitle (title) { const self = this self.selectTab(self._view.tabs[title]) } selectTabByClassName (tabClass) { const self = this - self.selectTab(self._view.el.querySelector(`li.${tabClass}`)) + var tab = self.getTabByClass(tabClass) + if (tab) self.selectTab(tab) + return tab } selectTab (el) { const self = this diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 48b9fc2829..5cd70814d7 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -80,6 +80,12 @@ UniversalDApp.prototype.resetAPI = function (transactionContextAPI) { this.transactionContextAPI = transactionContextAPI } +UniversalDApp.prototype.createVMAccount = function (privateKey, balance, cb) { + this._addAccount(privateKey, balance) + privateKey = new Buffer(privateKey, 'hex') + cb(null, '0x' + ethJSUtil.privateToAddress(privateKey).toString('hex')) +} + UniversalDApp.prototype.newAccount = function (password, cb) { if (!executionContext.isVM()) { if (!this._deps.config.get('settings/personal-mode')) { @@ -282,6 +288,23 @@ UniversalDApp.prototype.getInputs = function (funABI) { return txHelper.inputParametersDeclarationToString(funABI.inputs) } +/** + * This function send a tx without alerting the user (if mainnet or if gas estimation too high). + * SHOULD BE TAKEN CAREFULLY! + * + * @param {Object} tx - transaction. + * @param {Function} callback - callback. + */ +UniversalDApp.prototype.silentRunTx = function (tx, cb) { + if (!executionContext.isVM()) return cb('Cannot silently send transaction through a web3 provider') + this.txRunner.rawRun( + tx, + (network, tx, gasEstimation, continueTxExecution, cancelCb) => { continueTxExecution() }, + (error, continueTxExecution, cancelCb) => { if (error) { cb(error) } else { continueTxExecution() } }, + (okCb, cancelCb) => { okCb() }, + cb) +} + UniversalDApp.prototype.runTx = function (args, cb) { const self = this async.waterfall([ diff --git a/test-browser/plugin/remix.js b/test-browser/plugin/remix.js index b9984ea646..fe16c56cb6 100644 --- a/test-browser/plugin/remix.js +++ b/test-browser/plugin/remix.js @@ -1,4 +1,17 @@ +/* +test contract creation +*/ +var addrResolverByteCode = '0x6060604052341561000f57600080fd5b33600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061033c8061005f6000396000f300606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806338cc483114610067578063767800de146100bc578063a6f9dae114610111578063d1d80fdf1461014a575b600080fd5b341561007257600080fd5b61007a610183565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156100c757600080fd5b6100cf6101ac565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561011c57600080fd5b610148600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506101d1565b005b341561015557600080fd5b610181600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610271565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561022d57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156102cd57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a723058201b23355f578cb9a23c0a43a440ab2631b62df7be0a8e759812a70f01344224da0029' + +const addrResolverTx = { + gasLimit: '0x2710', + from: '0xca35b7d915458ef540ade6068dfe2f44e8fa733c', + data: addrResolverByteCode, + value: '0x00', + useCall: false +} + function receiveMessage (event) { console.log('receiveMessage', event.data, event.source, event.origin) document.getElementById('compilationdata').innerHTML += event.data + '
' @@ -35,4 +48,34 @@ window.onload = function () { id: 36 }), '*') }) -} + + document.querySelector('input#testcontractcreation').addEventListener('click', function () { + window.parent.postMessage(JSON.stringify({ + action: 'request', + key: 'udapp', + type: 'runTx', + value: [addrResolverTx], + id: 37 + }), '*') + }) + + document.querySelector('input#testaccountcreation').addEventListener('click', function () { + window.parent.postMessage(JSON.stringify({ + action: 'request', + key: 'udapp', + type: 'createVMAccount', + value: ['71975fbf7fe448e004ac7ae54cad0a383c3906055a75468714156a07385e96ce', '0x56BC75E2D63100000'], + id: 38 + }), '*') + }) + var k = 0 + document.querySelector('input#testchangetitle').addEventListener('click', function () { + window.parent.postMessage(JSON.stringify({ + action: 'request', + key: 'app', + type: 'updateTitle', + value: ['changed title ' + k++], + id: 39 + }), '*') + }) +} \ No newline at end of file From 5471a538a9f7e7df5a0efcb375e2d04ac6c5959a Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 2 Jul 2018 21:57:21 +0200 Subject: [PATCH 81/98] fix pluginmanager --- src/app/panels/righthand-panel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/panels/righthand-panel.js b/src/app/panels/righthand-panel.js index 35a78ddb16..77f389f278 100644 --- a/src/app/panels/righthand-panel.js +++ b/src/app/panels/righthand-panel.js @@ -77,7 +77,7 @@ module.exports = class RighthandPanel { var tab = new PluginTab(json) var content = tab.render() self._components.tabbedMenu.addTab(json.title, json.title + ' plugin', content) - self.pluginManager.register(json, content) + self._components.pluginManager.register(json, content) } self._view.dragbar = yo`
` From 4c035d01486f100b4268bc5cb4490cf8f04f665e Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 2 Jul 2018 21:57:32 +0200 Subject: [PATCH 82/98] fix offsetToLineColumn --- src/app/debugger/debugger.js | 6 +++--- src/app/editor/contextView.js | 2 +- src/app/editor/contextualListener.js | 2 +- src/app/staticanalysis/staticAnalysisView.js | 5 ++++- src/lib/offsetToLineColumnConverter.js | 6 +++--- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/app/debugger/debugger.js b/src/app/debugger/debugger.js index 57a9ebaeed..8d3e39a764 100644 --- a/src/app/debugger/debugger.js +++ b/src/app/debugger/debugger.js @@ -36,7 +36,7 @@ function Debugger (id, sourceHighlighter, localRegistry) { this.isActive = false this.breakPointManager = new remixCore.code.BreakpointManager(this.debugger, (sourceLocation) => { - return self._deps.offsetToLineColumnConverter.offsetToLineColumn(sourceLocation, sourceLocation.file, this._deps.compiler.lastCompilationResult.data) + return self._deps.offsetToLineColumnConverter.offsetToLineColumn(sourceLocation, sourceLocation.file, this._deps.compiler.lastCompilationResult.source.sources) }) this.debugger.setBreakpointManager(this.breakPointManager) @@ -74,8 +74,8 @@ function Debugger (id, sourceHighlighter, localRegistry) { this.debugger.codeManager.event.register('changed', this, function (code, address, index) { if (self._deps.compiler.lastCompilationResult) { self.debugger.callTree.sourceLocationTracker.getSourceLocationFromInstructionIndex(address, index, self._deps.compiler.lastCompilationResult.data.contracts, function (error, rawLocation) { - if (!error) { - var lineColumnPos = self._deps.offsetToLineColumnConverter.offsetToLineColumn(rawLocation, rawLocation.file, self._deps.compiler.lastCompilationResult) + if (!error && self._deps.compiler.lastCompilationResult && self._deps.compiler.lastCompilationResult.data) { + var lineColumnPos = self._deps.offsetToLineColumnConverter.offsetToLineColumn(rawLocation, rawLocation.file, self._deps.compiler.lastCompilationResult.source.sources) self._components.sourceHighlighter.currentSourceLocation(lineColumnPos, rawLocation) } else { self._components.sourceHighlighter.currentSourceLocation(null) diff --git a/src/app/editor/contextView.js b/src/app/editor/contextView.js index c9200ed0b8..e4781f6b68 100644 --- a/src/app/editor/contextView.js +++ b/src/app/editor/contextView.js @@ -98,7 +98,7 @@ class ContextView { } } if (self._deps.compiler.lastCompilationResult && self._deps.compiler.lastCompilationResult.data) { - var lineColumn = self._deps.offsetToLineColumnConverter.offsetToLineColumn(position, position.file, self._deps.compiler.lastCompilationResult) + var lineColumn = self._deps.offsetToLineColumnConverter.offsetToLineColumn(position, position.file, self._deps.compiler.lastCompilationResult.source.sources) var filename = self._deps.compiler.getSourceName(position.file) // TODO: refactor with rendererAPI.errorClick if (filename !== self._deps.config.get('currentFile')) { diff --git a/src/app/editor/contextualListener.js b/src/app/editor/contextualListener.js index 103b0349d8..d55965fd49 100644 --- a/src/app/editor/contextualListener.js +++ b/src/app/editor/contextualListener.js @@ -114,7 +114,7 @@ class ContextualListener { _highlightInternal (position, node) { var self = this if (self._deps.compiler.lastCompilationResult && self._deps.compiler.lastCompilationResult.data) { - var lineColumn = self._deps.offsetToLineColumnConverter.offsetToLineColumn(position, position.file, self._deps.compiler.lastCompilationResult) + var lineColumn = self._deps.offsetToLineColumnConverter.offsetToLineColumn(position, position.file, self._deps.compiler.lastCompilationResult.source.sources) var css = 'highlightreference' if (node.children && node.children.length) { // If node has children, highlight the entire line. if not, just highlight the current source position of the node. diff --git a/src/app/staticanalysis/staticAnalysisView.js b/src/app/staticanalysis/staticAnalysisView.js index fb50a95080..ae68a79e73 100644 --- a/src/app/staticanalysis/staticAnalysisView.js +++ b/src/app/staticanalysis/staticAnalysisView.js @@ -20,6 +20,7 @@ function staticAnalysisView (localRegistry) { this.runner = new StaticAnalysisRunner() this.modulesView = renderModules(this.runner.modules()) this.lastCompilationResult = null + this.lastCompilationSource = null self._components = {} self._components.registry = localRegistry || globlalRegistry // dependencies @@ -31,9 +32,11 @@ function staticAnalysisView (localRegistry) { self._deps.compiler.event.register('compilationFinished', function (success, data, source) { self.lastCompilationResult = null + self.lastCompilationSource = null $('#staticanalysisresult').empty() if (success) { self.lastCompilationResult = data + self.lastCompilationSource = source if (self.view.querySelector('#autorunstaticanalysis').checked) { self.run() } @@ -94,7 +97,7 @@ staticAnalysisView.prototype.run = function () { start: parseInt(split[0]), length: parseInt(split[1]) } - location = self._deps.offsetToLineColumnConverter.offsetToLineColumn(location, file) + location = self._deps.offsetToLineColumnConverter.offsetToLineColumn(location, file, self.lastCompilationSource.sources) location = Object.keys(self.lastCompilationResult.contracts)[file] + ':' + (location.start.line + 1) + ':' + (location.start.column + 1) + ':' } warningCount++ diff --git a/src/lib/offsetToLineColumnConverter.js b/src/lib/offsetToLineColumnConverter.js index f31fa68977..2a73dfbe6f 100644 --- a/src/lib/offsetToLineColumnConverter.js +++ b/src/lib/offsetToLineColumnConverter.js @@ -10,10 +10,10 @@ function offsetToColumnConverter (compilerEvent) { }) } -offsetToColumnConverter.prototype.offsetToLineColumn = function (rawLocation, file, compilationResult) { +offsetToColumnConverter.prototype.offsetToLineColumn = function (rawLocation, file, sources) { if (!this.lineBreakPositionsByContent[file]) { - var filename = Object.keys(compilationResult.data.sources)[file] - this.lineBreakPositionsByContent[file] = this.sourceMappingDecoder.getLinebreakPositions(compilationResult.source.sources[filename].content) + var filename = Object.keys(sources)[file] + this.lineBreakPositionsByContent[file] = this.sourceMappingDecoder.getLinebreakPositions(sources[filename].content) } return this.sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, this.lineBreakPositionsByContent[file]) } From bb6dbcd8b3c752301876fd7c806625c0f4449461 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 2 Jul 2018 21:58:02 +0200 Subject: [PATCH 83/98] standard --- src/app/plugin/pluginAPI.js | 2 +- src/app/plugin/pluginManager.js | 2 +- test-browser/plugin/remix.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/plugin/pluginAPI.js b/src/app/plugin/pluginAPI.js index 0036e8b873..ebd9b694e4 100644 --- a/src/app/plugin/pluginAPI.js +++ b/src/app/plugin/pluginAPI.js @@ -59,4 +59,4 @@ module.exports = (fileProviders, compiler, udapp, tabbedMenu) => { } } } -} \ No newline at end of file +} diff --git a/src/app/plugin/pluginManager.js b/src/app/plugin/pluginManager.js index 88c94df0dc..5492581284 100644 --- a/src/app/plugin/pluginManager.js +++ b/src/app/plugin/pluginManager.js @@ -182,4 +182,4 @@ module.exports = class PluginManager { self.plugins[name].content.querySelector('iframe').contentWindow.postMessage(value, self.plugins[name].origin) } } -} \ No newline at end of file +} diff --git a/test-browser/plugin/remix.js b/test-browser/plugin/remix.js index fe16c56cb6..415f678711 100644 --- a/test-browser/plugin/remix.js +++ b/test-browser/plugin/remix.js @@ -78,4 +78,4 @@ window.onload = function () { id: 39 }), '*') }) -} \ No newline at end of file +} From 988283880d6528d05e1054c04d75d03cc9774698 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 2 Jul 2018 22:49:47 +0200 Subject: [PATCH 84/98] load oraclize plugin --- src/app/panels/righthand-panel.js | 23 +++++++++++++++++++---- src/app/plugin/pluginManager.js | 5 +++++ src/app/plugin/plugins.js | 8 ++++++++ src/app/tabs/settings-tab.js | 14 ++++++++++---- src/app/tabs/tabbed-menu.js | 11 +++++++++++ 5 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 src/app/plugin/plugins.js diff --git a/src/app/panels/righthand-panel.js b/src/app/panels/righthand-panel.js index 77f389f278..aca26f259b 100644 --- a/src/app/panels/righthand-panel.js +++ b/src/app/panels/righthand-panel.js @@ -16,7 +16,9 @@ const PluginTab = require('../tabs/plugin-tab') const TestTab = require('../tabs/test-tab') const RunTab = require('../tabs/run-tab') const PluginAPI = require('../plugin/pluginAPI') +const plugins = require('../plugin/plugins') +var toolTip = require('../ui/tooltip') const EventManager = remixLib.EventManager const styles = styleguide.chooser() @@ -73,11 +75,24 @@ module.exports = class RighthandPanel { self.loadPlugin(json) }) + self.event.register('plugin-name-loadRequest', name => { + if (plugins[name]) { + self.loadPlugin(plugins[name]) + } else { + toolTip('unknown plugin ' + name) + } + }) + self.loadPlugin = function (json) { - var tab = new PluginTab(json) - var content = tab.render() - self._components.tabbedMenu.addTab(json.title, json.title + ' plugin', content) - self._components.pluginManager.register(json, content) + if (self._components.pluginManager.plugins[json.title]) { + self._components.tabbedMenu.removeTabByTitle(json.title) + self._components.pluginManager.unregister(json) + } else { + var tab = new PluginTab(json) + var content = tab.render() + self._components.tabbedMenu.addTab(json.title, json.title + ' plugin', content) + self._components.pluginManager.register(json, content) + } } self._view.dragbar = yo`
` diff --git a/src/app/plugin/pluginManager.js b/src/app/plugin/pluginManager.js index 5492581284..0ea91f1781 100644 --- a/src/app/plugin/pluginManager.js +++ b/src/app/plugin/pluginManager.js @@ -161,6 +161,11 @@ module.exports = class PluginManager { // } }, false) } + unregister (desc) { + const self = this + delete self.plugins[desc.title] + delete self.origins[desc.url] + } register (desc, content) { const self = this self.plugins[desc.title] = {content, origin: desc.url} diff --git a/src/app/plugin/plugins.js b/src/app/plugin/plugins.js new file mode 100644 index 0000000000..68cdb2e31e --- /dev/null +++ b/src/app/plugin/plugins.js @@ -0,0 +1,8 @@ +'use strict' + +module.exports = { + 'oraclize': { + url: 'https://remix-plugin.oraclize.it', + title: 'Oraclize' + } +} diff --git a/src/app/tabs/settings-tab.js b/src/app/tabs/settings-tab.js index ba2d3b0fd5..6b406f86ed 100644 --- a/src/app/tabs/settings-tab.js +++ b/src/app/tabs/settings-tab.js @@ -26,7 +26,8 @@ module.exports = class SettingsTab { compiler: self._components.registry.get('compiler').api, config: self._components.registry.get('config').api, editorPanel: self._components.registry.get('editorpanel').api, - editor: self._components.registry.get('editor').api + editor: self._components.registry.get('editor').api, + righthandpanel: self._components.registry.get('righthandpanel').api } self._view = { /* eslint-disable */ el: null, @@ -155,8 +156,9 @@ module.exports = class SettingsTab {
${self._view.pluginInput} - +
+ { onLoadPlugin('oraclize') }} type="button" value="Oraclize" class="${css.pluginLoad}"> ` self._view.config.remixd = yo` @@ -197,14 +199,18 @@ module.exports = class SettingsTab { function onchangeOption (event) { self._deps.config.set('settings/always-use-vm', !self._deps.config.get('settings/always-use-vm')) } - function onloadPlugin (event) { + function onLoadPlugin (name) { + // @TODO: BAD! REFACTOR: no module should trigger events of another modules emitter + self._deps.righthandpanel.event.trigger('plugin-name-loadRequest', [name]) + } + function onloadPluginJson (event) { try { var json = JSON.parse(self._view.pluginInput.value) } catch (e) { return modal.alert('cannot parse the plugin definition to JSON') } // @TODO: BAD! REFACTOR: no module should trigger events of another modules emitter - self._events.rhp.trigger('plugin-loadRequest', [json]) + self._deps.righthandpanel.event.trigger('plugin-loadRequest', [json]) } function onswitch2darkTheme (event) { styleGuide.switchTheme('dark') diff --git a/src/app/tabs/tabbed-menu.js b/src/app/tabs/tabbed-menu.js index ca9f39de28..69a1b2aa5b 100644 --- a/src/app/tabs/tabbed-menu.js +++ b/src/app/tabs/tabbed-menu.js @@ -46,6 +46,17 @@ module.exports = class TabbedMenu { if (self._view.el) self._view.el.appendChild(self._view.tabs[title]) if (self._view.viewport) self._view.viewport.appendChild(self._view.contents[title]) } + removeTabByTitle (title) { + const self = this + if (self._view.tabs[title]) { + self._view.tabs[title].parentNode.removeChild(self._view.tabs[title]) + } + if (self._view.contents[title]) { + self._view.contents[title].parentNode.removeChild(self._view.contents[title]) + } + delete self._view.contents[title] + delete self._view.tabs[title] + } getTabByClass (tabClass) { const self = this return self._view.el.querySelector(`li.${tabClass}`) From ccdcabc626da85b46fb424ddf9f6498b5c3bd3d4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 4 Jul 2018 15:18:35 +0200 Subject: [PATCH 85/98] remove bad rebasing token --- src/app/panels/terminal.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/app/panels/terminal.js b/src/app/panels/terminal.js index 1c794be37a..25b2c01c74 100644 --- a/src/app/panels/terminal.js +++ b/src/app/panels/terminal.js @@ -579,13 +579,5 @@ function domTerminalFeatures (self, scopedCommands) { } function blockify (el) { return yo`
${el}
` } -<<<<<<< HEAD -======= -// PENDING TX -function updatePendingTxs (udapp, el) { - var count = Object.keys(udapp.pendingTransactions()).length - el.innerText = count -} ->>>>>>> fix terminal api module.exports = Terminal From d7640e451eb716689c45eb31dbd51adb4dc8033e Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 4 Jul 2018 15:25:35 +0200 Subject: [PATCH 86/98] fix bad reference --- src/app/panels/terminal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/panels/terminal.js b/src/app/panels/terminal.js index 25b2c01c74..5dfc88600b 100644 --- a/src/app/panels/terminal.js +++ b/src/app/panels/terminal.js @@ -74,7 +74,7 @@ class Terminal { self.registerCommand('script', function execute (args, scopedCommands, append) { var script = String(args[0]) scopedCommands.log(`> ${script}`) - if (self._opts.cmdInterpreter && self.opts.cmdInterpreter.interpret(script)) return + if (self._opts.cmdInterpreter && self._opts.cmdInterpreter.interpret(script)) return self._shell(script, scopedCommands, function (error, output) { if (error) scopedCommands.error(error) else scopedCommands.log(output) From aadf49fedae4be7e0fab380289b2d360cd5ab74b Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 4 Jul 2018 16:01:06 +0200 Subject: [PATCH 87/98] move event instanciation at the start --- src/app.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app.js b/src/app.js index 6186455d3c..f8fde59167 100644 --- a/src/app.js +++ b/src/app.js @@ -113,6 +113,7 @@ var css = csjs` class App { constructor (api = {}, events = {}, opts = {}) { var self = this + this.event = new EventManager() self._components = {} registry.put({api: self, name: 'app'}) @@ -465,8 +466,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org } }, false) - this.event = new EventManager() - // Replace early callback with instant response loadFilesCallback = function (files) { self.loadFiles(files) From c5c9618f5fdb44098cac588f67ef22970b277c81 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 4 Jul 2018 16:03:16 +0200 Subject: [PATCH 88/98] remove compiler local var --- src/app.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app.js b/src/app.js index f8fde59167..e0cba406b7 100644 --- a/src/app.js +++ b/src/app.js @@ -389,10 +389,9 @@ Please make a backup of your contracts and start using http://remix.ethereum.org // ----------------- Compiler ----------------- self._components.compiler = new Compiler((url, cb) => self.importFileCb(url, cb)) - var compiler = self._components.compiler - registry.put({api: compiler, name: 'compiler'}) + registry.put({api: self._components.compiler, name: 'compiler'}) - var offsetToLineColumnConverter = new OffsetToLineColumnConverter(compiler.event) + var offsetToLineColumnConverter = new OffsetToLineColumnConverter(self._components.compiler.event) registry.put({api: offsetToLineColumnConverter, name: 'offsettolinecolumnconverter'}) // ----------------- UniversalDApp ----------------- @@ -409,8 +408,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org var transactionReceiptResolver = new TransactionReceiptResolver() var compiledContracts = function () { - if (compiler.lastCompilationResult && compiler.lastCompilationResult.data) { - return compiler.lastCompilationResult.data.contracts + if (self._components.compiler.lastCompilationResult && self._components.compiler.lastCompilationResult.data) { + return self._components.compiler.lastCompilationResult.data.contracts } return null } @@ -551,7 +550,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org var queryParams = new QueryParams() // check init query parameters from the URL once the compiler is loaded - compiler.event.register('compilerLoaded', this, function (version) { + self._components.compiler.event.register('compilerLoaded', this, function (version) { previousInput = '' self.runCompiler() From ddda6ca644402934f587a6b4c0a389c677c17a52 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 4 Jul 2018 16:04:24 +0200 Subject: [PATCH 89/98] remove unneeded local var --- src/app.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/app.js b/src/app.js index e0cba406b7..394f7f3b5f 100644 --- a/src/app.js +++ b/src/app.js @@ -407,15 +407,14 @@ Please make a backup of your contracts and start using http://remix.ethereum.org // ----------------- Tx listener ----------------- var transactionReceiptResolver = new TransactionReceiptResolver() - var compiledContracts = function () { - if (self._components.compiler.lastCompilationResult && self._components.compiler.lastCompilationResult.data) { - return self._components.compiler.lastCompilationResult.data.contracts - } - return null - } var txlistener = new Txlistener({ api: { - contracts: compiledContracts, + contracts: function () { + if (self._components.compiler.lastCompilationResult && self._components.compiler.lastCompilationResult.data) { + return self._components.compiler.lastCompilationResult.data.contracts + } + return null + }, resolveReceipt: function (tx, cb) { transactionReceiptResolver.resolve(tx, cb) } From 38050759c1f72fad48d48158ccf6340828186e21 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 4 Jul 2018 16:05:56 +0200 Subject: [PATCH 90/98] do not use unneeded local var --- src/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app.js b/src/app.js index 394f7f3b5f..7b5d78ec5b 100644 --- a/src/app.js +++ b/src/app.js @@ -475,9 +475,9 @@ Please make a backup of your contracts and start using http://remix.ethereum.org } // ---------------- FilePanel -------------------- - var filePanel = new FilePanel() - self._view.leftpanel.appendChild(filePanel.render()) - filePanel.event.register('resize', delta => self._adjustLayout('left', delta)) + self._components.filePanel = new FilePanel() + self._view.leftpanel.appendChild(self._components.filePanel.render()) + self._components.filePanel.event.register('resize', delta => self._adjustLayout('left', delta)) // ----------------- Renderer ----------------- var renderer = new Renderer() From 389e2eba594978ab3cd3029d54046e86f68cb1ec Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 4 Jul 2018 16:47:13 +0200 Subject: [PATCH 91/98] move static analysis to its own tab --- src/app.js | 8 -------- src/app/panels/righthand-panel.js | 8 ++++++-- src/app/tabs/analysis-tab.js | 14 +++++++++++++- src/app/tabs/compile-tab.js | 19 +++++++++---------- 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/app.js b/src/app.js index 7b5d78ec5b..a92e943933 100644 --- a/src/app.js +++ b/src/app.js @@ -28,7 +28,6 @@ var Renderer = require('./app/ui/renderer') var Compiler = require('remix-solidity').Compiler var executionContext = require('./execution-context') var Debugger = require('./app/debugger/debugger') -var StaticAnalysis = require('./app/staticanalysis/staticAnalysisView') var FilePanel = require('./app/panels/file-panel') var EditorPanel = require('./app/panels/editor-panel') var RighthandPanel = require('./app/panels/righthand-panel') @@ -483,19 +482,12 @@ Please make a backup of your contracts and start using http://remix.ethereum.org var renderer = new Renderer() registry.put({api: renderer, name: 'renderer'}) - // ----------------- StaticAnalysis ----------------- - var staticanalysis = new StaticAnalysis() - registry.put({api: staticanalysis, name: 'staticanalysis'}) - // ---------------- Righthand-panel -------------------- self._components.righthandpanel = new RighthandPanel() self._view.rightpanel.appendChild(self._components.righthandpanel.render()) self._components.righthandpanel.init() self._components.righthandpanel.event.register('resize', delta => self._adjustLayout('right', delta)) - var node = document.getElementById('staticanalysisView') - node.insertBefore(staticanalysis.render(), node.childNodes[0]) - // ----------------- Debugger ----------------- self._view.transactionDebugger = new Debugger('#debugger', new SourceHighlighter()) self._view.transactionDebugger.addProvider('vm', executionContext.vm()) diff --git a/src/app/panels/righthand-panel.js b/src/app/panels/righthand-panel.js index aca26f259b..acfa33e690 100644 --- a/src/app/panels/righthand-panel.js +++ b/src/app/panels/righthand-panel.js @@ -57,7 +57,11 @@ module.exports = class RighthandPanel { pluginAPI, self._deps.app, self._deps.compiler, - self._deps.txlistener) + self._deps.txlistener + ) + + var analysisTab = new AnalysisTab(self._components.registry) + analysisTab.event.register('newStaticAnaysisWarningMessage', (msg, settings) => { self._components.compile.addWarning(msg, settings) }) self._components = { pluginManager: pluginManager, @@ -65,7 +69,7 @@ module.exports = class RighthandPanel { compile: new CompileTab(self._components.registry), run: new RunTab(self._components.registry), settings: new SettingsTab(self._components.registry), - analysis: new AnalysisTab(self._components.registry), + analysis: analysisTab, debug: new DebuggerTab(self._components.registry), support: new SupportTab(self._components.registry), test: new TestTab(self._components.registry) diff --git a/src/app/tabs/analysis-tab.js b/src/app/tabs/analysis-tab.js index 16a7c06c04..b937d1ab87 100644 --- a/src/app/tabs/analysis-tab.js +++ b/src/app/tabs/analysis-tab.js @@ -1,6 +1,7 @@ var yo = require('yo-yo') var csjs = require('csjs-inject') var remixLib = require('remix-lib') +var StaticAnalysis = require('../staticanalysis/staticAnalysisView') var globalRegistry = require('../../global/registry') var EventManager = remixLib.EventManager @@ -13,12 +14,23 @@ module.exports = class AnalysisTab { self.data = {} self._components = {} self._components.registry = localRegistry || globalRegistry + self._deps = { + rightHandPanel: self._components.registry.get('righthandpanel').api + } } render () { const self = this + var staticanalysis = new StaticAnalysis() + staticanalysis.event.register('staticAnaysisWarning', (count) => { + const msg = `Static Analysis raised ${count} warning(s) that requires your attention. Click here to show the warning(s).` + const settings = { type: 'staticAnalysisWarning', click: () => self._deps.rightHandPanel.focusOn('staticanalysisView'), useSpan: true } + self.event.trigger('newStaticAnaysisWarningMessage', [msg, settings]) + }) + self._components.registry.put({api: staticanalysis, name: 'staticanalysis'}) if (self._view.el) return self._view.el self._view.el = yo` -
` +
${staticanalysis.render()}
` + return self._view.el } } diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index cf81c4baa4..62cc14778e 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -25,6 +25,7 @@ module.exports = class CompileTab { compileIcon: null, compileContainer: null, errorContainer: null, + errorContainerHead: null, contractNames: null, contractEl: null } @@ -36,9 +37,7 @@ module.exports = class CompileTab { editor: self._components.registry.get('editor').api, config: self._components.registry.get('config').api, compiler: self._components.registry.get('compiler').api, - staticAnalysis: self._components.registry.get('staticanalysis').api, - renderer: self._components.registry.get('renderer').api, - rightHandPanel: self._components.registry.get('righthandpanel').api + renderer: self._components.registry.get('renderer').api } self.data = { hideWarnings: self._deps.config.get('hideWarnings') || false, @@ -80,6 +79,7 @@ module.exports = class CompileTab { self._deps.compiler.event.register('compilationStarted', function start () { if (!self._view.compileIcon) return self._view.errorContainer.innerHTML = '' + self._view.errorContainerHead.innerHTML = '' self._view.compileIcon.classList.remove(`${css.bouncingIcon}`) self._view.compileIcon.classList.add(`${css.spinningIcon}`) self._view.compileIcon.setAttribute('title', 'compiling...') @@ -139,13 +139,10 @@ module.exports = class CompileTab { }) } }) - self._deps.staticAnalysis.event.register('staticAnaysisWarning', (count) => { - if (count) { - const msg = `Static Analysis raised ${count} warning(s) that requires your attention. Click here to show the warning(s).` - const settings = { type: 'staticAnalysisWarning', click: () => self._deps.rightHandPanel.focusOn('staticanalysisView'), useSpan: true } - self._deps.renderer.error(msg, self._view.errorContainer, settings) - } - }) + } + addWarning (msg, settings) { + const self = this + self._deps.renderer.error(msg, self._view.errorContainerHead, settings) } render () { const self = this @@ -173,6 +170,7 @@ module.exports = class CompileTab { ` self._view.errorContainer = yo`
` + self._view.errorContainerHead = yo`
` self._view.contractNames = yo`` self._view.contractEl = yo`
@@ -194,6 +192,7 @@ module.exports = class CompileTab {
${self._view.compileContainer} ${self._view.contractEl} + ${self._view.errorContainerHead} ${self._view.errorContainer}
` const help = { From e5dbc59a85a5a0c0334c66c3666b8433789914e5 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 4 Jul 2018 17:03:10 +0200 Subject: [PATCH 92/98] move debugger to its own tab --- src/app.js | 13 ++----------- src/app/debugger/debugger.js | 5 ++--- src/app/panels/righthand-panel.js | 8 +++++++- src/app/tabs/debugger-tab.js | 17 ++++++++++++++++- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/app.js b/src/app.js index a92e943933..603db78799 100644 --- a/src/app.js +++ b/src/app.js @@ -27,7 +27,6 @@ var Config = require('./config') var Renderer = require('./app/ui/renderer') var Compiler = require('remix-solidity').Compiler var executionContext = require('./execution-context') -var Debugger = require('./app/debugger/debugger') var FilePanel = require('./app/panels/file-panel') var EditorPanel = require('./app/panels/editor-panel') var RighthandPanel = require('./app/panels/righthand-panel') @@ -42,7 +41,6 @@ var BasicReadOnlyExplorer = require('./app/files/basicReadOnlyExplorer') var NotPersistedExplorer = require('./app/files/NotPersistedExplorer') var toolTip = require('./app/ui/tooltip') var TransactionReceiptResolver = require('./transactionReceiptResolver') -var SourceHighlighter = require('./app/editor/sourceHighlighter') var styleGuide = require('./app/ui/styles-guide/theme-chooser') var styles = styleGuide.chooser() @@ -230,7 +228,7 @@ class App { } runCompiler () { const self = this - if (self._view.transactionDebugger.isActive) return + if (self._components.righthandpanel.debugger().isActive) return self._components.fileManager.saveCurrentFile() self._components.editorpanel.getEditor().clearAnnotations() @@ -259,7 +257,7 @@ class App { startdebugging (txHash) { const self = this self.event.trigger('debuggingRequested', []) - self._view.transactionDebugger.debug(txHash) + self._components.righthandpanel.debugger().debug(txHash) } loadFromGist (params) { const self = this @@ -488,13 +486,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org self._components.righthandpanel.init() self._components.righthandpanel.event.register('resize', delta => self._adjustLayout('right', delta)) - // ----------------- Debugger ----------------- - self._view.transactionDebugger = new Debugger('#debugger', new SourceHighlighter()) - self._view.transactionDebugger.addProvider('vm', executionContext.vm()) - self._view.transactionDebugger.addProvider('injected', executionContext.internalWeb3()) - self._view.transactionDebugger.addProvider('web3', executionContext.internalWeb3()) - self._view.transactionDebugger.switchProvider(executionContext.getProvider()) - var txLogger = new TxLogger() // eslint-disable-line var previousInput = '' diff --git a/src/app/debugger/debugger.js b/src/app/debugger/debugger.js index 8d3e39a764..f0bcfd25c0 100644 --- a/src/app/debugger/debugger.js +++ b/src/app/debugger/debugger.js @@ -9,8 +9,7 @@ var globlalRegistry = require('../../global/registry') /** * Manage remix and source highlighting */ -function Debugger (id, sourceHighlighter, localRegistry) { - this.el = document.querySelector(id) +function Debugger (container, sourceHighlighter, localRegistry) { this._components = { sourceHighlighter: sourceHighlighter } @@ -32,7 +31,7 @@ function Debugger (id, sourceHighlighter, localRegistry) { } }) this.sourceMappingDecoder = new remixLib.SourceMappingDecoder() - this.el.appendChild(this.debugger.render()) + container.appendChild(this.debugger.render()) this.isActive = false this.breakPointManager = new remixCore.code.BreakpointManager(this.debugger, (sourceLocation) => { diff --git a/src/app/panels/righthand-panel.js b/src/app/panels/righthand-panel.js index acfa33e690..710b946369 100644 --- a/src/app/panels/righthand-panel.js +++ b/src/app/panels/righthand-panel.js @@ -62,6 +62,8 @@ module.exports = class RighthandPanel { var analysisTab = new AnalysisTab(self._components.registry) analysisTab.event.register('newStaticAnaysisWarningMessage', (msg, settings) => { self._components.compile.addWarning(msg, settings) }) + + self._components.debuggerTab = new DebuggerTab(self._components.registry) self._components = { pluginManager: pluginManager, @@ -70,7 +72,7 @@ module.exports = class RighthandPanel { run: new RunTab(self._components.registry), settings: new SettingsTab(self._components.registry), analysis: analysisTab, - debug: new DebuggerTab(self._components.registry), + debug: self._components.debuggerTab, support: new SupportTab(self._components.registry), test: new TestTab(self._components.registry) } @@ -130,6 +132,10 @@ module.exports = class RighthandPanel { return self._view.element } + debugger () { + return this._components.debug.debugger() + } + focusOn (x) { if (this._components.tabbedMenu) this._components.tabbedMenu.selectTabByClassName(x) } diff --git a/src/app/tabs/debugger-tab.js b/src/app/tabs/debugger-tab.js index ccf7abb35b..45b1ea193b 100644 --- a/src/app/tabs/debugger-tab.js +++ b/src/app/tabs/debugger-tab.js @@ -2,6 +2,11 @@ var yo = require('yo-yo') var csjs = require('csjs-inject') var remixLib = require('remix-lib') +var Debugger = require('../debugger/debugger') +var SourceHighlighter = require('../editor/sourceHighlighter') + +var executionContext = require('../../execution-context') + var globalRegistry = require('../../global/registry') var EventManager = remixLib.EventManager var styles = require('../ui/styles-guide/theme-chooser').chooser() @@ -18,12 +23,22 @@ module.exports = class DebuggerTab { render () { const self = this if (self._view.el) return self._view.el + self._view.el = yo` -
+
` + + self._view.transactionDebugger = new Debugger(self._view.el.querySelector('#debugger'), new SourceHighlighter()) + self._view.transactionDebugger.addProvider('vm', executionContext.vm()) + self._view.transactionDebugger.addProvider('injected', executionContext.internalWeb3()) + self._view.transactionDebugger.addProvider('web3', executionContext.internalWeb3()) + self._view.transactionDebugger.switchProvider(executionContext.getProvider()) return self._view.el } + debugger () { + return this._view.transactionDebugger + } } const css = csjs` .debuggerTabView { From dda9dba1a2d53b077c15fc12f9cae72f24ee8a3d Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 4 Jul 2018 17:03:25 +0200 Subject: [PATCH 93/98] standard --- src/app/panels/righthand-panel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/panels/righthand-panel.js b/src/app/panels/righthand-panel.js index 710b946369..00921dcffa 100644 --- a/src/app/panels/righthand-panel.js +++ b/src/app/panels/righthand-panel.js @@ -62,7 +62,7 @@ module.exports = class RighthandPanel { var analysisTab = new AnalysisTab(self._components.registry) analysisTab.event.register('newStaticAnaysisWarningMessage', (msg, settings) => { self._components.compile.addWarning(msg, settings) }) - + self._components.debuggerTab = new DebuggerTab(self._components.registry) self._components = { From e3a5fdcb28563d266bfec7cf442b54774af78d41 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 4 Jul 2018 17:20:58 +0200 Subject: [PATCH 94/98] move editorOnChange to editor --- src/app.js | 35 +---------------------------------- src/app/editor/editor.js | 39 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 35 deletions(-) diff --git a/src/app.js b/src/app.js index 603db78799..3a60350960 100644 --- a/src/app.js +++ b/src/app.js @@ -486,39 +486,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org self._components.righthandpanel.init() self._components.righthandpanel.event.register('resize', delta => self._adjustLayout('right', delta)) - var txLogger = new TxLogger() // eslint-disable-line - - var previousInput = '' - var saveTimeout = null - function editorOnChange () { - var currentFile = self._components.config.get('currentFile') - if (!currentFile) { - return - } - var input = editor.get(currentFile) - if (!input) { - return - } - // if there's no change, don't do anything - if (input === previousInput) { - return - } - previousInput = input - - // fire storage update - // NOTE: save at most once per 5 seconds - if (saveTimeout) { - window.clearTimeout(saveTimeout) - } - saveTimeout = window.setTimeout(() => { - fileManager.saveCurrentFile() - }, 5000) - } - - // auto save the file when content changed - editor.event.register('contentChanged', editorOnChange) - // save the file when switching - editor.event.register('sessionSwitched', editorOnChange) + var txLogger = new TxLogger() // eslint-disable-line executionContext.event.register('contextChanged', this, function (context) { self.runCompiler() @@ -533,7 +501,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org // check init query parameters from the URL once the compiler is loaded self._components.compiler.event.register('compilerLoaded', this, function (version) { - previousInput = '' self.runCompiler() if (queryParams.get().context) { diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index a67e5dd4de..931e03e47c 100644 --- a/src/app/editor/editor.js +++ b/src/app/editor/editor.js @@ -7,6 +7,8 @@ var ace = require('brace') require('brace/theme/tomorrow_night_blue') +var globalRegistry = require('../../global/registry') + var Range = ace.acequire('ace/range').Range require('brace/ext/language_tools') require('brace/ext/searchbox') @@ -63,13 +65,19 @@ document.head.appendChild(yo` `) -function Editor (opts = {}) { +function Editor (opts = {}, localRegistry) { var self = this var el = yo`
` var editor = ace.edit(el) if (styles.appProperties.aceTheme) { editor.setTheme('ace/theme/' + styles.appProperties.aceTheme) } + self._components = {} + self._components.registry = localRegistry || globalRegistry + self._deps = { + fileManager: self._components.registry.get('filemanager').api, + config: self._components.registry.get('config').api + } ace.acequire('ace/ext/language_tools') editor.setOptions({ @@ -275,11 +283,15 @@ function Editor (opts = {}) { this.find = (string) => editor.find(string) + this.previousInput = '' + this.saveTimeout = null // Do setup on initialisation here editor.on('changeSession', function () { + editorOnChange(self) event.trigger('sessionSwitched', []) editor.getSession().on('change', function () { + editorOnChange(self) event.trigger('contentChanged', []) }) }) @@ -290,4 +302,29 @@ function Editor (opts = {}) { editor.resize(true) } +function editorOnChange (self) { + var currentFile = self._deps.config.get('currentFile') + if (!currentFile) { + return + } + var input = self.get(currentFile) + if (!input) { + return + } + // if there's no change, don't do anything + if (input === self.previousInput) { + return + } + self.previousInput = input + + // fire storage update + // NOTE: save at most once per 5 seconds + if (self.saveTimeout) { + window.clearTimeout(self.saveTimeout) + } + self.saveTimeout = window.setTimeout(() => { + self._deps.fileManager.saveCurrentFile() + }, 5000) +} + module.exports = Editor From 16814e4f0d2f80c7d8dd6bb1c3114e1c2ebfb8cb Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 4 Jul 2018 17:29:09 +0200 Subject: [PATCH 95/98] fix 'hideWarning' --- src/app/tabs/compile-tab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 62cc14778e..756ff3421a 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -212,8 +212,8 @@ module.exports = class CompileTab { function updateAutoCompile (event) { self._deps.config.set('autoCompile', self._view.autoCompile.checked) } function compile (event) { self._deps.app.runCompiler() } function hideWarnings (event) { - self._opts.config.set('hideWarnings', self._view.hideWarningsBox.checked) - self._api.runCompiler() + self._deps.config.set('hideWarnings', self._view.hideWarningsBox.checked) + compile() } function getContractProperty (property) { const select = self._view.contractNames From ea4015116fc9a76bd1b6d07b4f8b2d2f12a8f4fd Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 4 Jul 2018 17:29:30 +0200 Subject: [PATCH 96/98] fix publish on Swarm --- src/app/contract/publishOnSwarm.js | 4 ++-- src/app/tabs/compile-tab.js | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/contract/publishOnSwarm.js b/src/app/contract/publishOnSwarm.js index 0c2692a801..239d4344ff 100644 --- a/src/app/contract/publishOnSwarm.js +++ b/src/app/contract/publishOnSwarm.js @@ -3,7 +3,7 @@ var async = require('async') var swarmgw = require('swarmgw') -module.exports = (contract, appAPI, cb, swarmVerifiedPublishCallBack) => { +module.exports = (contract, fileManager, cb, swarmVerifiedPublishCallBack) => { // gather list of files to publish var sources = [] @@ -32,7 +32,7 @@ module.exports = (contract, appAPI, cb, swarmVerifiedPublishCallBack) => { return cb('Metadata inconsistency') } - appAPI.fileProviderOf(fileName).get(fileName, (error, content) => { + fileManager.fileProviderOf(fileName).get(fileName, (error, content) => { if (error) { console.log(error) } else { diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 756ff3421a..4de77bfd16 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -37,7 +37,9 @@ module.exports = class CompileTab { editor: self._components.registry.get('editor').api, config: self._components.registry.get('config').api, compiler: self._components.registry.get('compiler').api, - renderer: self._components.registry.get('renderer').api + renderer: self._components.registry.get('renderer').api, + swarmfileProvider: self._components.registry.get('fileproviders/swarm').api, + fileManager: self._components.registry.get('filemanager').api } self.data = { hideWarnings: self._deps.config.get('hideWarnings') || false, @@ -304,7 +306,7 @@ module.exports = class CompileTab { if (contract.metadata === undefined || contract.metadata.length === 0) { modalDialogCustom.alert('This contract does not implement all functions and thus cannot be published.') } else { - publishOnSwarm(contract, self._api, function (err) { + publishOnSwarm(contract, self._deps.fileManager, function (err) { if (err) { try { err = JSON.stringify(err) @@ -315,7 +317,7 @@ module.exports = class CompileTab { modalDialogCustom.alert(yo`Metadata published successfully.
The Swarm address of the metadata file is available in the contract details.
`) } }, function (item) { // triggered each time there's a new verified publish (means hash correspond) - self._api.fileProvider('swarm').addReadOnly(item.hash, item.content) + self._deps.swarmfileProvider.addReadOnly(item.hash, item.content) }) } } From 6c299c3a3351da86dd674926bbe1f83c28849b57 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 4 Jul 2018 17:33:46 +0200 Subject: [PATCH 97/98] test against warning count --- src/app/tabs/analysis-tab.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/tabs/analysis-tab.js b/src/app/tabs/analysis-tab.js index b937d1ab87..313fb577d6 100644 --- a/src/app/tabs/analysis-tab.js +++ b/src/app/tabs/analysis-tab.js @@ -22,9 +22,11 @@ module.exports = class AnalysisTab { const self = this var staticanalysis = new StaticAnalysis() staticanalysis.event.register('staticAnaysisWarning', (count) => { - const msg = `Static Analysis raised ${count} warning(s) that requires your attention. Click here to show the warning(s).` - const settings = { type: 'staticAnalysisWarning', click: () => self._deps.rightHandPanel.focusOn('staticanalysisView'), useSpan: true } - self.event.trigger('newStaticAnaysisWarningMessage', [msg, settings]) + if (count > 0) { + const msg = `Static Analysis raised ${count} warning(s) that requires your attention. Click here to show the warning(s).` + const settings = { type: 'staticAnalysisWarning', click: () => self._deps.rightHandPanel.focusOn('staticanalysisView'), useSpan: true } + self.event.trigger('newStaticAnaysisWarningMessage', [msg, settings]) + } }) self._components.registry.put({api: staticanalysis, name: 'staticanalysis'}) if (self._view.el) return self._view.el From 85cff4f9c0fdf021bbd5ca9730a52c2860488c40 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 4 Jul 2018 17:34:14 +0200 Subject: [PATCH 98/98] standard --- src/app.js | 1 - src/app/tabs/analysis-tab.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app.js b/src/app.js index 3a60350960..5737abea32 100644 --- a/src/app.js +++ b/src/app.js @@ -448,7 +448,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org self._components.editorpanel.event.register('resize', direction => self._adjustLayout(direction)) self._view.centerpanel.appendChild(self._components.editorpanel.render()) - var editor = self._components.editorpanel.getEditor() // The event listener needs to be registered as early as possible, because the // parent will send the message upon the "load" event. diff --git a/src/app/tabs/analysis-tab.js b/src/app/tabs/analysis-tab.js index 313fb577d6..f7a28c60a8 100644 --- a/src/app/tabs/analysis-tab.js +++ b/src/app/tabs/analysis-tab.js @@ -25,7 +25,7 @@ module.exports = class AnalysisTab { if (count > 0) { const msg = `Static Analysis raised ${count} warning(s) that requires your attention. Click here to show the warning(s).` const settings = { type: 'staticAnalysisWarning', click: () => self._deps.rightHandPanel.focusOn('staticanalysisView'), useSpan: true } - self.event.trigger('newStaticAnaysisWarningMessage', [msg, settings]) + self.event.trigger('newStaticAnaysisWarningMessage', [msg, settings]) } }) self._components.registry.put({api: staticanalysis, name: 'staticanalysis'})