diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-05-08 04:11:09 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-05-10 23:46:57 +0800 |
commit | 3d58b38e4e8565e7ee10e4d6c9f57cd745957ab4 (patch) | |
tree | 5cff4a892b4094b972b59f119cb2998088fcea76 /packages/contracts/test/exchange/helpers.ts | |
parent | c64ad1af28ef116e210aafb3ea6ad2138361cd7c (diff) | |
download | dexon-sol-tools-3d58b38e4e8565e7ee10e4d6c9f57cd745957ab4.tar dexon-sol-tools-3d58b38e4e8565e7ee10e4d6c9f57cd745957ab4.tar.gz dexon-sol-tools-3d58b38e4e8565e7ee10e4d6c9f57cd745957ab4.tar.bz2 dexon-sol-tools-3d58b38e4e8565e7ee10e4d6c9f57cd745957ab4.tar.lz dexon-sol-tools-3d58b38e4e8565e7ee10e4d6c9f57cd745957ab4.tar.xz dexon-sol-tools-3d58b38e4e8565e7ee10e4d6c9f57cd745957ab4.tar.zst dexon-sol-tools-3d58b38e4e8565e7ee10e4d6c9f57cd745957ab4.zip |
Remove deployer from metacoin and contract tests
Diffstat (limited to 'packages/contracts/test/exchange/helpers.ts')
-rw-r--r-- | packages/contracts/test/exchange/helpers.ts | 61 |
1 files changed, 50 insertions, 11 deletions
diff --git a/packages/contracts/test/exchange/helpers.ts b/packages/contracts/test/exchange/helpers.ts index 8fc30c0b5..888d5ab2e 100644 --- a/packages/contracts/test/exchange/helpers.ts +++ b/packages/contracts/test/exchange/helpers.ts @@ -11,13 +11,18 @@ import { LogErrorContractEventArgs, LogFillContractEventArgs, } from '../../src/contract_wrappers/generated/exchange'; + +import { DummyTokenContract } from '../../src/contract_wrappers/generated/dummy_token'; +import { TokenRegistryContract } from '../../src/contract_wrappers/generated/token_registry'; +import { TokenTransferProxyContract } from '../../src/contract_wrappers/generated/token_transfer_proxy'; +import { artifacts } from '../../util/artifacts'; import { constants } from '../../util/constants'; import { ExchangeWrapper } from '../../util/exchange_wrapper'; import { OrderFactory } from '../../util/order_factory'; import { ContractName } from '../../util/types'; import { chaiSetup } from '../utils/chai_setup'; -import { deployer } from '../utils/deployer'; -import { provider, web3Wrapper } from '../utils/web3_wrapper'; + +import { defaults, provider, web3Wrapper } from '../utils/web3_wrapper'; chaiSetup.configure(); const expect = chai.expect; @@ -35,19 +40,53 @@ describe('Exchange', () => { before(async () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); [maker, feeRecipient] = accounts; - const tokenRegistry = await deployer.deployAsync(ContractName.TokenRegistry); - const tokenTransferProxy = await deployer.deployAsync(ContractName.TokenTransferProxy); + const tokenRegistry = await TokenRegistryContract.deploy0xArtifactAsync( + artifacts.TokenRegistry, + provider, + defaults, + ); + const tokenTransferProxy = await TokenTransferProxyContract.deploy0xArtifactAsync( + artifacts.TokenTransferProxy, + provider, + defaults, + ); const [rep, dgd, zrx] = await Promise.all([ - deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS), - deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS), - deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS), + DummyTokenContract.deploy0xArtifactAsync( + artifacts.DummyToken, + provider, + defaults, + constants.DUMMY_TOKEN_NAME, + constants.DUMMY_TOKEN_SYMBOL, + constants.DUMMY_TOKEN_DECIMALS, + constants.DUMMY_TOKEN_TOTAL_SUPPLY, + ), + DummyTokenContract.deploy0xArtifactAsync( + artifacts.DummyToken, + provider, + defaults, + constants.DUMMY_TOKEN_NAME, + constants.DUMMY_TOKEN_SYMBOL, + constants.DUMMY_TOKEN_DECIMALS, + constants.DUMMY_TOKEN_TOTAL_SUPPLY, + ), + DummyTokenContract.deploy0xArtifactAsync( + artifacts.DummyToken, + provider, + defaults, + constants.DUMMY_TOKEN_NAME, + constants.DUMMY_TOKEN_SYMBOL, + constants.DUMMY_TOKEN_DECIMALS, + constants.DUMMY_TOKEN_TOTAL_SUPPLY, + ), ]); - const exchangeInstance = await deployer.deployAsync(ContractName.Exchange, [ + const exchange = await ExchangeContract.deploy0xArtifactAsync( + artifacts.Exchange, + provider, + defaults, zrx.address, tokenTransferProxy.address, - ]); - const exchange = new ExchangeContract(exchangeInstance.abi, exchangeInstance.address, provider); - await tokenTransferProxy.addAuthorizedAddress(exchange.address, { from: accounts[0] }); + ); + await tokenTransferProxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { from: accounts[0] }); const zeroEx = new ZeroEx(provider, { networkId: constants.TESTRPC_NETWORK_ID }); exchangeWrapper = new ExchangeWrapper(exchange, zeroEx); const defaultOrderParams = { |