Apply feedback

This commit is contained in:
Anthony Laibe 2018-08-10 14:22:45 +01:00 committed by Iuri Matias
parent 27933774a9
commit 0924f2dfd0
5 changed files with 10 additions and 7 deletions

View File

@ -294,6 +294,9 @@ class EmbarkController {
}); });
}, },
function web3IPC(callback) { 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()) { if(!engine.ipc.connected || engine.ipc.isServer()) {
return callback(); return callback();
} }
@ -314,6 +317,7 @@ class EmbarkController {
}); });
}, },
function deploy(callback) { function deploy(callback) {
// Skip if we are connected to a websocket, the server will do it
if(engine.ipc.connected && engine.ipc.isClient()) { if(engine.ipc.connected && engine.ipc.isClient()) {
return callback(); return callback();
} }
@ -322,6 +326,7 @@ class EmbarkController {
}); });
}, },
function waitForWriteFinish(callback) { function waitForWriteFinish(callback) {
// Skip if we are connected to a websocket, the server will do it
if(engine.ipc.connected && engine.ipc.isClient()) { if(engine.ipc.connected && engine.ipc.isClient()) {
return callback(); return callback();
} }

View File

@ -55,7 +55,7 @@ class Console {
if (this.ipc.connected && this.ipc.isClient()) { if (this.ipc.connected && this.ipc.isClient()) {
return this.ipc.request('console:executeCmd', cmd, callback); return this.ipc.request('console:executeCmd', cmd, callback);
} }
return callback(e.message); callback(e.message);
} }
} }
} }

View File

@ -368,7 +368,7 @@ class Monitor {
executeCmd(cmd, cb) { executeCmd(cmd, cb) {
const self = this; const self = this;
self.logText.log('console> '.bold.green + cmd); self.logText.log('console> '.bold.green + cmd);
self.console.executeCmd(cmd, function (_, result) { self.console.executeCmd(cmd, function (_err, result) {
self.logText.log(result); self.logText.log(result);
if (cb) { if (cb) {
cb(result); cb(result);

View File

@ -13,7 +13,7 @@ class CodeRunner {
RunCode.initContext(); RunCode.initContext();
if (this.ipc.isServer()) { 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}; let result = {web3Config: RunCode.getWeb3Config(), commands: self.commands};
callback(null, result); callback(null, result);
}); });

View File

@ -17,9 +17,7 @@ class Profiler {
table.setHeading('Function', 'Payable', 'Mutability', 'Inputs', 'Outputs', 'Gas Estimates'); table.setHeading('Function', 'Payable', 'Mutability', 'Inputs', 'Outputs', 'Gas Estimates');
self.gasEstimator.estimateGas(contractName, function(err, gastimates, name) { self.gasEstimator.estimateGas(contractName, function(err, gastimates, name) {
if (err) { if (err) {
self.logger.error('error found in method: ', name); return callback(null, "error found in method: " + name + " error: " + JSON.stringify(err));
self.logger.error(JSON.stringify(err));
return;
} }
contract.abiDefinition.forEach((abiMethod) => { contract.abiDefinition.forEach((abiMethod) => {
switch(abiMethod.type) { switch(abiMethod.type) {
@ -59,7 +57,7 @@ class Profiler {
process: (callback) => { process: (callback) => {
self.events.request('contracts:contract', contractName, (contract) => { self.events.request('contracts:contract', contractName, (contract) => {
if (!contract || !contract.deployedAddress) { 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); this.profile(contractName, contract, callback);
}); });