aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/src/0x.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-02-24 05:20:28 +0800
committerGitHub <noreply@github.com>2018-02-24 05:20:28 +0800
commit10c0c0b6d2fce2a08858cd7ec280ed72d3da0b32 (patch)
treedb5b0c66958d8ea6f77e0bdcf0e1bae2fdb13af1 /packages/0x.js/src/0x.ts
parent3d2c5d67afb6a754ed7a0b883ff93bf330660eff (diff)
parent3120d854f855a01ad7bce3427a64d931de1879d3 (diff)
downloaddexon-sol-tools-10c0c0b6d2fce2a08858cd7ec280ed72d3da0b32.tar
dexon-sol-tools-10c0c0b6d2fce2a08858cd7ec280ed72d3da0b32.tar.gz
dexon-sol-tools-10c0c0b6d2fce2a08858cd7ec280ed72d3da0b32.tar.bz2
dexon-sol-tools-10c0c0b6d2fce2a08858cd7ec280ed72d3da0b32.tar.lz
dexon-sol-tools-10c0c0b6d2fce2a08858cd7ec280ed72d3da0b32.tar.xz
dexon-sol-tools-10c0c0b6d2fce2a08858cd7ec280ed72d3da0b32.tar.zst
dexon-sol-tools-10c0c0b6d2fce2a08858cd7ec280ed72d3da0b32.zip
Merge pull request #385 from 0xProject/feature/0x_config_validation
Better validate ZeroExConfig on private networks
Diffstat (limited to 'packages/0x.js/src/0x.ts')
-rw-r--r--packages/0x.js/src/0x.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/0x.js/src/0x.ts b/packages/0x.js/src/0x.ts
index 6cfa65cc2..c578478d8 100644
--- a/packages/0x.js/src/0x.ts
+++ b/packages/0x.js/src/0x.ts
@@ -13,6 +13,8 @@ import { TokenTransferProxyWrapper } from './contract_wrappers/token_transfer_pr
import { TokenWrapper } from './contract_wrappers/token_wrapper';
import { OrderStateWatcher } from './order_watcher/order_state_watcher';
import { zeroExConfigSchema } from './schemas/zero_ex_config_schema';
+import { zeroExPrivateNetworkConfigSchema } from './schemas/zero_ex_private_network_config_schema';
+import { zeroExPublicNetworkConfigSchema } from './schemas/zero_ex_public_network_config_schema';
import { ECSignature, Order, SignedOrder, Web3Provider, ZeroExConfig, ZeroExError } from './types';
import { assert } from './utils/assert';
import { constants } from './utils/constants';
@@ -163,7 +165,10 @@ export class ZeroEx {
*/
constructor(provider: Web3Provider, config: ZeroExConfig) {
assert.isWeb3Provider('provider', provider);
- assert.doesConformToSchema('config', config, zeroExConfigSchema);
+ assert.doesConformToSchema('config', config, zeroExConfigSchema, [
+ zeroExPrivateNetworkConfigSchema,
+ zeroExPublicNetworkConfigSchema,
+ ]);
const artifactJSONs = _.values(artifacts);
const abiArrays = _.map(artifactJSONs, artifact => artifact.abi);
this._abiDecoder = new AbiDecoder(abiArrays);