diff options
author | Fabio Berger <me@fabioberger.com> | 2018-07-19 23:48:06 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-07-19 23:48:06 +0800 |
commit | d8898cf9a30cc349868afcf2b78e6369e57aa726 (patch) | |
tree | f96d1aa76c7e5aa9e3311d5cdbd0d31c8ec8d7fb /packages/web3-wrapper/src/utils.ts | |
parent | 1aaf633df883f62fad890b2d87a2dc89067821c5 (diff) | |
parent | 3de88d5345c7a4549bc69e2ca28f0601f5d42189 (diff) | |
download | dexon-sol-tools-d8898cf9a30cc349868afcf2b78e6369e57aa726.tar dexon-sol-tools-d8898cf9a30cc349868afcf2b78e6369e57aa726.tar.gz dexon-sol-tools-d8898cf9a30cc349868afcf2b78e6369e57aa726.tar.bz2 dexon-sol-tools-d8898cf9a30cc349868afcf2b78e6369e57aa726.tar.lz dexon-sol-tools-d8898cf9a30cc349868afcf2b78e6369e57aa726.tar.xz dexon-sol-tools-d8898cf9a30cc349868afcf2b78e6369e57aa726.tar.zst dexon-sol-tools-d8898cf9a30cc349868afcf2b78e6369e57aa726.zip |
merge v2-prototype
Diffstat (limited to 'packages/web3-wrapper/src/utils.ts')
-rw-r--r-- | packages/web3-wrapper/src/utils.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/web3-wrapper/src/utils.ts b/packages/web3-wrapper/src/utils.ts index d13eb9404..01605dc9a 100644 --- a/packages/web3-wrapper/src/utils.ts +++ b/packages/web3-wrapper/src/utils.ts @@ -15,7 +15,7 @@ export const utils = { if (_.isNull(hex)) { return null; } - const decimal = this.convertHexToNumber(hex); + const decimal = utils.convertHexToNumber(hex); return decimal; }, convertAmountToBigNumber(value: string | number | BigNumber): BigNumber { @@ -40,7 +40,7 @@ export const utils = { return valueBigNumber.lessThan(0) ? '-0x' + valueHex.substr(1) : '0x' + valueHex; }, numberToHex(value: number): string { - if (!isFinite(value) && !this.isHexStrict(value)) { + if (!isFinite(value) && !utils.isHexStrict(value)) { throw new Error(`Given input ${value} is not a number.`); } |