aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-06-10 02:19:49 +0800
committerGitHub <noreply@github.com>2017-06-10 02:19:49 +0800
commitaefa147ba0e36f7ec302a5f5b6f496cabf784599 (patch)
treeed24d8f87f57b90380d8167b35c5019005a94aba /src
parentba27da965b9ee59224a1561cbacb0d1db0800177 (diff)
parent478125f3d4feccd3b8396773888d65798af8287f (diff)
downloaddexon-sol-tools-aefa147ba0e36f7ec302a5f5b6f496cabf784599.tar
dexon-sol-tools-aefa147ba0e36f7ec302a5f5b6f496cabf784599.tar.gz
dexon-sol-tools-aefa147ba0e36f7ec302a5f5b6f496cabf784599.tar.bz2
dexon-sol-tools-aefa147ba0e36f7ec302a5f5b6f496cabf784599.tar.lz
dexon-sol-tools-aefa147ba0e36f7ec302a5f5b6f496cabf784599.tar.xz
dexon-sol-tools-aefa147ba0e36f7ec302a5f5b6f496cabf784599.tar.zst
dexon-sol-tools-aefa147ba0e36f7ec302a5f5b6f496cabf784599.zip
Merge branch 'master' into schema-tests
Diffstat (limited to 'src')
-rw-r--r--src/0x.js.ts6
-rw-r--r--src/utils/constants.ts1
2 files changed, 3 insertions, 4 deletions
diff --git a/src/0x.js.ts b/src/0x.js.ts
index 2bf8cad5e..01820d075 100644
--- a/src/0x.js.ts
+++ b/src/0x.js.ts
@@ -22,8 +22,6 @@ import {orderSchema} from './schemas/order_schemas';
// Customize our BigNumber instances
bigNumberConfigs.configure();
-const MAX_DIGITS_IN_UNSIGNED_256_INT = 78;
-
export class ZeroEx {
public static NULL_ADDRESS = constants.NULL_ADDRESS;
@@ -62,8 +60,8 @@ export class ZeroEx {
public static generatePseudoRandomSalt(): BigNumber.BigNumber {
// BigNumber.random returns a pseudo-random number between 0 & 1 with a passed in number of decimal places.
// Source: https://mikemcl.github.io/bignumber.js/#random
- const randomNumber = BigNumber.random(MAX_DIGITS_IN_UNSIGNED_256_INT);
- const factor = new BigNumber(10).pow(MAX_DIGITS_IN_UNSIGNED_256_INT - 1);
+ const randomNumber = BigNumber.random(constants.MAX_DIGITS_IN_UNSIGNED_256_INT);
+ const factor = new BigNumber(10).pow(constants.MAX_DIGITS_IN_UNSIGNED_256_INT - 1);
const salt = randomNumber.times(factor).round();
return salt;
}
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index 5a5ba0e0a..fef0a91a0 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -1,4 +1,5 @@
export const constants = {
NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
TESTRPC_NETWORK_ID: 50,
+ MAX_DIGITS_IN_UNSIGNED_256_INT: 78,
};