aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-27 02:20:16 +0800
committerFabio Berger <me@fabioberger.com>2017-06-27 02:20:16 +0800
commit41098c6a35cc483b30ddc0566ca18c98b1548364 (patch)
tree60423f854104469db396e113f50cb69988fec560 /src/contract_wrappers
parent0f413febd3cf2798a9be1149b1ef7ddd3550f7d0 (diff)
downloaddexon-sol-tools-41098c6a35cc483b30ddc0566ca18c98b1548364.tar
dexon-sol-tools-41098c6a35cc483b30ddc0566ca18c98b1548364.tar.gz
dexon-sol-tools-41098c6a35cc483b30ddc0566ca18c98b1548364.tar.bz2
dexon-sol-tools-41098c6a35cc483b30ddc0566ca18c98b1548364.tar.lz
dexon-sol-tools-41098c6a35cc483b30ddc0566ca18c98b1548364.tar.xz
dexon-sol-tools-41098c6a35cc483b30ddc0566ca18c98b1548364.tar.zst
dexon-sol-tools-41098c6a35cc483b30ddc0566ca18c98b1548364.zip
refactor getBalanceInEthAsync to getBalanceInWeiAsync and change the test assertions to check if the discrepancy between the existing ETH balance and expected balance is small enough to simply be the gas cost used by the transaction.
Diffstat (limited to 'src/contract_wrappers')
-rw-r--r--src/contract_wrappers/ether_token_wrapper.ts3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/contract_wrappers/ether_token_wrapper.ts b/src/contract_wrappers/ether_token_wrapper.ts
index e8efbc9a6..76e7289b7 100644
--- a/src/contract_wrappers/ether_token_wrapper.ts
+++ b/src/contract_wrappers/ether_token_wrapper.ts
@@ -28,8 +28,7 @@ export class EtherTokenWrapper extends ContractWrapper {
assert.isBigNumber('amountInWei', amountInWei);
await assert.isSenderAddressAsync('depositor', depositor, this._web3Wrapper);
- const ethBalance = await this._web3Wrapper.getBalanceInEthAsync(depositor);
- const ethBalanceInWei = this._web3Wrapper.toWei(ethBalance);
+ const ethBalanceInWei = await this._web3Wrapper.getBalanceInWeiAsync(depositor);
assert.assert(ethBalanceInWei.gte(amountInWei), ZeroExError.INSUFFICIENT_ETH_BALANCE_FOR_DEPOSIT);
const wethContract = await this._getEtherTokenContractAsync();