aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/exchange
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-08-24 01:31:06 +0800
committerGreg Hysen <greg.hysen@gmail.com>2018-08-25 09:20:25 +0800
commit70863cca085c060d55932e5e173fc2023bda9df5 (patch)
treedcbd56e3f43b00b0b1644844776292fa09802c5d /packages/contracts/test/exchange
parent5a1dce15be60fa88d6e317cd6dfa7b993c90c257 (diff)
downloaddexon-sol-tools-70863cca085c060d55932e5e173fc2023bda9df5.tar
dexon-sol-tools-70863cca085c060d55932e5e173fc2023bda9df5.tar.gz
dexon-sol-tools-70863cca085c060d55932e5e173fc2023bda9df5.tar.bz2
dexon-sol-tools-70863cca085c060d55932e5e173fc2023bda9df5.tar.lz
dexon-sol-tools-70863cca085c060d55932e5e173fc2023bda9df5.tar.xz
dexon-sol-tools-70863cca085c060d55932e5e173fc2023bda9df5.tar.zst
dexon-sol-tools-70863cca085c060d55932e5e173fc2023bda9df5.zip
Ran prettier and linter
Diffstat (limited to 'packages/contracts/test/exchange')
-rw-r--r--packages/contracts/test/exchange/match_orders.ts44
1 files changed, 3 insertions, 41 deletions
diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts
index eb2644ba6..7e9776d52 100644
--- a/packages/contracts/test/exchange/match_orders.ts
+++ b/packages/contracts/test/exchange/match_orders.ts
@@ -3,7 +3,6 @@ import { assetDataUtils } from '@0xproject/order-utils';
import { RevertReason } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
-import * as chai from 'chai';
import * as _ from 'lodash';
import { DummyERC20TokenContract } from '../../generated_contract_wrappers/dummy_erc20_token';
@@ -14,25 +13,15 @@ import { ExchangeContract } from '../../generated_contract_wrappers/exchange';
import { ReentrantERC20TokenContract } from '../../generated_contract_wrappers/reentrant_erc20_token';
import { artifacts } from '../utils/artifacts';
import { expectTransactionFailedAsync } from '../utils/assertions';
-import { chaiSetup } from '../utils/chai_setup';
import { constants } from '../utils/constants';
import { ERC20Wrapper } from '../utils/erc20_wrapper';
import { ERC721Wrapper } from '../utils/erc721_wrapper';
import { ExchangeWrapper } from '../utils/exchange_wrapper';
import { MatchOrderTester } from '../utils/match_order_tester';
import { OrderFactory } from '../utils/order_factory';
-import {
- ERC20BalancesByOwner,
- ERC721TokenIdsByOwner,
- OrderInfo,
- TransferAmountsByMatchOrders as TransferAmounts,
- OrderStatus,
-} from '../utils/types';
+import { ERC20BalancesByOwner, ERC721TokenIdsByOwner } from '../utils/types';
import { provider, txDefaults, web3Wrapper } from '../utils/web3_wrapper';
-chaiSetup.configure();
-
-const expect = chai.expect;
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
describe.only('matchOrders', () => {
@@ -470,7 +459,7 @@ describe.only('matchOrders', () => {
takerAddress,
erc20BalancesByOwner,
erc721TokenIdsByOwner,
- expectedTransferAmounts
+ expectedTransferAmounts,
);
// Construct second right order
// Note: This order needs makerAssetAmount=90/takerAssetAmount=[anything <= 45] to fully fill the right order.
@@ -480,7 +469,6 @@ describe.only('matchOrders', () => {
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(50), 18),
});
-
// Match signedOrderLeft with signedOrderRight2
const leftTakerAssetFilledAmount = signedOrderRight.makerAssetAmount;
const rightTakerAssetFilledAmount = new BigNumber(0);
@@ -549,7 +537,7 @@ describe.only('matchOrders', () => {
takerAddress,
erc20BalancesByOwner,
erc721TokenIdsByOwner,
- expectedTransferAmounts
+ expectedTransferAmounts,
);
// Create second left order
@@ -592,32 +580,6 @@ describe.only('matchOrders', () => {
);
});
- /*
- // Match signedOrderLeft with signedOrderRight
- const expectedTransferAmounts = {
- // Left Maker
- amountSoldByLeftMaker: Web3Wrapper.toBaseUnitAmount(new BigNumber(), 18),
- amountBoughtByLeftMaker: Web3Wrapper.toBaseUnitAmount(new BigNumber(), 18),
- feePaidByLeftMaker: Web3Wrapper.toBaseUnitAmount(new BigNumber(), 16), // 10%
- // Right Maker
- amountSoldByRightMaker: Web3Wrapper.toBaseUnitAmount(new BigNumber(), 18),
- amountBoughtByRightMaker: Web3Wrapper.toBaseUnitAmount(new BigNumber(), 18),
- feePaidByRightMaker: Web3Wrapper.toBaseUnitAmount(new BigNumber(), 16), // 100%
- // Taker
- amountReceivedByTaker: Web3Wrapper.toBaseUnitAmount(new BigNumber(), 18),
- feePaidByTakerLeft: Web3Wrapper.toBaseUnitAmount(new BigNumber(), 16), // 100%
- feePaidByTakerRight: Web3Wrapper.toBaseUnitAmount(new BigNumber(), 16), // 50%
- };
- await matchOrderTester.matchOrdersAndVerifyBalancesAsync(
- signedOrderLeft,
- signedOrderRight,
- takerAddress,
- erc20BalancesByOwner,
- erc721TokenIdsByOwner,
- expectedTransferAmounts
- );
-
- */
it('should transfer the correct amounts if fee recipient is the same across both matched orders', async () => {
const feeRecipientAddress = feeRecipientAddressLeft;
const signedOrderLeft = await orderFactoryLeft.newSignedOrderAsync({