aboutsummaryrefslogtreecommitdiffstats
path: root/test/artifacts_test.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-23 18:12:16 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-23 18:12:16 +0800
commit845aee35d36a1c9031096738d6144045c32263cb (patch)
treeb77cd1253ac74ad761ecfb889faf10c71f63b52e /test/artifacts_test.ts
parent9a6a9fc28b6c59c6b74dbd47fd6f36a8597fe3fa (diff)
downloaddexon-sol-tools-845aee35d36a1c9031096738d6144045c32263cb.tar
dexon-sol-tools-845aee35d36a1c9031096738d6144045c32263cb.tar.gz
dexon-sol-tools-845aee35d36a1c9031096738d6144045c32263cb.tar.bz2
dexon-sol-tools-845aee35d36a1c9031096738d6144045c32263cb.tar.lz
dexon-sol-tools-845aee35d36a1c9031096738d6144045c32263cb.tar.xz
dexon-sol-tools-845aee35d36a1c9031096738d6144045c32263cb.tar.zst
dexon-sol-tools-845aee35d36a1c9031096738d6144045c32263cb.zip
Simplify integration tests
Diffstat (limited to 'test/artifacts_test.ts')
-rw-r--r--test/artifacts_test.ts38
1 files changed, 4 insertions, 34 deletions
diff --git a/test/artifacts_test.ts b/test/artifacts_test.ts
index 74705a525..1121ef951 100644
--- a/test/artifacts_test.ts
+++ b/test/artifacts_test.ts
@@ -1,17 +1,9 @@
import * as fs from 'fs';
-import * as _ from 'lodash';
-import * as chai from 'chai';
-import * as BigNumber from 'bignumber.js';
import HDWalletProvider = require('truffle-hdwallet-provider');
-import {chaiSetup} from './utils/chai_setup';
-import {ZeroEx, Order} from '../src';
+import {ZeroEx} from '../src';
import {web3Factory} from './utils/web3_factory';
-import {FillScenarios} from './utils/fill_scenarios';
import {constants} from './utils/constants';
-chaiSetup.configure();
-const expect = chai.expect;
-
// Those tests are slower cause they're talking to a remote node
const TIMEOUT = 10000;
@@ -24,35 +16,13 @@ describe('Artifacts', () => {
const web3Provider = new HDWalletProvider(mnemonic, kovanRpcUrl);
const zeroEx = new ZeroEx(web3Provider);
it('token registry contract is deployed', async () => {
- const tokens = await zeroEx.tokenRegistry.getTokensAsync();
+ await (zeroEx.tokenRegistry as any)._getTokenRegistryContractAsync();
}).timeout(TIMEOUT);
it('proxy contract is deployed', async () => {
- const [token] = await zeroEx.tokenRegistry.getTokensAsync();
- const allowance = await zeroEx.token.getProxyAllowanceAsync(token.address, ZeroEx.NULL_ADDRESS);
- expect(allowance).to.be.bignumber.equal(0);
+ await (zeroEx.token as any)._getProxyAddressAsync();
}).timeout(TIMEOUT);
it('exchange contract is deployed', async () => {
- const userAddreses = await zeroEx.getAvailableAddressesAsync();
- const tokens = await zeroEx.tokenRegistry.getTokensAsync();
- const makerTokenAddress = tokens[0].address;
- const takerTokenAddress = tokens[1].address;
- // Unused anyway
- const zrxTokenAddress = ZeroEx.NULL_ADDRESS;
- const fillScenarios = new FillScenarios(zeroEx, userAddreses, tokens, zrxTokenAddress);
- const order: Order = {
- maker: userAddreses[0],
- taker: userAddreses[0],
- makerFee: new BigNumber(0),
- takerFee: new BigNumber(0),
- makerTokenAmount: new BigNumber(0),
- takerTokenAmount: new BigNumber(0),
- makerTokenAddress,
- takerTokenAddress,
- salt: ZeroEx.generatePseudoRandomSalt(),
- feeRecipient: ZeroEx.NULL_ADDRESS,
- expirationUnixTimestampSec: new BigNumber(2524604400),
- };
- const orderHash = await zeroEx.getOrderHashHexAsync(order);
+ await (zeroEx.exchange as any)._getExchangeContractAsync();
}).timeout(TIMEOUT);
});
});