diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-10-17 02:15:17 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-10-17 02:15:17 +0800 |
commit | dbf5be6c217b49c4b768a9ea9969d44d70fb3dcc (patch) | |
tree | a93d0d6864c3e0f37c2663a6ba9ae0d3e7813fe9 /packages/contract-wrappers/test/forwarder_wrapper_test.ts | |
parent | d268e19124f086128aa293c5fe847f81891f7121 (diff) | |
parent | 72f5719b3412da7840a7b85e4dce512ecbaece4d (diff) | |
download | dexon-0x-contracts-dbf5be6c217b49c4b768a9ea9969d44d70fb3dcc.tar.gz dexon-0x-contracts-dbf5be6c217b49c4b768a9ea9969d44d70fb3dcc.tar.zst dexon-0x-contracts-dbf5be6c217b49c4b768a9ea9969d44d70fb3dcc.zip |
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/instant/move-features-over-from-zrx-buyer
Diffstat (limited to 'packages/contract-wrappers/test/forwarder_wrapper_test.ts')
-rw-r--r-- | packages/contract-wrappers/test/forwarder_wrapper_test.ts | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/packages/contract-wrappers/test/forwarder_wrapper_test.ts b/packages/contract-wrappers/test/forwarder_wrapper_test.ts index 4329e8770..730658884 100644 --- a/packages/contract-wrappers/test/forwarder_wrapper_test.ts +++ b/packages/contract-wrappers/test/forwarder_wrapper_test.ts @@ -10,6 +10,7 @@ import { ContractWrappers, OrderStatus } from '../src'; import { chaiSetup } from './utils/chai_setup'; import { constants } from './utils/constants'; +import { migrateOnceAsync } from './utils/migrate'; import { tokenUtils } from './utils/token_utils'; import { provider, web3Wrapper } from './utils/web3_wrapper'; @@ -19,21 +20,14 @@ const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); // tslint:disable:custom-no-magic-numbers describe('ForwarderWrapper', () => { - const contractWrappersConfig = { - networkId: constants.TESTRPC_NETWORK_ID, - blockPollingIntervalMs: 0, - }; const fillableAmount = new BigNumber(5); let contractWrappers: ContractWrappers; let fillScenarios: FillScenarios; let exchangeContractAddress: string; let zrxTokenAddress: string; let userAddresses: string[]; - let coinbase: string; let makerAddress: string; let takerAddress: string; - let feeRecipient: string; - let anotherMakerAddress: string; let makerTokenAddress: string; let takerTokenAddress: string; let makerAssetData: string; @@ -41,22 +35,28 @@ describe('ForwarderWrapper', () => { let signedOrder: SignedOrder; let anotherSignedOrder: SignedOrder; before(async () => { + const contractAddresses = await migrateOnceAsync(); await blockchainLifecycle.startAsync(); - contractWrappers = new ContractWrappers(provider, contractWrappersConfig); - exchangeContractAddress = contractWrappers.exchange.getContractAddress(); + 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; 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; + [, makerAddress, takerAddress] = userAddresses; [makerTokenAddress] = tokenUtils.getDummyERC20TokenAddresses(); - takerTokenAddress = tokenUtils.getWethTokenAddress(); + takerTokenAddress = contractWrappers.forwarder.etherTokenAddress; [makerAssetData, takerAssetData] = [ assetDataUtils.encodeERC20AssetData(makerTokenAddress), assetDataUtils.encodeERC20AssetData(takerTokenAddress), |