Re-wrap BigNumber returned from web3 in getBalanceInEthAsync

This commit is contained in:
Fabio Berger
2017-06-25 14:48:48 -07:00
parent 13dfc263b6
commit a2c495a983

View File

@@ -36,7 +36,8 @@ export class Web3Wrapper {
}
public async getBalanceInEthAsync(owner: string): Promise<BigNumber.BigNumber> {
const balanceInWei = await promisify(this.web3.eth.getBalance)(owner);
const balanceEth = this.web3.fromWei(balanceInWei, 'ether');
let balanceEth = this.web3.fromWei(balanceInWei, 'ether');
balanceEth = new BigNumber(balanceEth);
return balanceEth;
}
public async doesContractExistAtAddressAsync(address: string): Promise<boolean> {