aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/exchange/wrapper.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-05-08 04:11:09 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-05-10 23:46:57 +0800
commit3d58b38e4e8565e7ee10e4d6c9f57cd745957ab4 (patch)
tree5cff4a892b4094b972b59f119cb2998088fcea76 /packages/contracts/test/exchange/wrapper.ts
parentc64ad1af28ef116e210aafb3ea6ad2138361cd7c (diff)
downloaddexon-0x-contracts-3d58b38e4e8565e7ee10e4d6c9f57cd745957ab4.tar.gz
dexon-0x-contracts-3d58b38e4e8565e7ee10e4d6c9f57cd745957ab4.tar.zst
dexon-0x-contracts-3d58b38e4e8565e7ee10e4d6c9f57cd745957ab4.zip
Remove deployer from metacoin and contract tests
Diffstat (limited to 'packages/contracts/test/exchange/wrapper.ts')
-rw-r--r--packages/contracts/test/exchange/wrapper.ts58
1 files changed, 40 insertions, 18 deletions
diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts
index c658dca79..6e55edabb 100644
--- a/packages/contracts/test/exchange/wrapper.ts
+++ b/packages/contracts/test/exchange/wrapper.ts
@@ -15,14 +15,15 @@ import {
} from '../../src/contract_wrappers/generated/exchange';
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 { Balances } from '../../util/balances';
import { constants } from '../../util/constants';
import { ExchangeWrapper } from '../../util/exchange_wrapper';
import { OrderFactory } from '../../util/order_factory';
import { BalancesByOwner, 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;
@@ -54,27 +55,48 @@ describe('Exchange', () => {
const accounts = await web3Wrapper.getAvailableAddressesAsync();
tokenOwner = accounts[0];
[maker, taker, feeRecipient] = accounts;
- const [repInstance, dgdInstance, zrxInstance] = 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),
+ [rep, dgd, zrx] = await Promise.all([
+ 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,
+ ),
]);
- rep = new DummyTokenContract(repInstance.abi, repInstance.address, provider);
- dgd = new DummyTokenContract(dgdInstance.abi, dgdInstance.address, provider);
- zrx = new DummyTokenContract(zrxInstance.abi, zrxInstance.address, provider);
- const tokenRegistryInstance = await deployer.deployAsync(ContractName.TokenRegistry);
- tokenRegistry = new TokenRegistryContract(tokenRegistryInstance.abi, tokenRegistryInstance.address, provider);
- const tokenTransferProxyInstance = await deployer.deployAsync(ContractName.TokenTransferProxy);
- tokenTransferProxy = new TokenTransferProxyContract(
- tokenTransferProxyInstance.abi,
- tokenTransferProxyInstance.address,
+ tokenRegistry = await TokenRegistryContract.deploy0xArtifactAsync(artifacts.TokenRegistry, provider, defaults);
+ tokenTransferProxy = await TokenTransferProxyContract.deploy0xArtifactAsync(
+ artifacts.TokenTransferProxy,
provider,
+ defaults,
);
- const exchangeInstance = await deployer.deployAsync(ContractName.Exchange, [
+ exchange = await ExchangeContract.deploy0xArtifactAsync(
+ artifacts.Exchange,
+ provider,
+ defaults,
zrx.address,
tokenTransferProxy.address,
- ]);
- exchange = new ExchangeContract(exchangeInstance.abi, exchangeInstance.address, provider);
+ );
await tokenTransferProxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { from: accounts[0] });
const zeroEx = new ZeroEx(provider, { networkId: constants.TESTRPC_NETWORK_ID });
exWrapper = new ExchangeWrapper(exchange, zeroEx);