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