Skip to content

Commit

Permalink
fix(embarkjs/web3): make global web3 available again
Browse files Browse the repository at this point in the history
  • Loading branch information
jrainville committed Dec 11, 2018
1 parent d10d906 commit 6e4a612
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,18 @@
"viz.js": "1.8.2",
"web3": "1.0.0-beta.34",
"web3-bzz": "1.0.0-beta.34",
"web3-core": "1.0.0-beta.34",
"web3-core-helpers": "1.0.0-beta.34",
"web3-core-method": "1.0.0-beta.34",
"web3-core-promievent": "1.0.0-beta.34",
"web3-core-requestmanager": "1.0.0-beta.34",
"web3-core-subscriptions": "1.0.0-beta.34",
"web3-core": "1.0.0-beta.34",
"web3-eth": "1.0.0-beta.34",
"web3-eth-abi": "1.0.0-beta.34",
"web3-eth-accounts": "1.0.0-beta.34",
"web3-eth-contract": "1.0.0-beta.34",
"web3-eth-iban": "1.0.0-beta.34",
"web3-eth-personal": "1.0.0-beta.34",
"web3-eth": "1.0.0-beta.34",
"web3-net": "1.0.0-beta.34",
"web3-providers-http": "1.0.0-beta.34",
"web3-providers-ipc": "1.0.0-beta.34",
Expand Down
1 change: 1 addition & 0 deletions src/lib/modules/blockchain_connector/embarkjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const __embarkWeb3 = {};

__embarkWeb3.init = function (_config) {
this.web3 = new Web3();
global.web3 = this.web3;
};

__embarkWeb3.getAccounts = function () {
Expand Down
12 changes: 6 additions & 6 deletions src/lib/modules/tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,6 @@ class Test {
function checkDeploymentOpts(next) {
self.checkDeploymentOptions(options, next);
},
function changeGlobalWeb3(next) {
self.events.request('blockchain:get', (web3) => {
global.web3 = web3;
next();
});
},
function compileContracts(next) {
if (!self.firstDeployment) {
return next();
Expand All @@ -212,6 +206,12 @@ class Test {
self.events.emit('tests:ready');
next(null, accounts);
});
},
function changeGlobalWeb3(accounts, next) {
self.events.request('blockchain:get', (web3) => {
global.web3 = web3;
next(null, accounts);
});
}
], (err, accounts) => {
if (err) {
Expand Down

0 comments on commit 6e4a612

Please sign in to comment.