From 64c7c299c1ee0110d764ccf5bfa5b2c29873840b Mon Sep 17 00:00:00 2001 From: LianaHus Date: Fri, 15 Nov 2019 16:15:04 +0100 Subject: [PATCH] Revert "Merge pull request #2398 from ethereum/compiler_from_pragma" This reverts commit 87b69736cb8d195c54597670b1040d553bd74ada, reversing changes made to 148d0669263de2301cd0eecc94a971917195ec70. --- src/app/tabs/compileTab/compilerContainer.js | 23 -------------------- 1 file changed, 23 deletions(-) diff --git a/src/app/tabs/compileTab/compilerContainer.js b/src/app/tabs/compileTab/compilerContainer.js index 7fc46c1a720..20abb71fcc8 100644 --- a/src/app/tabs/compileTab/compilerContainer.js +++ b/src/app/tabs/compileTab/compilerContainer.js @@ -32,9 +32,6 @@ class CompilerContainer { * Update the compilation button with the name of the current file */ set currentFile (name = '') { - if (name && name !== '') { - this._setCompilerVersionFromPragma(name) - } if (!this._view.compilationButton) return const button = this.compilationButton(name.split('/').pop()) yo.update(this._view.compilationButton, button) @@ -116,23 +113,6 @@ class CompilerContainer { return el } - _setCompilerVersionFromPragma (filename) { - this.compileTabLogic.fileManager.getFile(filename).then(data => { - const pragmaArr = data.match(/(pragma solidity (.+?);)/g) - if (pragmaArr && pragmaArr.length === 1) { - const pragmaStr = pragmaArr[0].replace('pragma solidity', '').trim() - const pragma = pragmaStr.substring(0, pragmaStr.length - 1) - const fixedVersions = this.data.allversions.filter(obj => !obj.prerelease).map(obj => obj.version) - const compilerToLoad = semver.maxSatisfying(fixedVersions, pragma) - const compilerPath = this.data.allversions.filter(obj => !obj.prerelease && obj.version === compilerToLoad)[0].path - if (this.data.selectedVersion !== compilerPath) { - this.data.selectedVersion = compilerPath - this._updateVersionSelector() - } - } - }) - } - _retrieveVersion () { let version = this._view.versionSelector.value return version.substring(9, version.length) @@ -263,9 +243,6 @@ class CompilerContainer { compile (event) { if (this.config.get('currentFile')) { - if (!this.data.selectedVersion.includes('nightly')) { - this._setCompilerVersionFromPragma(this.config.get('currentFile')) - } this.compileTabLogic.runCompiler() } }