aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-05-31 16:33:22 +0800
committerFabio Berger <me@fabioberger.com>2017-05-31 16:33:22 +0800
commitd1d66f563581c7f56d4956903cfb1b23d149cf18 (patch)
treeb742c576ba57e535b8a7f5ca90d7562bcef63f22
parent274fe87da754ac45cecd6c19123a1c144d4c4080 (diff)
downloaddexon-0x-contracts-d1d66f563581c7f56d4956903cfb1b23d149cf18.tar.gz
dexon-0x-contracts-d1d66f563581c7f56d4956903cfb1b23d149cf18.tar.zst
dexon-0x-contracts-d1d66f563581c7f56d4956903cfb1b23d149cf18.zip
Remove superfluous undefined check
-rw-r--r--src/contract_wrappers/token_wrapper.ts6
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;
}
/**