diff --git a/lib/contracts/code_generator.js b/lib/contracts/code_generator.js index d4d731436..4d5d8467e 100644 --- a/lib/contracts/code_generator.js +++ b/lib/contracts/code_generator.js @@ -220,15 +220,12 @@ class CodeGenerator { result += Templates.define_when_env_loaded(); let block; + //if (self.communicationConfig.enabled === true && ['whisper', 'orbit'].indexOf(self.communicationConfig.provider) < 0) { + // //TODO: add logger; also make sure it would still work with a plugin provider + // self.logger.warn("unknown provider " + self.communicationConfig.provider); + //} // TODO: refactor this - if (self.communicationConfig.provider === 'whisper' && self.communicationConfig.enabled === true) { - if (self.communicationConfig.connection === undefined) { - block = "\nEmbarkJS.Messages.setProvider('" + self.communicationConfig.provider + "');"; - } else { - block = "\nEmbarkJS.Messages.setProvider('" + self.communicationConfig.provider + "', {server: '" + self.communicationConfig.connection.host + "', port: '" + self.communicationConfig.connection.port + "', type: '" + self.communicationConfig.connection.type + "'});"; - } - result += Templates.exec_when_env_loaded({block: block}); - } else if (self.communicationConfig.provider === 'orbit' && self.communicationConfig.enabled === true) { + if (self.communicationConfig.enabled === true) { if (self.communicationConfig.connection === undefined) { block = "\nEmbarkJS.Messages.setProvider('" + self.communicationConfig.provider + "');"; } else { @@ -236,7 +233,6 @@ class CodeGenerator { } result += Templates.exec_when_env_loaded({block: block}); } - return result; }