diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-04 07:21:17 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-16 04:36:59 +0800 |
commit | 3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd (patch) | |
tree | 15d4c7df95fd96d6aedb712738cd18bfb213b1f1 /packages/contract-wrappers/test/order_validator_wrapper_test.ts | |
parent | 2aa73fc83962d421eae4447108a07a5d952b569d (diff) | |
download | dexon-0x-contracts-3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd.tar dexon-0x-contracts-3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd.tar.gz dexon-0x-contracts-3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd.tar.bz2 dexon-0x-contracts-3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd.tar.lz dexon-0x-contracts-3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd.tar.xz dexon-0x-contracts-3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd.tar.zst dexon-0x-contracts-3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd.zip |
Remove artifacts from migrations package and update contract-wrappers accordingly
Diffstat (limited to 'packages/contract-wrappers/test/order_validator_wrapper_test.ts')
-rw-r--r-- | packages/contract-wrappers/test/order_validator_wrapper_test.ts | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/packages/contract-wrappers/test/order_validator_wrapper_test.ts b/packages/contract-wrappers/test/order_validator_wrapper_test.ts index baac3eeee..45d6f287c 100644 --- a/packages/contract-wrappers/test/order_validator_wrapper_test.ts +++ b/packages/contract-wrappers/test/order_validator_wrapper_test.ts @@ -1,7 +1,8 @@ import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { FillScenarios } from '@0xproject/fill-scenarios'; import { assetDataUtils } from '@0xproject/order-utils'; -import { SignedOrder } from '@0xproject/types'; +import { SignedOrder, ContractAddresses } from '@0xproject/types'; +import { getContractAddresses } from '@0xproject/migrations'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; import * as _ from 'lodash'; @@ -20,10 +21,6 @@ const expect = chai.expect; const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); describe('OrderValidator', () => { - const contractWrappersConfig = { - networkId: constants.TESTRPC_NETWORK_ID, - blockPollingIntervalMs: 0, - }; const fillableAmount = new BigNumber(5); let contractWrappers: ContractWrappers; let fillScenarios: FillScenarios; @@ -42,24 +39,32 @@ describe('OrderValidator', () => { let takerAssetData: string; let signedOrder: SignedOrder; let anotherSignedOrder: SignedOrder; + let contractAddresses: ContractAddresses; + before(async () => { await blockchainLifecycle.startAsync(); - contractWrappers = new ContractWrappers(provider, contractWrappersConfig); - exchangeContractAddress = contractWrappers.exchange.getContractAddress(); + contractAddresses = getContractAddresses(); + const config = { + networkId: constants.TESTRPC_NETWORK_ID, + contractAddresses, + blockPollingIntervalMs: 10, + }; + contractWrappers = new ContractWrappers(provider, config); + exchangeContractAddress = contractWrappers.exchange.address; userAddresses = await web3Wrapper.getAvailableAddressesAsync(); - zrxTokenAddress = tokenUtils.getProtocolTokenAddress(); + zrxTokenAddress = contractWrappers.exchange.zrxTokenAddress; zrxTokenAssetData = assetDataUtils.encodeERC20AssetData(zrxTokenAddress); fillScenarios = new FillScenarios( provider, userAddresses, zrxTokenAddress, exchangeContractAddress, - contractWrappers.erc20Proxy.getContractAddress(), - contractWrappers.erc721Proxy.getContractAddress(), + contractWrappers.erc20Proxy.address, + contractWrappers.erc721Proxy.address, ); [coinbase, makerAddress, takerAddress, feeRecipient, anotherMakerAddress] = userAddresses; [makerTokenAddress] = tokenUtils.getDummyERC20TokenAddresses(); - takerTokenAddress = tokenUtils.getWethTokenAddress(); + takerTokenAddress = contractAddresses.etherToken; [makerAssetData, takerAssetData] = [ assetDataUtils.encodeERC20AssetData(makerTokenAddress), assetDataUtils.encodeERC20AssetData(takerTokenAddress), |