diff --git a/lib/modules/code_generator/code_templates/do-when-loaded.js.ejs b/lib/modules/code_generator/code_templates/do-when-loaded.js.ejs index 5503ad3c..16d33f8b 100644 --- a/lib/modules/code_generator/code_templates/do-when-loaded.js.ejs +++ b/lib/modules/code_generator/code_templates/do-when-loaded.js.ejs @@ -3,7 +3,5 @@ whenEnvIsLoaded(function(){ <%- block %> }); - if (EmbarkJS) { - EmbarkJS.environment = "<%- environment %>"; - } + EmbarkJS.environment = "<%- environment %>"; }); diff --git a/lib/modules/code_generator/index.js b/lib/modules/code_generator/index.js index c903da69..57b289ef 100644 --- a/lib/modules/code_generator/index.js +++ b/lib/modules/code_generator/index.js @@ -103,13 +103,6 @@ class CodeGenerator { }); } - //generateContext() { - // let result = ""; - // result += Templates.main_context(); - // result += Templates.load_manager(); - // return result; - //} - generateProvider(isDeployment) { let self = this; let result = ""; @@ -350,11 +343,6 @@ class CodeGenerator { contractCode += contractName + "JSONConfig.web3 = web3;\n"; contractCode += "let " + contractName + " = new EmbarkJS.Blockchain.Contract(" + contractName + "JSONConfig);\n"; - //contractCode += "\n__embarkContext.execWhenReady(function() {\n"; - //contractCode += "\n" + contractName + ".setProvider(web3.currentProvider);\n"; - //contractCode += "\n" + contractName + ".options.from = web3.eth.defaultAccount;\n"; - //contractCode += "\n});\n"; - contractCode += "export default " + contractName + ";\n"; cb(contractCode); } @@ -386,7 +374,6 @@ class CodeGenerator { let providerCode = self.generateProvider(false); code += providerCode; - //code += "\nglobal.__embarkContext = __mainContext.__loadManagerInstance;\n"; code += "\nexport default web3;\n"; next(null, code); }