aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/exchange
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-04-03 21:19:38 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-04-04 16:56:32 +0800
commit249bf0163d8ee71b7329fd58b72e554c0324279c (patch)
tree5bfb30b082236bd089e35186220bdb02913ba128 /packages/contracts/test/exchange
parent674e56cea69fe96ddd0071d3c4c5b5ea8ae299bf (diff)
downloaddexon-sol-tools-249bf0163d8ee71b7329fd58b72e554c0324279c.tar
dexon-sol-tools-249bf0163d8ee71b7329fd58b72e554c0324279c.tar.gz
dexon-sol-tools-249bf0163d8ee71b7329fd58b72e554c0324279c.tar.bz2
dexon-sol-tools-249bf0163d8ee71b7329fd58b72e554c0324279c.tar.lz
dexon-sol-tools-249bf0163d8ee71b7329fd58b72e554c0324279c.tar.xz
dexon-sol-tools-249bf0163d8ee71b7329fd58b72e554c0324279c.tar.zst
dexon-sol-tools-249bf0163d8ee71b7329fd58b72e554c0324279c.zip
Move our contract templates to accept Provider instead of Web3Wrapper
Diffstat (limited to 'packages/contracts/test/exchange')
-rw-r--r--packages/contracts/test/exchange/core.ts14
-rw-r--r--packages/contracts/test/exchange/helpers.ts6
-rw-r--r--packages/contracts/test/exchange/wrapper.ts21
3 files changed, 19 insertions, 22 deletions
diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts
index e276d11b3..689b11062 100644
--- a/packages/contracts/test/exchange/core.ts
+++ b/packages/contracts/test/exchange/core.ts
@@ -22,7 +22,7 @@ import { OrderFactory } from '../../util/order_factory';
import { BalancesByOwner, ContractName, ExchangeContractErrs } from '../../util/types';
import { chaiSetup } from '../utils/chai_setup';
import { deployer } from '../utils/deployer';
-import { web3, web3Wrapper } from '../utils/web3_wrapper';
+import { provider, web3Wrapper } from '../utils/web3_wrapper';
chaiSetup.configure();
const expect = chai.expect;
@@ -59,22 +59,22 @@ describe('Exchange', () => {
deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS),
deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS),
]);
- rep = new DummyTokenContract(web3Wrapper, repInstance.abi, repInstance.address);
- dgd = new DummyTokenContract(web3Wrapper, dgdInstance.abi, dgdInstance.address);
- zrx = new DummyTokenContract(web3Wrapper, zrxInstance.abi, zrxInstance.address);
+ 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 tokenTransferProxyInstance = await deployer.deployAsync(ContractName.TokenTransferProxy);
tokenTransferProxy = new TokenTransferProxyContract(
- web3Wrapper,
tokenTransferProxyInstance.abi,
tokenTransferProxyInstance.address,
+ provider,
);
const exchangeInstance = await deployer.deployAsync(ContractName.Exchange, [
zrx.address,
tokenTransferProxy.address,
]);
- exchange = new ExchangeContract(web3Wrapper, exchangeInstance.abi, exchangeInstance.address);
+ exchange = new ExchangeContract(exchangeInstance.abi, exchangeInstance.address, provider);
await tokenTransferProxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { from: accounts[0] });
- zeroEx = new ZeroEx(web3.currentProvider, {
+ zeroEx = new ZeroEx(provider, {
exchangeContractAddress: exchange.address,
networkId: constants.TESTRPC_NETWORK_ID,
});
diff --git a/packages/contracts/test/exchange/helpers.ts b/packages/contracts/test/exchange/helpers.ts
index 080cbe5fd..8fc30c0b5 100644
--- a/packages/contracts/test/exchange/helpers.ts
+++ b/packages/contracts/test/exchange/helpers.ts
@@ -17,7 +17,7 @@ import { OrderFactory } from '../../util/order_factory';
import { ContractName } from '../../util/types';
import { chaiSetup } from '../utils/chai_setup';
import { deployer } from '../utils/deployer';
-import { web3, web3Wrapper } from '../utils/web3_wrapper';
+import { provider, web3Wrapper } from '../utils/web3_wrapper';
chaiSetup.configure();
const expect = chai.expect;
@@ -46,9 +46,9 @@ describe('Exchange', () => {
zrx.address,
tokenTransferProxy.address,
]);
- const exchange = new ExchangeContract(web3Wrapper, exchangeInstance.abi, exchangeInstance.address);
+ const exchange = new ExchangeContract(exchangeInstance.abi, exchangeInstance.address, provider);
await tokenTransferProxy.addAuthorizedAddress(exchange.address, { from: accounts[0] });
- const zeroEx = new ZeroEx(web3.currentProvider, { networkId: constants.TESTRPC_NETWORK_ID });
+ const zeroEx = new ZeroEx(provider, { networkId: constants.TESTRPC_NETWORK_ID });
exchangeWrapper = new ExchangeWrapper(exchange, zeroEx);
const defaultOrderParams = {
exchangeContractAddress: exchange.address,
diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts
index 0d3e18711..d4029c8cd 100644
--- a/packages/contracts/test/exchange/wrapper.ts
+++ b/packages/contracts/test/exchange/wrapper.ts
@@ -22,7 +22,7 @@ import { OrderFactory } from '../../util/order_factory';
import { BalancesByOwner, ContractName } from '../../util/types';
import { chaiSetup } from '../utils/chai_setup';
import { deployer } from '../utils/deployer';
-import { web3, web3Wrapper } from '../utils/web3_wrapper';
+import { provider, web3Wrapper } from '../utils/web3_wrapper';
chaiSetup.configure();
const expect = chai.expect;
@@ -59,28 +59,25 @@ describe('Exchange', () => {
deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS),
deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS),
]);
- rep = new DummyTokenContract(web3Wrapper, repInstance.abi, repInstance.address);
- dgd = new DummyTokenContract(web3Wrapper, dgdInstance.abi, dgdInstance.address);
- zrx = new DummyTokenContract(web3Wrapper, zrxInstance.abi, zrxInstance.address);
+ 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(
- web3Wrapper,
- tokenRegistryInstance.abi,
- tokenRegistryInstance.address,
- );
+ tokenRegistry = new TokenRegistryContract(tokenRegistryInstance.abi, tokenRegistryInstance.address, provider);
const tokenTransferProxyInstance = await deployer.deployAsync(ContractName.TokenTransferProxy);
tokenTransferProxy = new TokenTransferProxyContract(
- web3Wrapper,
tokenTransferProxyInstance.abi,
tokenTransferProxyInstance.address,
+ provider,
);
const exchangeInstance = await deployer.deployAsync(ContractName.Exchange, [
zrx.address,
tokenTransferProxy.address,
+ provider,
]);
- exchange = new ExchangeContract(web3Wrapper, exchangeInstance.abi, exchangeInstance.address);
+ exchange = new ExchangeContract(exchangeInstance.abi, exchangeInstance.address, provider);
await tokenTransferProxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { from: accounts[0] });
- const zeroEx = new ZeroEx(web3.currentProvider, { networkId: constants.TESTRPC_NETWORK_ID });
+ const zeroEx = new ZeroEx(provider, { networkId: constants.TESTRPC_NETWORK_ID });
exWrapper = new ExchangeWrapper(exchange, zeroEx);
const defaultOrderParams = {