accounts being passed around

This commit is contained in:
Andre Medeiros 2019-08-08 12:00:27 -04:00
parent 594e5f630a
commit 91fb1a74bc
1 changed files with 16 additions and 1 deletions

View File

@ -266,6 +266,8 @@ class TestRunner {
runJSTests(files, options, cb) {
const {events} = this.embark;
let accounts = [];
let compiledContracts;
let web3;
@ -283,7 +285,7 @@ class TestRunner {
next();
}
], (_err) => {
acctCb([]);
acctCb(accounts);
done();
});
});
@ -297,6 +299,14 @@ class TestRunner {
web3 = new Web3(bcProvider);
next();
},
(next) => { // get accounts
web3.eth.getAccounts((accts) => {
console.log('got accounts from web3');
console.dir(accts);
accounts = accts;
next();
});
},
(next) => { // get contract files
console.log('getting contract files');
events.request("config:contractsFiles", next);
@ -321,8 +331,13 @@ class TestRunner {
next();
},
(next) => { // setup global namespace
const originalDescribe = global.describe;
global.assert = assert;
global.config = config;
global.describe = (scenario, cb) => {
originalDescribe(scenario, cb(accounts));
};
global.contract = global.describe;
next();
},