aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/exchange/match_orders.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/contracts/test/exchange/match_orders.ts')
-rw-r--r--packages/contracts/test/exchange/match_orders.ts100
1 files changed, 50 insertions, 50 deletions
diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts
index 16041e968..31f55ea10 100644
--- a/packages/contracts/test/exchange/match_orders.ts
+++ b/packages/contracts/test/exchange/match_orders.ts
@@ -1,5 +1,5 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { assetProxyUtils } from '@0xproject/order-utils';
+import { assetDataUtils } from '@0xproject/order-utils';
import { RevertReason } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
@@ -100,7 +100,7 @@ describe('matchOrders', () => {
artifacts.Exchange,
provider,
txDefaults,
- assetProxyUtils.encodeERC20AssetData(zrxToken.address),
+ assetDataUtils.encodeERC20AssetData(zrxToken.address),
);
exchangeWrapper = new ExchangeWrapper(exchange, provider);
await exchangeWrapper.registerAssetProxyAsync(erc20Proxy.address, owner);
@@ -126,8 +126,8 @@ describe('matchOrders', () => {
const defaultOrderParams = {
...constants.STATIC_ORDER_PARAMS,
exchangeAddress: exchange.address,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
};
const privateKeyLeft = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddressLeft)];
orderFactoryLeft = new OrderFactory(privateKeyLeft, defaultOrderParams);
@@ -158,8 +158,8 @@ describe('matchOrders', () => {
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18),
feeRecipientAddress: feeRecipientAddressRight,
@@ -190,8 +190,8 @@ describe('matchOrders', () => {
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18),
feeRecipientAddress: feeRecipientAddressRight,
@@ -233,8 +233,8 @@ describe('matchOrders', () => {
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(20), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(4), 18),
feeRecipientAddress: feeRecipientAddressRight,
@@ -265,8 +265,8 @@ describe('matchOrders', () => {
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18),
feeRecipientAddress: feeRecipientAddressRight,
@@ -297,8 +297,8 @@ describe('matchOrders', () => {
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18),
feeRecipientAddress: feeRecipientAddressRight,
@@ -328,8 +328,8 @@ describe('matchOrders', () => {
// branch in the contract twice for this test.
const signedOrderRight2 = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(50), 18),
feeRecipientAddress: feeRecipientAddressRight,
@@ -365,8 +365,8 @@ describe('matchOrders', () => {
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(50), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(100), 18),
feeRecipientAddress: feeRecipientAddressRight,
@@ -433,8 +433,8 @@ describe('matchOrders', () => {
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18),
feeRecipientAddress,
@@ -459,8 +459,8 @@ describe('matchOrders', () => {
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18),
feeRecipientAddress: feeRecipientAddressRight,
@@ -486,8 +486,8 @@ describe('matchOrders', () => {
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18),
feeRecipientAddress: feeRecipientAddressRight,
@@ -513,8 +513,8 @@ describe('matchOrders', () => {
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18),
feeRecipientAddress: feeRecipientAddressRight,
@@ -540,8 +540,8 @@ describe('matchOrders', () => {
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18),
feeRecipientAddress: feeRecipientAddressRight,
@@ -567,8 +567,8 @@ describe('matchOrders', () => {
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18),
feeRecipientAddress: makerAddressRight,
@@ -593,8 +593,8 @@ describe('matchOrders', () => {
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18),
feeRecipientAddress: feeRecipientAddressRight,
@@ -618,8 +618,8 @@ describe('matchOrders', () => {
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18),
feeRecipientAddress: feeRecipientAddressRight,
@@ -643,8 +643,8 @@ describe('matchOrders', () => {
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(1), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(200), 18),
feeRecipientAddress: feeRecipientAddressRight,
@@ -666,8 +666,8 @@ describe('matchOrders', () => {
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18),
feeRecipientAddress: feeRecipientAddressRight,
@@ -687,16 +687,16 @@ describe('matchOrders', () => {
// Create orders to match
const signedOrderLeft = orderFactoryLeft.newSignedOrder({
makerAddress: makerAddressLeft,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(5), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
feeRecipientAddress: feeRecipientAddressLeft,
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(2), 18),
feeRecipientAddress: feeRecipientAddressRight,
@@ -713,16 +713,16 @@ describe('matchOrders', () => {
const erc721TokenToTransfer = erc721LeftMakerAssetIds[0];
const signedOrderLeft = orderFactoryLeft.newSignedOrder({
makerAddress: makerAddressLeft,
- makerAssetData: assetProxyUtils.encodeERC721AssetData(defaultERC721AssetAddress, erc721TokenToTransfer),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC721AssetData(defaultERC721AssetAddress, erc721TokenToTransfer),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
makerAssetAmount: new BigNumber(1),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
feeRecipientAddress: feeRecipientAddressLeft,
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC721AssetData(defaultERC721AssetAddress, erc721TokenToTransfer),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20TakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC721AssetData(defaultERC721AssetAddress, erc721TokenToTransfer),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
takerAssetAmount: new BigNumber(1),
feeRecipientAddress: feeRecipientAddressRight,
@@ -748,16 +748,16 @@ describe('matchOrders', () => {
const erc721TokenToTransfer = erc721RightMakerAssetIds[0];
const signedOrderLeft = orderFactoryLeft.newSignedOrder({
makerAddress: makerAddressLeft,
- makerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
- takerAssetData: assetProxyUtils.encodeERC721AssetData(defaultERC721AssetAddress, erc721TokenToTransfer),
+ makerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ takerAssetData: assetDataUtils.encodeERC721AssetData(defaultERC721AssetAddress, erc721TokenToTransfer),
makerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
takerAssetAmount: new BigNumber(1),
feeRecipientAddress: feeRecipientAddressLeft,
});
const signedOrderRight = orderFactoryRight.newSignedOrder({
makerAddress: makerAddressRight,
- makerAssetData: assetProxyUtils.encodeERC721AssetData(defaultERC721AssetAddress, erc721TokenToTransfer),
- takerAssetData: assetProxyUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
+ makerAssetData: assetDataUtils.encodeERC721AssetData(defaultERC721AssetAddress, erc721TokenToTransfer),
+ takerAssetData: assetDataUtils.encodeERC20AssetData(defaultERC20MakerAssetAddress),
makerAssetAmount: new BigNumber(1),
takerAssetAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(10), 18),
feeRecipientAddress: feeRecipientAddressRight,