Skip to content

Commit

Permalink
Merge pull request #2546 from ethereum/compiler-settings
Browse files Browse the repository at this point in the history
set and get compiler state properly
  • Loading branch information
yann300 authored Jan 20, 2020
2 parents a756977 + 60fd24e commit 5df44c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/tabs/compile-tab.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/app/tabs/compileTab/compileTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,34 @@ class CompileTab {
this.optimize = this.queryParams.get().optimize
this.optimize = this.optimize === 'true'
this.queryParams.update({ optimize: this.optimize })
this.compiler.optimize = this.optimize
this.compiler.set('optimize', this.optimize)

this.evmVersion = this.queryParams.get().evmVersion
if (this.evmVersion === 'undefined' || this.evmVersion === 'null' || !this.evmVersion) {
this.evmVersion = null
}
this.queryParams.update({ evmVersion: this.evmVersion })
this.compiler.evmVersion = this.evmVersion
this.compiler.set('evmVersion', this.evmVersion)
}

setOptimize (newOptimizeValue) {
this.optimize = newOptimizeValue
this.queryParams.update({ optimize: this.optimize })
this.compiler.optimize = this.optimize
this.compiler.set('optimize', this.optimize)
}

setEvmVersion (newEvmVersion) {
this.evmVersion = newEvmVersion
this.queryParams.update({ evmVersion: this.evmVersion })
this.compiler.evmVersion = this.evmVersion
this.compiler.set('evmVersion', this.evmVersion)
}

/**
* Set the compiler to using Solidity or Yul (default to Solidity)
* @params lang {'Solidity' | 'Yul'} ...
*/
setLanguage (lang) {
this.compiler.language = lang
this.compiler.set('language', lang)
}

/**
Expand Down

0 comments on commit 5df44c9

Please sign in to comment.