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.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) {
|
self.web3.eth.getAccounts = function (cb) {
|
||||||
if (!cb) {
|
cb = cb || function () {};
|
||||||
cb = function () {
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
self.realAccountFunction((err, accounts) => {
|
realAccountFunction((err, accounts) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
cb(err);
|
cb(err);
|
||||||
return reject(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);
|
// accounts = self.addresses.concat(accounts);
|
||||||
cb(null, accounts);
|
cb(null, accounts);
|
||||||
resolve(accounts);
|
resolve(accounts);
|
||||||
|
|
Loading…
Reference in New Issue