diff options
author | Fabio Berger <me@fabioberger.com> | 2017-05-31 16:33:22 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-05-31 16:33:22 +0800 |
commit | d1d66f563581c7f56d4956903cfb1b23d149cf18 (patch) | |
tree | b742c576ba57e535b8a7f5ca90d7562bcef63f22 /src/contract_wrappers | |
parent | 274fe87da754ac45cecd6c19123a1c144d4c4080 (diff) | |
download | dexon-sol-tools-d1d66f563581c7f56d4956903cfb1b23d149cf18.tar dexon-sol-tools-d1d66f563581c7f56d4956903cfb1b23d149cf18.tar.gz dexon-sol-tools-d1d66f563581c7f56d4956903cfb1b23d149cf18.tar.bz2 dexon-sol-tools-d1d66f563581c7f56d4956903cfb1b23d149cf18.tar.lz dexon-sol-tools-d1d66f563581c7f56d4956903cfb1b23d149cf18.tar.xz dexon-sol-tools-d1d66f563581c7f56d4956903cfb1b23d149cf18.tar.zst dexon-sol-tools-d1d66f563581c7f56d4956903cfb1b23d149cf18.zip |
Remove superfluous undefined check
Diffstat (limited to 'src/contract_wrappers')
-rw-r--r-- | src/contract_wrappers/token_wrapper.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/contract_wrappers/token_wrapper.ts b/src/contract_wrappers/token_wrapper.ts index 9e496b648..928b67a03 100644 --- a/src/contract_wrappers/token_wrapper.ts +++ b/src/contract_wrappers/token_wrapper.ts @@ -30,7 +30,7 @@ export class TokenWrapper extends ContractWrapper { let balance = await tokenContract.balanceOf.call(ownerAddress); // The BigNumber instance returned by Web3 is of a much older version then our own, we therefore // should always re-instantiate the returned BigNumber after retrieval. - balance = _.isUndefined(balance) ? new BigNumber(0) : new BigNumber(balance); + balance = new BigNumber(balance); return balance; } /** @@ -44,9 +44,7 @@ export class TokenWrapper extends ContractWrapper { const tokenContract = await this.getTokenContractAsync(tokenAddress); const proxyAddress = await this.getProxyAddressAsync(); let allowanceInBaseUnits = await tokenContract.allowance.call(ownerAddress, proxyAddress); - allowanceInBaseUnits = _.isUndefined(allowanceInBaseUnits) ? - new BigNumber(0) : - new BigNumber(allowanceInBaseUnits); + allowanceInBaseUnits = new BigNumber(allowanceInBaseUnits); return allowanceInBaseUnits; } /** |