From ab6d31b80db6c56cec22e57aaa98bd4bdef8e9b2 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 20 Jan 2020 15:26:34 +0530 Subject: [PATCH 1/2] set and get compiler state properly --- src/app/tabs/compile-tab.js | 2 +- src/app/tabs/compileTab/compileTab.js | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index f2727abc9cd..fb5f1c0a0c6 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -187,7 +187,7 @@ class CompileTab extends ViewPlugin { } getCompilationResult () { - return this.compileTabLogic.compiler.lastCompilationResult + return this.compileTabLogic.compiler.state.lastCompilationResult } // This function is used by remix-plugin diff --git a/src/app/tabs/compileTab/compileTab.js b/src/app/tabs/compileTab/compileTab.js index fd54496f6f7..e0f2aa30b97 100644 --- a/src/app/tabs/compileTab/compileTab.js +++ b/src/app/tabs/compileTab/compileTab.js @@ -14,6 +14,7 @@ class CompileTab { this.queryParams = queryParams this.compilerImport = new CompilerImport() this.compiler = new Compiler((url, cb) => this.importFileCb(url, cb)) + console.log('This is compiler object bro-1-->', this.compiler) this.fileManager = fileManager this.editor = editor this.config = config @@ -24,26 +25,28 @@ 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) + console.log('This is compiler object bro--2->', this.compiler) } setEvmVersion (newEvmVersion) { this.evmVersion = newEvmVersion this.queryParams.update({ evmVersion: this.evmVersion }) - this.compiler.evmVersion = this.evmVersion + this.compiler.set('evmVersion', this.evmVersion) + console.log('This is compiler object bro--3->', this.compiler) } /** @@ -51,7 +54,7 @@ class CompileTab { * @params lang {'Solidity' | 'Yul'} ... */ setLanguage (lang) { - this.compiler.language = lang + this.compiler.set('language', lang) } /** From 60fd24ec8aafe2195ad4181a9adf2e888085a71d Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 20 Jan 2020 15:52:50 +0530 Subject: [PATCH 2/2] removed consoles --- src/app/tabs/compileTab/compileTab.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/app/tabs/compileTab/compileTab.js b/src/app/tabs/compileTab/compileTab.js index e0f2aa30b97..bace3ade281 100644 --- a/src/app/tabs/compileTab/compileTab.js +++ b/src/app/tabs/compileTab/compileTab.js @@ -14,7 +14,6 @@ class CompileTab { this.queryParams = queryParams this.compilerImport = new CompilerImport() this.compiler = new Compiler((url, cb) => this.importFileCb(url, cb)) - console.log('This is compiler object bro-1-->', this.compiler) this.fileManager = fileManager this.editor = editor this.config = config @@ -39,14 +38,12 @@ class CompileTab { this.optimize = newOptimizeValue this.queryParams.update({ optimize: this.optimize }) this.compiler.set('optimize', this.optimize) - console.log('This is compiler object bro--2->', this.compiler) } setEvmVersion (newEvmVersion) { this.evmVersion = newEvmVersion this.queryParams.update({ evmVersion: this.evmVersion }) this.compiler.set('evmVersion', this.evmVersion) - console.log('This is compiler object bro--3->', this.compiler) } /**