Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Update json-schemas for contract-wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
albrow committed Oct 16, 2018
1 parent 38b146c commit e093864
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 87 deletions.
7 changes: 1 addition & 6 deletions packages/contract-wrappers/src/contract_wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import { ExchangeWrapper } from './contract_wrappers/exchange_wrapper';
import { ForwarderWrapper } from './contract_wrappers/forwarder_wrapper';
import { OrderValidatorWrapper } from './contract_wrappers/order_validator_wrapper';
import { ContractWrappersConfigSchema } from './schemas/contract_wrappers_config_schema';
import { contractWrappersPrivateNetworkConfigSchema } from './schemas/contract_wrappers_private_network_config_schema';
import { contractWrappersPublicNetworkConfigSchema } from './schemas/contract_wrappers_public_network_config_schema';
import { ContractWrappersConfig } from './types';
import { assert } from './utils/assert';
import { constants } from './utils/constants';
Expand Down Expand Up @@ -78,10 +76,7 @@ export class ContractWrappers {
*/
constructor(provider: Provider, config: ContractWrappersConfig) {
assert.isWeb3Provider('provider', provider);
assert.doesConformToSchema('config', config, ContractWrappersConfigSchema, [
contractWrappersPrivateNetworkConfigSchema,
contractWrappersPublicNetworkConfigSchema,
]);
assert.doesConformToSchema('config', config, ContractWrappersConfigSchema);
const txDefaults = {
gasPrice: config.gasPrice,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
export const ContractWrappersConfigSchema = {
id: '/ContractWrappersConfig',
oneOf: [{ $ref: '/ZeroExContractPrivateNetworkConfig' }, { $ref: '/ZeroExContractPublicNetworkConfig' }],
properties: {
networkId: {
type: 'number',
},
gasPrice: { $ref: '/numberSchema' },
contractAddresses: {
type: 'object',
properties: {
erc20Proxy: { $ref: '/addressSchema' },
erc721Proxy: { $ref: '/addressSchema' },
zrxToken: { $ref: '/addressSchema' },
etherToken: { $ref: '/addressSchema' },
exchange: { $ref: '/addressSchema' },
assetProxyOwner: { $ref: '/addressSchema' },
forwarder: { $ref: '/addressSchema' },
orderValidator: { $ref: '/addressSchema' },
},
},
blockPollingIntervalMs: { type: 'number' },
},
type: 'object',
required: ['networkId'],
};

This file was deleted.

This file was deleted.

0 comments on commit e093864

Please sign in to comment.