mirror of https://github.com/embarklabs/embark.git
wip working
This commit is contained in:
parent
b6c75ce070
commit
15ad24f002
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue