remove engine onReady

This commit is contained in:
Jonathan Rainville 2018-05-23 10:06:12 -04:00
parent 871c2fb228
commit 4815555a89
2 changed files with 17 additions and 34 deletions

View File

@ -13,7 +13,6 @@ const Pipeline = require('../pipeline/pipeline.js');
const Watch = require('../pipeline/watch.js');
const LibraryManager = require('../versions/library_manager.js');
const CodeRunner = require('../coderunner/codeRunner.js');
const constants = require('../constants');
const utils = require('../utils/utils');
class Engine {
@ -283,16 +282,6 @@ class Engine {
});
}
onReady(callback) {
if (this.isReady) {
return callback();
}
this.events.once(constants.blockchain.blockchainReady, () => {
this.isReady = true;
callback();
});
}
web3Service(options) {
this.blockchain = new Blockchain({
contractsConfig: this.config.contractsConfig,

View File

@ -151,17 +151,15 @@ class Embark {
engine.logger.info(__("Ready").underline);
engine.events.emit("status", __("Ready").green);
});
engine.onReady(() => {
engine.deployManager.deployContracts(function (err) {
engine.startService("fileWatcher");
if (options.runWebserver) {
engine.startService("webServer", {
host: options.serverHost,
port: options.serverPort
});
}
callback(err);
});
engine.deployManager.deployContracts(function (err) {
engine.startService("fileWatcher");
if (options.runWebserver) {
engine.startService("webServer", {
host: options.serverHost,
port: options.serverPort
});
}
callback(err);
});
}
], function (err, _result) {
@ -219,10 +217,8 @@ class Embark {
callback();
},
function deploy(callback) {
engine.onReady(() => {
engine.deployManager.deployContracts(function (err) {
callback(err);
});
engine.deployManager.deployContracts(function (err) {
callback(err);
});
}
], function (err, _result) {
@ -388,14 +384,12 @@ class Embark {
.catch(callback);
});
engine.onReady(() => {
// 1. build the contracts and dapp webpack
engine.deployManager.deployContracts(function (err) {
engine.logger.info(__("finished deploying").underline);
if(err){
callback(err);
}
});
// 1. build the contracts and dapp webpack
engine.deployManager.deployContracts(function (err) {
engine.logger.info(__("finished deploying").underline);
if(err){
callback(err);
}
});
}
], function (err, _result) {