aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/src
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-12-21 16:33:57 +0800
committerFabio Berger <me@fabioberger.com>2017-12-21 16:33:57 +0800
commit85e16c1233fc2c7020c2556cd79ac7d53cee4c98 (patch)
tree8a2463e38f9c9e84179dd06da52893b740a613a9 /packages/0x.js/src
parent42b3a7c9d756dd2c68256707c0c96a95370329bd (diff)
downloaddexon-sol-tools-85e16c1233fc2c7020c2556cd79ac7d53cee4c98.tar
dexon-sol-tools-85e16c1233fc2c7020c2556cd79ac7d53cee4c98.tar.gz
dexon-sol-tools-85e16c1233fc2c7020c2556cd79ac7d53cee4c98.tar.bz2
dexon-sol-tools-85e16c1233fc2c7020c2556cd79ac7d53cee4c98.tar.lz
dexon-sol-tools-85e16c1233fc2c7020c2556cd79ac7d53cee4c98.tar.xz
dexon-sol-tools-85e16c1233fc2c7020c2556cd79ac7d53cee4c98.tar.zst
dexon-sol-tools-85e16c1233fc2c7020c2556cd79ac7d53cee4c98.zip
Make assertion stricter so that one cannot submit invalid baseUnit amounts to `toUnitAmount`
Diffstat (limited to 'packages/0x.js/src')
-rw-r--r--packages/0x.js/src/0x.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/0x.js/src/0x.ts b/packages/0x.js/src/0x.ts
index 7393cc814..596d6ffba 100644
--- a/packages/0x.js/src/0x.ts
+++ b/packages/0x.js/src/0x.ts
@@ -128,7 +128,7 @@ export class ZeroEx {
* @return The amount in units.
*/
public static toUnitAmount(amount: BigNumber, decimals: number): BigNumber {
- assert.isBigNumber('amount', amount);
+ assert.isValidBaseUnitAmount('amount', amount);
assert.isNumber('decimals', decimals);
const aUnit = new BigNumber(10).pow(decimals);