diff --git a/cmd/cmd_controller.js b/cmd/cmd_controller.js index d343bae2..beef7db0 100644 --- a/cmd/cmd_controller.js +++ b/cmd/cmd_controller.js @@ -294,6 +294,9 @@ class EmbarkController { }); }, function web3IPC(callback) { + // Do specific work in case we are connected to a socket: + // - Setup Web3 + // - Apply history if(!engine.ipc.connected || engine.ipc.isServer()) { return callback(); } @@ -314,6 +317,7 @@ class EmbarkController { }); }, function deploy(callback) { + // Skip if we are connected to a websocket, the server will do it if(engine.ipc.connected && engine.ipc.isClient()) { return callback(); } @@ -322,6 +326,7 @@ class EmbarkController { }); }, function waitForWriteFinish(callback) { + // Skip if we are connected to a websocket, the server will do it if(engine.ipc.connected && engine.ipc.isClient()) { return callback(); } diff --git a/cmd/dashboard/console.js b/cmd/dashboard/console.js index 1c23cfd8..2ef31d29 100644 --- a/cmd/dashboard/console.js +++ b/cmd/dashboard/console.js @@ -55,7 +55,7 @@ class Console { if (this.ipc.connected && this.ipc.isClient()) { return this.ipc.request('console:executeCmd', cmd, callback); } - return callback(e.message); + callback(e.message); } } } diff --git a/cmd/dashboard/monitor.js b/cmd/dashboard/monitor.js index b758a2ec..c9eea8c8 100644 --- a/cmd/dashboard/monitor.js +++ b/cmd/dashboard/monitor.js @@ -368,7 +368,7 @@ class Monitor { executeCmd(cmd, cb) { const self = this; self.logText.log('console> '.bold.green + cmd); - self.console.executeCmd(cmd, function (_, result) { + self.console.executeCmd(cmd, function (_err, result) { self.logText.log(result); if (cb) { cb(result); diff --git a/lib/core/modules/coderunner/codeRunner.js b/lib/core/modules/coderunner/codeRunner.js index 925d7e76..f5075aa2 100644 --- a/lib/core/modules/coderunner/codeRunner.js +++ b/lib/core/modules/coderunner/codeRunner.js @@ -13,7 +13,7 @@ class CodeRunner { RunCode.initContext(); if (this.ipc.isServer()) { - this.ipc.on('runcode:getCommands', (_, callback) => { + this.ipc.on('runcode:getCommands', (_err, callback) => { let result = {web3Config: RunCode.getWeb3Config(), commands: self.commands}; callback(null, result); }); diff --git a/lib/modules/profiler/index.js b/lib/modules/profiler/index.js index b5e59967..377acad5 100644 --- a/lib/modules/profiler/index.js +++ b/lib/modules/profiler/index.js @@ -17,9 +17,7 @@ class Profiler { table.setHeading('Function', 'Payable', 'Mutability', 'Inputs', 'Outputs', 'Gas Estimates'); self.gasEstimator.estimateGas(contractName, function(err, gastimates, name) { if (err) { - self.logger.error('error found in method: ', name); - self.logger.error(JSON.stringify(err)); - return; + return callback(null, "error found in method: " + name + " error: " + JSON.stringify(err)); } contract.abiDefinition.forEach((abiMethod) => { switch(abiMethod.type) { @@ -59,7 +57,7 @@ class Profiler { process: (callback) => { self.events.request('contracts:contract', contractName, (contract) => { if (!contract || !contract.deployedAddress) { - return "-- couldn't profile " + contractName + " - it's not deployed or could be an interface"; + return callback(null, "-- couldn't profile " + contractName + " - it's not deployed or could be an interface"); } this.profile(contractName, contract, callback); });