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) {
// 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();
}

View File

@ -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);
}
}
}

View File

@ -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);

View File

@ -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);
});

View File

@ -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);
});