Console via IPC do not run on deploy

This commit is contained in:
Anthony Laibe 2018-08-15 11:03:50 +01:00 committed by Iuri Matias
parent a59cc29d39
commit a7b0cea09b
3 changed files with 5 additions and 5 deletions

View File

@ -56,7 +56,7 @@ class Console {
} }
try { try {
this.events.request('runcode:eval', cmd, callback, true); this.events.request('runcode:eval', cmd, callback);
} }
catch (e) { catch (e) {
if (this.ipc.connected && this.ipc.isClient()) { if (this.ipc.connected && this.ipc.isClient()) {

View File

@ -37,12 +37,12 @@ class CodeRunner {
RunCode.registerVar(varName, code); RunCode.registerVar(varName, code);
}); });
this.events.setCommandHandler('runcode:eval', (code, cb, dashboard = false) => { this.events.setCommandHandler('runcode:eval', (code, cb, saveForConsole = false) => {
if (!cb) { if (!cb) {
cb = function() {}; cb = function() {};
} }
let result = RunCode.doEval(code); let result = RunCode.doEval(code);
if (!dashboard && self.ipc.isServer()) { if (saveForConsole && self.ipc.isServer()) {
self.commands.push({code}); self.commands.push({code});
self.ipc.broadcast("runcode:newCommand", {code}); self.ipc.broadcast("runcode:newCommand", {code});
} }

View File

@ -171,7 +171,7 @@ class ContractDeployer {
// TODO: can be moved into a afterDeploy event // TODO: can be moved into a afterDeploy event
// just need to figure out the gasLimit coupling issue // just need to figure out the gasLimit coupling issue
self.events.request('code-generator:contract:vanilla', contract, contract._gasLimit, (contractCode) => { self.events.request('code-generator:contract:vanilla', contract, contract._gasLimit, (contractCode) => {
self.events.request('runcode:eval', contractCode); self.events.request('runcode:eval', contractCode, () => {}, true);
return callback(); return callback();
}); });
} }
@ -274,7 +274,7 @@ class ContractDeployer {
// TODO: can be moved into a afterDeploy event // TODO: can be moved into a afterDeploy event
// just need to figure out the gasLimit coupling issue // just need to figure out the gasLimit coupling issue
self.events.request('code-generator:contract:vanilla', contract, contract._gasLimit, (contractCode) => { self.events.request('code-generator:contract:vanilla', contract, contract._gasLimit, (contractCode) => {
self.events.request('runcode:eval', contractCode); self.events.request('runcode:eval', contractCode, () => {}, true);
self.plugins.runActionsForEvent('deploy:contract:deployed', {contract: contract}, () => { self.plugins.runActionsForEvent('deploy:contract:deployed', {contract: contract}, () => {
return next(null, receipt); return next(null, receipt);
}); });