diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-10 14:10:33 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-16 04:38:33 +0800 |
commit | 1e9ea09f087c7b3120e758d931a88812b655da08 (patch) | |
tree | b0da3efc0733d566356ed2a938d18eb08192f674 /packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts | |
parent | fa346d94613a43034e1cdaf6b7a3d2de270c58fc (diff) | |
download | dexon-0x-contracts-1e9ea09f087c7b3120e758d931a88812b655da08.tar dexon-0x-contracts-1e9ea09f087c7b3120e758d931a88812b655da08.tar.gz dexon-0x-contracts-1e9ea09f087c7b3120e758d931a88812b655da08.tar.bz2 dexon-0x-contracts-1e9ea09f087c7b3120e758d931a88812b655da08.tar.lz dexon-0x-contracts-1e9ea09f087c7b3120e758d931a88812b655da08.tar.xz dexon-0x-contracts-1e9ea09f087c7b3120e758d931a88812b655da08.tar.zst dexon-0x-contracts-1e9ea09f087c7b3120e758d931a88812b655da08.zip |
Introduce new contract-addresses package and use it everywhere
Diffstat (limited to 'packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts')
-rw-r--r-- | packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts index cb67d57f7..b7bdfb149 100644 --- a/packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts @@ -22,12 +22,14 @@ export class OrderValidatorWrapper extends ContractWrapper { /** * Instantiate OrderValidatorWrapper * @param web3Wrapper Web3Wrapper instance to use. - * @param address The address of the OrderValidator contract. + * @param networkId Desired networkId. + * @param address (Optional) The address of the OrderValidator contract. If + * undefined, will default to the known address corresponding to the + * networkId. */ - // TODO(albrow): Make address optional? - constructor(web3Wrapper: Web3Wrapper, address: string) { - super(web3Wrapper); - this.address = address; + constructor(web3Wrapper: Web3Wrapper, networkId: number, address?: string) { + super(web3Wrapper, networkId); + this.address = _.isUndefined(address) ? this._getDefaultContractAddresses().exchange : address; } /** * Get an object conforming to OrderAndTraderInfo containing on-chain information of the provided order and address |