aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers/token_wrapper.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-03 02:39:02 +0800
committerFabio Berger <me@fabioberger.com>2017-06-03 02:39:02 +0800
commit36e937f8de348cfdb35ff8f72504aed1dfab07b2 (patch)
treee8e0ba5b603f07bddf6cd01329e001b06b5987dd /src/contract_wrappers/token_wrapper.ts
parentc6ceb44682a19c9f53505803547fcb2012691b5b (diff)
parent5925f81fe185a90efaa82dd90bd8d65d74326f11 (diff)
downloaddexon-sol-tools-36e937f8de348cfdb35ff8f72504aed1dfab07b2.tar
dexon-sol-tools-36e937f8de348cfdb35ff8f72504aed1dfab07b2.tar.gz
dexon-sol-tools-36e937f8de348cfdb35ff8f72504aed1dfab07b2.tar.bz2
dexon-sol-tools-36e937f8de348cfdb35ff8f72504aed1dfab07b2.tar.lz
dexon-sol-tools-36e937f8de348cfdb35ff8f72504aed1dfab07b2.tar.xz
dexon-sol-tools-36e937f8de348cfdb35ff8f72504aed1dfab07b2.tar.zst
dexon-sol-tools-36e937f8de348cfdb35ff8f72504aed1dfab07b2.zip
Merge branch 'master' into remainingTokenMethods
# Conflicts: # src/contract_wrappers/token_wrapper.ts
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 8bec39a52..c8b557d0d 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;
}
@@ -64,6 +63,7 @@ export class TokenWrapper extends ContractWrapper {
const tokenContract = await this.getTokenContractAsync(tokenAddress);
let allowanceInBaseUnits = await tokenContract.allowance.call(ownerAddress, spenderAddress);
+ // Wrap BigNumbers returned from web3 with our own (later) version of BigNumber
allowanceInBaseUnits = new BigNumber(allowanceInBaseUnits);
return allowanceInBaseUnits;
}