wip working

This commit is contained in:
Jonathan Rainville 2018-07-05 08:38:19 -04:00
parent df9134b787
commit 817c4a6209
1 changed files with 9 additions and 7 deletions

View File

@ -36,19 +36,21 @@ class Provider {
self.web3.eth.accounts.wallet.add(account);
});
self.realAccountFunction = self.web3.eth.getAccounts;
self.web3.eth.defaultAccount = self.addresses[0];
const realAccountFunction = self.web3.eth.getAccounts;
self.web3.eth.getAccounts = function (cb) {
if (!cb) {
cb = function () {
};
}
cb = cb || function () {};
return new Promise((resolve, reject) => {
self.realAccountFunction((err, accounts) => {
realAccountFunction((err, accounts) => {
if (err) {
cb(err);
return reject(err);
}
accounts = accounts.concat(self.addresses);
// console.log('ACOUNTS', accounts);
// console.log('My addresses', self.addresses);
// accounts = self.addresses;
accounts = [accounts[0]].concat(self.addresses);
// accounts = accounts.concat(self.addresses);
// accounts = self.addresses.concat(accounts);
cb(null, accounts);
resolve(accounts);