diff options
Diffstat (limited to 'packages/order-watcher/test/order_watcher_test.ts')
-rw-r--r-- | packages/order-watcher/test/order_watcher_test.ts | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/packages/order-watcher/test/order_watcher_test.ts b/packages/order-watcher/test/order_watcher_test.ts index 4545f84bf..e13d44396 100644 --- a/packages/order-watcher/test/order_watcher_test.ts +++ b/packages/order-watcher/test/order_watcher_test.ts @@ -27,6 +27,7 @@ import { OrderWatcherError } from '../src/types'; import { chaiSetup } from './utils/chai_setup'; import { constants } from './utils/constants'; +import { migrateOnceAsync } from './utils/migrate'; import { provider, web3Wrapper } from './utils/web3_wrapper'; const TIMEOUT_MS = 150; @@ -36,13 +37,10 @@ const expect = chai.expect; const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); describe('OrderWatcher', () => { - const networkId = constants.TESTRPC_NETWORK_ID; - const config = { networkId }; - const contractWrappers = new ContractWrappers(provider, config); + let contractWrappers: ContractWrappers; let fillScenarios: FillScenarios; let userAddresses: string[]; let zrxTokenAddress: string; - let exchangeContractAddress: string; let makerAssetData: string; let takerAssetData: string; let makerTokenAddress: string; @@ -56,17 +54,23 @@ describe('OrderWatcher', () => { const decimals = constants.ZRX_DECIMALS; const fillableAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(5), decimals); before(async () => { + const contractAddresses = await migrateOnceAsync(); await blockchainLifecycle.startAsync(); + const networkId = constants.TESTRPC_NETWORK_ID; + const config = { + networkId, + contractAddresses, + }; + contractWrappers = new ContractWrappers(provider, config); userAddresses = await web3Wrapper.getAvailableAddressesAsync(); - zrxTokenAddress = tokenUtils.getProtocolTokenAddress(); - exchangeContractAddress = contractWrappers.exchange.getContractAddress(); + zrxTokenAddress = contractAddresses.zrxToken; fillScenarios = new FillScenarios( provider, userAddresses, zrxTokenAddress, - exchangeContractAddress, - contractWrappers.erc20Proxy.getContractAddress(), - contractWrappers.erc721Proxy.getContractAddress(), + contractAddresses.exchange, + contractAddresses.erc20Proxy, + contractAddresses.erc721Proxy, ); [coinbase, makerAddress, takerAddress, feeRecipient] = userAddresses; [makerTokenAddress, takerTokenAddress] = tokenUtils.getDummyERC20TokenAddresses(); @@ -75,7 +79,7 @@ describe('OrderWatcher', () => { assetDataUtils.encodeERC20AssetData(takerTokenAddress), ]; const orderWatcherConfig = {}; - orderWatcher = new OrderWatcher(provider, networkId, orderWatcherConfig); + orderWatcher = new OrderWatcher(provider, networkId, contractAddresses, orderWatcherConfig); }); after(async () => { await blockchainLifecycle.revertAsync(); |