mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-13 07:36:21 +00:00
cleanup
This commit is contained in:
parent
a706dd0638
commit
019750b85f
@ -21,8 +21,6 @@ class Blockchain {
|
||||
this.web3StartedInProcess = false;
|
||||
|
||||
self.events.setCommandHandler("blockchain:web3:isReady", (cb) => {
|
||||
console.dir("geting state of web3");
|
||||
console.dir(self.isWeb3Ready.toString());
|
||||
cb(self.isWeb3Ready);
|
||||
});
|
||||
|
||||
@ -45,7 +43,6 @@ class Blockchain {
|
||||
if (this.contractsConfig.deployment.type !== "rpc" && this.contractsConfig.deployment.type !== "ws") {
|
||||
const message = __("contracts config error: unknown deployment type %s", this.contractsConfig.deployment.type);
|
||||
this.logger.error(message);
|
||||
//return cb(message);
|
||||
}
|
||||
|
||||
const protocol = (this.contractsConfig.deployment.type === "rpc") ? this.contractsConfig.deployment.protocol : 'ws';
|
||||
@ -64,17 +61,11 @@ class Blockchain {
|
||||
this.provider = new Provider(providerOptions);
|
||||
|
||||
self.events.request("processes:launch", "blockchain", () => {
|
||||
console.dir("======> blockchain launched!");
|
||||
console.dir("starting web3 provider");
|
||||
self.provider.startWeb3Provider(() => {
|
||||
console.dir("funding accounts");
|
||||
self.provider.fundAccounts(() => {
|
||||
console.dir("registering web3 object");
|
||||
self.isWeb3Ready = true;
|
||||
self.events.emit(WEB3_READY);
|
||||
self.registerWeb3Object();
|
||||
|
||||
//self.events.emit("check:backOnline:Ethereum");
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -97,14 +88,11 @@ class Blockchain {
|
||||
}
|
||||
|
||||
onReady(callback) {
|
||||
console.dir("======> onReady!!");
|
||||
console.dir("this.isWeb3Ready: " + this.isWeb3Ready.toString());
|
||||
if (this.isWeb3Ready) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
this.events.once(WEB3_READY, () => {
|
||||
console.dir("got event triggered");
|
||||
callback();
|
||||
});
|
||||
}
|
||||
@ -146,7 +134,6 @@ class Blockchain {
|
||||
if (err && err !== NO_NODE) {
|
||||
return cb(err);
|
||||
}
|
||||
console.dir(statusObj);
|
||||
cb(statusObj);
|
||||
});
|
||||
}, 5000, 'off');
|
||||
@ -198,10 +185,8 @@ class Blockchain {
|
||||
}
|
||||
|
||||
getGasPrice(cb) {
|
||||
console.dir("geting gas price");
|
||||
const self = this;
|
||||
this.onReady(() => {
|
||||
console.dir("it's ready, getting gas price");
|
||||
self.web3.eth.getGasPrice(cb);
|
||||
});
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ const async = require('async');
|
||||
const Viz = require('viz.js');
|
||||
const fs = require('fs');
|
||||
|
||||
// TODO: refactor this class to use the plugin api and not refeneences directly
|
||||
class GraphGenerator {
|
||||
constructor(embark, _options) {
|
||||
const self = this;
|
||||
|
Loading…
x
Reference in New Issue
Block a user