diff --git a/lib/contracts/provider.js b/lib/contracts/provider.js index b6985ff7..149cf908 100644 --- a/lib/contracts/provider.js +++ b/lib/contracts/provider.js @@ -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);