From 0ffc767f92e7dc81b6380b9db0c8179970124862 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 27 Jul 2018 16:03:15 -0400 Subject: [PATCH] get blockchain object from event bus --- lib/contracts/blockchain.js | 4 ++++ lib/core/engine.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/contracts/blockchain.js b/lib/contracts/blockchain.js index a4454c9e..51e5dd1b 100644 --- a/lib/contracts/blockchain.js +++ b/lib/contracts/blockchain.js @@ -24,6 +24,10 @@ class BlockchainConnector { cb(self.isWeb3Ready); }); + self.events.setCommandHandler("blockchain:object", (cb) => { + cb(self); + }); + if (!this.web3) { this.initWeb3(); } else { diff --git a/lib/core/engine.js b/lib/core/engine.js index fb8a68d8..0a04588b 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -218,7 +218,7 @@ class Engine { this.registerModule('blockchain_connector', { isDev: this.isDev, web3: options.web3 - }); + })); /*eslint no-new: "off"*/ this.registerModule('whisper'); }