filtered out valid versions for compiler from pragma check

pull/5370/head
LianaHus 5 years ago committed by Liana Husikyan
parent 0ee80e6e24
commit aaa55f7605
  1. 3
      src/app/tabs/compileTab/compilerContainer.js

@ -124,6 +124,7 @@ class CompilerContainer {
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)
if (!semver.satisfies( this._retrieveVersion(), pragma)) {
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) {
@ -131,6 +132,7 @@ class CompilerContainer {
this._updateVersionSelector()
}
}
}
})
}
@ -357,6 +359,7 @@ class CompilerContainer {
}
_updateLanguageSelector () {
/// This is the first version when Yul is available
if (semver.lt(this._retrieveVersion(), 'v0.5.7+commit.6da8b019.js')) {
this._view.languageSelector.setAttribute('disabled', '')
this._view.languageSelector.value = 'Solidity'

Loading…
Cancel
Save