Merge pull request #885 from embark-framework/bugfix/blockchain-not-done

Bugfix/blockchain not done
This commit is contained in:
Anthony Laibe 2018-09-21 15:11:20 +01:00 committed by GitHub
commit 1b649d0e3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -314,6 +314,7 @@ class EmbarkController {
web3Endpoint: web3Config.providerUrl
};
const provider = new Provider(providerOptions);
web3.eth.defaultAccount = web3Config.defaultAccount;
provider.startWeb3Provider(() => {
engine.events.emit("runcode:register", "web3", web3);
async.each(commands, ({varName, code}, next) => {

View File

@ -79,11 +79,12 @@ class Console {
this.events.emit('runcode:register', 'Web3', Web3, false);
this.events.emit('runcode:register', 'EmbarkJS', EmbarkJS, false);
this.events.once('code-generator-ready', () => {
EmbarkJS.Blockchain.done = true;
if (this.ipc.connected) {
return;
}
this.events.once('code-generator-ready', () => {
this.events.request('code-generator:embarkjs:provider-code', (code) => {
const func = () => {};
this.events.request('runcode:eval', code, func, true);