aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers/token_wrapper.ts
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-06-03 01:53:01 +0800
committerGitHub <noreply@github.com>2017-06-03 01:53:01 +0800
commit5925f81fe185a90efaa82dd90bd8d65d74326f11 (patch)
tree12daf7aec686c576634b2daa5a58af2831cc497d /src/contract_wrappers/token_wrapper.ts
parent2ff8f4ca6ed238f331cb69aaeb912a94b3df901e (diff)
parent35c9330d6246183509a3543cdf1278b9ced191e2 (diff)
downloaddexon-sol-tools-5925f81fe185a90efaa82dd90bd8d65d74326f11.tar
dexon-sol-tools-5925f81fe185a90efaa82dd90bd8d65d74326f11.tar.gz
dexon-sol-tools-5925f81fe185a90efaa82dd90bd8d65d74326f11.tar.bz2
dexon-sol-tools-5925f81fe185a90efaa82dd90bd8d65d74326f11.tar.lz
dexon-sol-tools-5925f81fe185a90efaa82dd90bd8d65d74326f11.tar.xz
dexon-sol-tools-5925f81fe185a90efaa82dd90bd8d65d74326f11.tar.zst
dexon-sol-tools-5925f81fe185a90efaa82dd90bd8d65d74326f11.zip
Merge pull request #31 from 0xProject/unavailableFilledCancelled
Implement Unavailable, Filled and Cancelled
Diffstat (limited to 'src/contract_wrappers/token_wrapper.ts')
-rw-r--r--src/contract_wrappers/token_wrapper.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/contract_wrappers/token_wrapper.ts b/src/contract_wrappers/token_wrapper.ts
index cedbfbdae..69bcc9024 100644
--- a/src/contract_wrappers/token_wrapper.ts
+++ b/src/contract_wrappers/token_wrapper.ts
@@ -28,8 +28,7 @@ export class TokenWrapper extends ContractWrapper {
const tokenContract = await this.getTokenContractAsync(tokenAddress);
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.
+ // Wrap BigNumbers returned from web3 with our own (later) version of BigNumber
balance = new BigNumber(balance);
return balance;
}
@@ -44,6 +43,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);
+ // Wrap BigNumbers returned from web3 with our own (later) version of BigNumber
allowanceInBaseUnits = new BigNumber(allowanceInBaseUnits);
return allowanceInBaseUnits;
}