diff --git a/packages/embark/src/lib/modules/tests/test.js b/packages/embark/src/lib/modules/tests/test.js index 060416b62..605a36512 100644 --- a/packages/embark/src/lib/modules/tests/test.js +++ b/packages/embark/src/lib/modules/tests/test.js @@ -34,15 +34,17 @@ class Test { init(callback) { this.gasLimit = constants.tests.gasLimit; this.events.request('deploy:setGasLimit', this.gasLimit); - if (this.options.node !== 'embark') { - this.showNodeHttpWarning(); - return callback(); - } - if (!this.ipc.connected) { - this.logger.error("Could not connect to Embark's IPC. Is embark running?"); - if (!this.options.inProcess) process.exit(1); - } - return this.connectToIpcNode(callback); + this.events.request('blockchain:connector:ready', () => { + if (this.options.node !== 'embark') { + this.showNodeHttpWarning(); + return callback(); + } + if (!this.ipc.connected) { + this.logger.error("Could not connect to Embark's IPC. Is embark running?"); + if (!this.options.inProcess) process.exit(1); + } + this.connectToIpcNode(callback); + }); } connectToIpcNode(cb) { diff --git a/packages/web3Connector/index.js b/packages/web3Connector/index.js index c7dde503b..f62ab4920 100644 --- a/packages/web3Connector/index.js +++ b/packages/web3Connector/index.js @@ -44,5 +44,11 @@ module.exports = (embark) => { embark.addConsoleProviderInit('blockchain', code, shouldInit); }); + + embark.events.setCommandHandler('blockchain:connector:ready', (cb) => { + pathPromise.then((_web3Location) => { + cb(); + }); + }); }); }; diff --git a/test_dapps/contracts_app/contracts.json b/test_dapps/contracts_app/contracts.json index 2b0dfc599..253b36b80 100644 --- a/test_dapps/contracts_app/contracts.json +++ b/test_dapps/contracts_app/contracts.json @@ -1,7 +1,6 @@ { "default": { "versions": { - "web3": "1.0.0-beta.27", "solc": "0.4.24" }, "deployment": { diff --git a/test_dapps/contracts_app/embark.json b/test_dapps/contracts_app/embark.json index 58aff9197..70fed5a5b 100644 --- a/test_dapps/contracts_app/embark.json +++ b/test_dapps/contracts_app/embark.json @@ -1,5 +1,7 @@ { - "contracts": ["contracts/**"], + "contracts": [ + "contracts/**" + ], "app": {}, "buildDir": "build/", "config": { @@ -12,5 +14,8 @@ "versions": { "web3": "1.0.0-beta", "solc": "0.4.24" + }, + "plugins": { + "web3Connector": {} } } diff --git a/test_dapps/contracts_app/package.json b/test_dapps/contracts_app/package.json index 6e57991f5..d36be6268 100644 --- a/test_dapps/contracts_app/package.json +++ b/test_dapps/contracts_app/package.json @@ -1,7 +1,8 @@ { "devDependencies": { "embark": "4.0.0-beta.0", - "rimraf": "2.6.3" + "rimraf": "2.6.3", + "web3Connector": "file:../../../packages/web3Connector" }, "name": "contracts_app", "private": true,