diff options
author | Fabio Berger <me@fabioberger.com> | 2017-06-26 05:48:48 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-06-26 05:48:48 +0800 |
commit | a2c495a9830170173e5024b2e8e44e99cc319d06 (patch) | |
tree | 72970fcb1e6f066e1cefcbee2c1c3c1153619ee1 | |
parent | 13dfc263b6fd8457c542a6ea3fbb69a3ad30e7b4 (diff) | |
download | dexon-sol-tools-a2c495a9830170173e5024b2e8e44e99cc319d06.tar dexon-sol-tools-a2c495a9830170173e5024b2e8e44e99cc319d06.tar.gz dexon-sol-tools-a2c495a9830170173e5024b2e8e44e99cc319d06.tar.bz2 dexon-sol-tools-a2c495a9830170173e5024b2e8e44e99cc319d06.tar.lz dexon-sol-tools-a2c495a9830170173e5024b2e8e44e99cc319d06.tar.xz dexon-sol-tools-a2c495a9830170173e5024b2e8e44e99cc319d06.tar.zst dexon-sol-tools-a2c495a9830170173e5024b2e8e44e99cc319d06.zip |
Re-wrap BigNumber returned from web3 in `getBalanceInEthAsync`
-rw-r--r-- | src/web3_wrapper.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/web3_wrapper.ts b/src/web3_wrapper.ts index 6bdca499f..afecbec7f 100644 --- a/src/web3_wrapper.ts +++ b/src/web3_wrapper.ts @@ -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> { |