diff --git a/.circleci/config.yml b/.circleci/config.yml index 61aba18604..c419e2f4db 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,10 +26,10 @@ jobs: - checkout - restore_cache: keys: - - dep-bundle-21-{{ checksum "package.json" }} + - dep-bundle-22-{{ checksum "package.json" }} - run: npm install - save_cache: - key: dep-bundle-21-{{ checksum "package.json" }} + key: dep-bundle-22-{{ checksum "package.json" }} paths: - ~/repo/node_modules - run: npm run lint && npm run test && npm run make-mock-compiler && npm run build @@ -46,10 +46,10 @@ jobs: - checkout - restore_cache: keys: - - dep-bundle-16-{{ checksum "package.json" }} + - dep-bundle-17-{{ checksum "package.json" }} - run: npm install - save_cache: - key: dep-bundle-16-{{ checksum "package.json" }} + key: dep-bundle-17-{{ checksum "package.json" }} paths: - ~/repo/node_modules - run: npm run build_debugger diff --git a/ci/browser_tests.sh b/ci/browser_tests.sh index eb1e358e8b..abae1828e9 100755 --- a/ci/browser_tests.sh +++ b/ci/browser_tests.sh @@ -19,7 +19,7 @@ else OS="linux" FILEFORMAT="tar.gz" fi -SC_VERSION="4.4.11" +SC_VERSION="4.5.1" SAUCECONNECT_URL="https://saucelabs.com/downloads/sc-$SC_VERSION-$OS.$FILEFORMAT" SAUCECONNECT_USERNAME="chriseth" SAUCECONNECT_ACCESSKEY="b781828a-9e9c-43d8-89d4-2fbb879595ca" diff --git a/ci/browser_tests_debugger.sh b/ci/browser_tests_debugger.sh index 2aa54fb53b..145e154925 100755 --- a/ci/browser_tests_debugger.sh +++ b/ci/browser_tests_debugger.sh @@ -10,7 +10,7 @@ else OS="linux" FILEFORMAT="tar.gz" fi -SC_VERSION="4.4.11" +SC_VERSION="4.5.1" SAUCECONNECT_URL="https://saucelabs.com/downloads/sc-$SC_VERSION-$OS.$FILEFORMAT" SAUCECONNECT_USERNAME="yanneth" SAUCECONNECT_ACCESSKEY="1f5a4560-b02b-41aa-b52b-f033aad30870" diff --git a/src/app/debugger/debugger.js b/src/app/debugger/debugger.js index 6cd6eb1cc9..2cf969d405 100644 --- a/src/app/debugger/debugger.js +++ b/src/app/debugger/debugger.js @@ -39,7 +39,7 @@ function Debugger (container, sourceHighlighter, localRegistry) { this.isActive = false this.breakPointManager = new remixLib.code.BreakpointManager(this.debugger, (sourceLocation) => { - return self._deps.offsetToLineColumnConverter.offsetToLineColumn(sourceLocation, sourceLocation.file, this._deps.compiler.lastCompilationResult.source.sources) + return self._deps.offsetToLineColumnConverter.offsetToLineColumn(sourceLocation, sourceLocation.file, this._deps.compiler.lastCompilationResult.source.sources, this._deps.compiler.lastCompilationResult.data.sources) }, (step) => { this.debugger_ui.stepManager.jumpTo(step) }) @@ -80,7 +80,7 @@ function Debugger (container, sourceHighlighter, localRegistry) { if (error) return console.log(error) self.debugger.callTree.sourceLocationTracker.getSourceLocationFromVMTraceIndex(address, index, self._deps.compiler.lastCompilationResult.data.contracts, function (error, rawLocation) { 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) + var lineColumnPos = self._deps.offsetToLineColumnConverter.offsetToLineColumn(rawLocation, rawLocation.file, self._deps.compiler.lastCompilationResult.source.sources, self._deps.compiler.lastCompilationResult.data.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 e4781f6b68..68f861681b 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.source.sources) + var lineColumn = self._deps.offsetToLineColumnConverter.offsetToLineColumn(position, position.file, self._deps.compiler.lastCompilationResult.source.sources, self._deps.compiler.lastCompilationResult.data.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 d55965fd49..0b6848b3b4 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.source.sources) + var lineColumn = self._deps.offsetToLineColumnConverter.offsetToLineColumn(position, position.file, self._deps.compiler.lastCompilationResult.source.sources, self._deps.compiler.lastCompilationResult.data.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/plugin/pluginAPI.js b/src/app/plugin/pluginAPI.js index a6c8f8dd54..99a738e168 100644 --- a/src/app/plugin/pluginAPI.js +++ b/src/app/plugin/pluginAPI.js @@ -127,6 +127,10 @@ module.exports = (pluginManager, fileProviders, fileManager, compiler, udapp) => highlighter.currentSourceLocation(null) highlighter.currentSourceLocationFromfileName(position, filePath, hexColor) cb() + }, + discardHighlight: (mod, cb) => { + highlighter.currentSourceLocation(null) + cb() } } } diff --git a/src/app/staticanalysis/staticAnalysisView.js b/src/app/staticanalysis/staticAnalysisView.js index 6bb5b56398..e12d161d49 100644 --- a/src/app/staticanalysis/staticAnalysisView.js +++ b/src/app/staticanalysis/staticAnalysisView.js @@ -97,7 +97,7 @@ staticAnalysisView.prototype.run = function () { start: parseInt(split[0]), length: parseInt(split[1]) } - location = self._deps.offsetToLineColumnConverter.offsetToLineColumn(location, file, self.lastCompilationSource.sources) + location = self._deps.offsetToLineColumnConverter.offsetToLineColumn(location, parseInt(file), self._deps.compiler.lastCompilationResult.source.sources, self._deps.compiler.lastCompilationResult.data.sources) location = Object.keys(self.lastCompilationResult.contracts)[file] + ':' + (location.start.line + 1) + ':' + (location.start.column + 1) + ':' } warningCount++ diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index e4a90efa85..ef83cf1f27 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -615,7 +615,7 @@ const css = csjs` color: ${styles.rightPanel.modalDialog_text_Secondary}; } .icon { - margin-right: 3%; + margin-right: 0.3em; } .spinningIcon { margin-right: .3em; diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 377e953b68..ed540c2ed4 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -292,6 +292,7 @@ function contractDropdown (events, self) { instanceContainer.appendChild(instanceContainerTitle) instanceContainer.appendChild(self._view.noInstancesText) var compFails = yo`` + var info = yo`` self._deps.compiler.event.register('compilationFinished', function (success, data, source) { getContractNames(success, data) if (success) { @@ -303,6 +304,25 @@ function contractDropdown (events, self) { } }) + var deployAction = (value) => { + self._view.createPanel.style.display = value + self._view.orLabel.style.display = value + } + + self._deps.fileManager.event.register('currentFileChanged', (currentFile) => { + document.querySelector(`.${css.contractNames}`).classList.remove(css.contractNamesError) + var contractNames = document.querySelector(`.${css.contractNames.classNames[0]}`) + contractNames.innerHTML = '' + if (/.(.abi)$/.exec(currentFile)) { + deployAction('none') + compFails.style.display = 'none' + contractNames.appendChild(yo``) + selectContractNames.setAttribute('disabled', true) + } else if (/.(.sol)$/.exec(currentFile)) { + deployAction('block') + } + }) + var atAddressButtonInput = yo`` var selectContractNames = yo`` @@ -317,15 +337,16 @@ function contractDropdown (events, self) { return null } - var createPanel = yo`
` - + self._view.createPanel = yo`` + self._view.orLabel = yo`