fix(embarkjs/web3): make global web3 available again

This commit is contained in:
Jonathan Rainville 2018-12-11 10:12:11 -05:00
parent d10d906ee7
commit 6e4a612fef
3 changed files with 9 additions and 8 deletions

View File

@ -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",

View File

@ -4,6 +4,7 @@ const __embarkWeb3 = {};
__embarkWeb3.init = function (_config) {
this.web3 = new Web3();
global.web3 = this.web3;
};
__embarkWeb3.getAccounts = function () {

View File

@ -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();
@ -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) {