`@0x/contracts-exchange-libs: Appease the linter and prettier gods.
This commit is contained in:
@@ -33,10 +33,10 @@
|
||||
"src/interfaces/IExchangeCore.sol",
|
||||
"src/interfaces/IMatchOrders.sol",
|
||||
"src/interfaces/ISignatureValidator.sol",
|
||||
"test/IsolatedExchange.sol",
|
||||
"src/interfaces/ITransactions.sol",
|
||||
"src/interfaces/IWallet.sol",
|
||||
"src/interfaces/IWrapperFunctions.sol",
|
||||
"test/IsolatedExchange.sol",
|
||||
"test/ReentrantERC20Token.sol",
|
||||
"test/TestAssetProxyDispatcher.sol",
|
||||
"test/TestExchangeInternals.sol",
|
||||
|
||||
@@ -64,7 +64,7 @@ contract IsolatedExchange is
|
||||
|
||||
// Fail if the first byte is 0.
|
||||
if (assetData.length > 0 && assetData[0] == 0x00) {
|
||||
revert('TRANSFER_FAILED');
|
||||
revert("TRANSFER_FAILED");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,25 +4,17 @@ import { BigNumber } from '@0x/utils';
|
||||
|
||||
const { safeGetPartialAmountFloor } = ExchangeLibsReferenceFunctions;
|
||||
|
||||
export function calculateFillResults(
|
||||
order: OrderWithoutDomain,
|
||||
takerAssetFilledAmount: BigNumber,
|
||||
): FillResults {
|
||||
/**
|
||||
* Calculates amounts filled and fees paid by maker and taker.
|
||||
*/
|
||||
export function calculateFillResults(order: OrderWithoutDomain, takerAssetFilledAmount: BigNumber): FillResults {
|
||||
const makerAssetFilledAmount = safeGetPartialAmountFloor(
|
||||
takerAssetFilledAmount,
|
||||
order.takerAssetAmount,
|
||||
order.makerAssetAmount,
|
||||
);
|
||||
const makerFeePaid = safeGetPartialAmountFloor(
|
||||
makerAssetFilledAmount,
|
||||
order.makerAssetAmount,
|
||||
order.makerFee,
|
||||
);
|
||||
const takerFeePaid = safeGetPartialAmountFloor(
|
||||
takerAssetFilledAmount,
|
||||
order.takerAssetAmount,
|
||||
order.takerFee,
|
||||
);
|
||||
const makerFeePaid = safeGetPartialAmountFloor(makerAssetFilledAmount, order.makerAssetAmount, order.makerFee);
|
||||
const takerFeePaid = safeGetPartialAmountFloor(takerAssetFilledAmount, order.takerAssetAmount, order.takerFee);
|
||||
return {
|
||||
makerAssetFilledAmount,
|
||||
takerAssetFilledAmount,
|
||||
|
||||
@@ -19,8 +19,8 @@ import {
|
||||
artifacts,
|
||||
ReferenceFunctions,
|
||||
TestExchangeInternalsContract,
|
||||
TestExchangeInternalsFillEventArgs,
|
||||
TestExchangeInternalsDispatchTransferFromCalledEventArgs,
|
||||
TestExchangeInternalsFillEventArgs,
|
||||
} from '../src';
|
||||
|
||||
blockchainTests('Exchange core internal functions', env => {
|
||||
@@ -50,7 +50,7 @@ blockchainTests('Exchange core internal functions', env => {
|
||||
let senderAddress: string;
|
||||
|
||||
before(async () => {
|
||||
[ senderAddress ] = await env.getAccountAddressesAsync();
|
||||
[senderAddress] = await env.getAccountAddressesAsync();
|
||||
testExchange = await TestExchangeInternalsContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestExchangeInternals,
|
||||
env.provider,
|
||||
@@ -114,11 +114,7 @@ blockchainTests('Exchange core internal functions', env => {
|
||||
describe('explicit tests', () => {
|
||||
const MAX_UINT256_ROOT = constants.MAX_UINT256_ROOT;
|
||||
function makeOrder(details?: Partial<Order>): Order {
|
||||
return _.assign(
|
||||
{},
|
||||
EMPTY_ORDER,
|
||||
details,
|
||||
);
|
||||
return _.assign({}, EMPTY_ORDER, details);
|
||||
}
|
||||
|
||||
it('matches the output of the reference function', async () => {
|
||||
@@ -146,8 +142,9 @@ blockchainTests('Exchange core internal functions', env => {
|
||||
takerAssetFilledAmount,
|
||||
order.makerAssetAmount,
|
||||
);
|
||||
return expect(testExchange.calculateFillResults.callAsync(order, takerAssetFilledAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(testExchange.calculateFillResults.callAsync(order, takerAssetFilledAmount)).to.revertWith(
|
||||
expectedError,
|
||||
);
|
||||
});
|
||||
|
||||
it('reverts if computing `fillResults.makerFeePaid` overflows', async () => {
|
||||
@@ -168,8 +165,9 @@ blockchainTests('Exchange core internal functions', env => {
|
||||
makerAssetFilledAmount,
|
||||
order.makerFee,
|
||||
);
|
||||
return expect(testExchange.calculateFillResults.callAsync(order, takerAssetFilledAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(testExchange.calculateFillResults.callAsync(order, takerAssetFilledAmount)).to.revertWith(
|
||||
expectedError,
|
||||
);
|
||||
});
|
||||
|
||||
it('reverts if computing `fillResults.takerFeePaid` overflows', async () => {
|
||||
@@ -185,8 +183,9 @@ blockchainTests('Exchange core internal functions', env => {
|
||||
takerAssetFilledAmount,
|
||||
order.takerFee,
|
||||
);
|
||||
return expect(testExchange.calculateFillResults.callAsync(order, takerAssetFilledAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(testExchange.calculateFillResults.callAsync(order, takerAssetFilledAmount)).to.revertWith(
|
||||
expectedError,
|
||||
);
|
||||
});
|
||||
|
||||
it('reverts if `order.makerAssetAmount` is 0', async () => {
|
||||
@@ -196,8 +195,9 @@ blockchainTests('Exchange core internal functions', env => {
|
||||
});
|
||||
const takerAssetFilledAmount = ONE_ETHER;
|
||||
const expectedError = new LibMathRevertErrors.DivisionByZeroError();
|
||||
return expect(testExchange.calculateFillResults.callAsync(order, takerAssetFilledAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(testExchange.calculateFillResults.callAsync(order, takerAssetFilledAmount)).to.revertWith(
|
||||
expectedError,
|
||||
);
|
||||
});
|
||||
|
||||
it('reverts if `order.takerAssetAmount` is 0', async () => {
|
||||
@@ -207,8 +207,9 @@ blockchainTests('Exchange core internal functions', env => {
|
||||
});
|
||||
const takerAssetFilledAmount = ONE_ETHER;
|
||||
const expectedError = new LibMathRevertErrors.DivisionByZeroError();
|
||||
return expect(testExchange.calculateFillResults.callAsync(order, takerAssetFilledAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(testExchange.calculateFillResults.callAsync(order, takerAssetFilledAmount)).to.revertWith(
|
||||
expectedError,
|
||||
);
|
||||
});
|
||||
|
||||
it('reverts if there is a rounding error computing `makerAsssetFilledAmount`', async () => {
|
||||
@@ -222,8 +223,9 @@ blockchainTests('Exchange core internal functions', env => {
|
||||
order.takerAssetAmount,
|
||||
order.makerAssetAmount,
|
||||
);
|
||||
return expect(testExchange.calculateFillResults.callAsync(order, takerAssetFilledAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(testExchange.calculateFillResults.callAsync(order, takerAssetFilledAmount)).to.revertWith(
|
||||
expectedError,
|
||||
);
|
||||
});
|
||||
|
||||
it('reverts if there is a rounding error computing `makerFeePaid`', async () => {
|
||||
@@ -243,8 +245,9 @@ blockchainTests('Exchange core internal functions', env => {
|
||||
order.makerAssetAmount,
|
||||
order.makerFee,
|
||||
);
|
||||
return expect(testExchange.calculateFillResults.callAsync(order, takerAssetFilledAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(testExchange.calculateFillResults.callAsync(order, takerAssetFilledAmount)).to.revertWith(
|
||||
expectedError,
|
||||
);
|
||||
});
|
||||
|
||||
it('reverts if there is a rounding error computing `takerFeePaid`', async () => {
|
||||
@@ -264,8 +267,9 @@ blockchainTests('Exchange core internal functions', env => {
|
||||
order.makerAssetAmount,
|
||||
order.takerFee,
|
||||
);
|
||||
return expect(testExchange.calculateFillResults.callAsync(order, takerAssetFilledAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(testExchange.calculateFillResults.callAsync(order, takerAssetFilledAmount)).to.revertWith(
|
||||
expectedError,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -299,10 +303,7 @@ blockchainTests('Exchange core internal functions', env => {
|
||||
takerAssetFillAmount: BigNumber,
|
||||
): Promise<void> {
|
||||
const orderHash = randomHash();
|
||||
const fillResults = ReferenceFunctions.calculateFillResults(
|
||||
order,
|
||||
takerAssetFillAmount,
|
||||
);
|
||||
const fillResults = ReferenceFunctions.calculateFillResults(order, takerAssetFillAmount);
|
||||
const expectedFilledState = orderTakerAssetFilledAmount.plus(takerAssetFillAmount);
|
||||
// CAll `testUpdateFilledState()`, which will set the `filled`
|
||||
// state for this order to `orderTakerAssetFilledAmount` before
|
||||
@@ -321,6 +322,7 @@ blockchainTests('Exchange core internal functions', env => {
|
||||
// Assert the `filled` state for this order.
|
||||
expect(actualFilledState).to.bignumber.eq(expectedFilledState);
|
||||
// Assert the logs.
|
||||
// tslint:disable-next-line: no-unnecessary-type-assertion
|
||||
const fillEvent = receipt.logs[0] as LogWithDecodedArgs<TestExchangeInternalsFillEventArgs>;
|
||||
expect(fillEvent.event).to.eq('Fill');
|
||||
expect(fillEvent.args.makerAddress).to.eq(order.makerAddress);
|
||||
@@ -363,13 +365,15 @@ blockchainTests('Exchange core internal functions', env => {
|
||||
orderTakerAssetFilledAmount,
|
||||
takerAssetFillAmount,
|
||||
);
|
||||
return expect(testExchange.testUpdateFilledState.awaitTransactionSuccessAsync(
|
||||
order,
|
||||
randomAddress(),
|
||||
randomHash(),
|
||||
orderTakerAssetFilledAmount,
|
||||
fillResults,
|
||||
)).to.revertWith(expectedError);
|
||||
return expect(
|
||||
testExchange.testUpdateFilledState.awaitTransactionSuccessAsync(
|
||||
order,
|
||||
randomAddress(),
|
||||
randomHash(),
|
||||
orderTakerAssetFilledAmount,
|
||||
fillResults,
|
||||
),
|
||||
).to.revertWith(expectedError);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -402,14 +406,11 @@ blockchainTests('Exchange core internal functions', env => {
|
||||
takerFeePaid: ONE_ETHER.times(0.025),
|
||||
};
|
||||
const receipt = await logDecoder.getTxWithDecodedLogsAsync(
|
||||
await testExchange.settleOrder.sendTransactionAsync(
|
||||
orderHash,
|
||||
order,
|
||||
takerAddress,
|
||||
fillResults,
|
||||
),
|
||||
await testExchange.settleOrder.sendTransactionAsync(orderHash, order, takerAddress, fillResults),
|
||||
);
|
||||
const logs = receipt.logs as Array<LogWithDecodedArgs<TestExchangeInternalsDispatchTransferFromCalledEventArgs>>;
|
||||
const logs = receipt.logs as Array<
|
||||
LogWithDecodedArgs<TestExchangeInternalsDispatchTransferFromCalledEventArgs>
|
||||
>;
|
||||
expect(logs.length === 4);
|
||||
expect(_.every(logs, log => log.event === 'DispatchTransferFromCalled')).to.be.true();
|
||||
// taker -> maker
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import { ReferenceFunctions as LibReferenceFunctions } from '@0x/contracts-exchange-libs';
|
||||
import {
|
||||
blockchainTests,
|
||||
constants,
|
||||
expect,
|
||||
hexRandom,
|
||||
} from '@0x/contracts-test-utils';
|
||||
import { blockchainTests, constants, expect, hexRandom } from '@0x/contracts-test-utils';
|
||||
import { ExchangeRevertErrors, LibMathRevertErrors } from '@0x/order-utils';
|
||||
import { FillResults, OrderInfo, OrderStatus, SignatureType } from '@0x/types';
|
||||
import { BigNumber, SafeMathRevertErrors } from '@0x/utils';
|
||||
@@ -50,7 +45,7 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
let nextSaltValue = 1;
|
||||
|
||||
before(async () => {
|
||||
[ takerAddress, notTakerAddress ] = await env.getAccountAddressesAsync();
|
||||
[takerAddress, notTakerAddress] = await env.getAccountAddressesAsync();
|
||||
exchange = await IsolatedExchangeWrapper.deployAsync(
|
||||
env.web3Wrapper,
|
||||
_.assign(env.txDefaults, { from: takerAddress }),
|
||||
@@ -79,14 +74,10 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
const fillResults = await exchange.fillOrderAsync(order, takerAssetFillAmount, signature);
|
||||
const newOrderInfo = await exchange.getOrderInfoAsync(order);
|
||||
// Check returned fillResults.
|
||||
expect(fillResults.makerAssetFilledAmount)
|
||||
.to.bignumber.eq(efr.makerAssetFilledAmount);
|
||||
expect(fillResults.takerAssetFilledAmount)
|
||||
.to.bignumber.eq(efr.takerAssetFilledAmount);
|
||||
expect(fillResults.makerFeePaid)
|
||||
.to.bignumber.eq(efr.makerFeePaid);
|
||||
expect(fillResults.takerFeePaid)
|
||||
.to.bignumber.eq(efr.takerFeePaid);
|
||||
expect(fillResults.makerAssetFilledAmount).to.bignumber.eq(efr.makerAssetFilledAmount);
|
||||
expect(fillResults.takerAssetFilledAmount).to.bignumber.eq(efr.takerAssetFilledAmount);
|
||||
expect(fillResults.makerFeePaid).to.bignumber.eq(efr.makerFeePaid);
|
||||
expect(fillResults.takerFeePaid).to.bignumber.eq(efr.takerFeePaid);
|
||||
// Check balances.
|
||||
for (const assetData of Object.keys(efb)) {
|
||||
for (const address of Object.keys(efb[assetData])) {
|
||||
@@ -98,13 +89,11 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
}
|
||||
// Check order info.
|
||||
expect(newOrderInfo.orderStatus).to.eq(eoi.orderStatus);
|
||||
expect(newOrderInfo.orderTakerAssetFilledAmount)
|
||||
.to.bignumber.eq(eoi.orderTakerAssetFilledAmount);
|
||||
expect(newOrderInfo.orderTakerAssetFilledAmount).to.bignumber.eq(eoi.orderTakerAssetFilledAmount);
|
||||
// Check that there wasn't an overfill.
|
||||
expect(
|
||||
newOrderInfo.orderTakerAssetFilledAmount.lte(order.takerAssetAmount),
|
||||
'checking for overfill',
|
||||
).to.be.ok('');
|
||||
expect(newOrderInfo.orderTakerAssetFilledAmount.lte(order.takerAssetAmount), 'checking for overfill').to.be.ok(
|
||||
'',
|
||||
);
|
||||
return {
|
||||
fillResults,
|
||||
orderInfo: newOrderInfo,
|
||||
@@ -116,24 +105,17 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
orderInfo: OrderInfo,
|
||||
takerAssetFillAmount: BigNumber,
|
||||
): FillResults {
|
||||
const remainingTakerAssetAmount = order.takerAssetAmount.minus(
|
||||
orderInfo.orderTakerAssetFilledAmount,
|
||||
);
|
||||
return calculateFillResults(
|
||||
order,
|
||||
BigNumber.min(takerAssetFillAmount, remainingTakerAssetAmount),
|
||||
);
|
||||
const remainingTakerAssetAmount = order.takerAssetAmount.minus(orderInfo.orderTakerAssetFilledAmount);
|
||||
return calculateFillResults(order, BigNumber.min(takerAssetFillAmount, remainingTakerAssetAmount));
|
||||
}
|
||||
|
||||
function calculateExpectedOrderInfo(
|
||||
order: Order,
|
||||
orderInfo: OrderInfo,
|
||||
fillResults: FillResults,
|
||||
): OrderInfo {
|
||||
const orderTakerAssetFilledAmount =
|
||||
orderInfo.orderTakerAssetFilledAmount.plus(fillResults.takerAssetFilledAmount);
|
||||
const orderStatus = orderTakerAssetFilledAmount.gte(order.takerAssetAmount) ?
|
||||
OrderStatus.FullyFilled : OrderStatus.Fillable;
|
||||
function calculateExpectedOrderInfo(order: Order, orderInfo: OrderInfo, fillResults: FillResults): OrderInfo {
|
||||
const orderTakerAssetFilledAmount = orderInfo.orderTakerAssetFilledAmount.plus(
|
||||
fillResults.takerAssetFilledAmount,
|
||||
);
|
||||
const orderStatus = orderTakerAssetFilledAmount.gte(order.takerAssetAmount)
|
||||
? OrderStatus.FullyFilled
|
||||
: OrderStatus.Fillable;
|
||||
return {
|
||||
orderHash: exchange.getOrderHash(order),
|
||||
orderStatus,
|
||||
@@ -141,10 +123,7 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
};
|
||||
}
|
||||
|
||||
function calculateExpectedFillBalances(
|
||||
order: Order,
|
||||
fillResults: FillResults,
|
||||
): AssetBalances {
|
||||
function calculateExpectedFillBalances(order: Order, fillResults: FillResults): AssetBalances {
|
||||
const balances: AssetBalances = {};
|
||||
const addBalance = (assetData: string, address: string, amount: BigNumber) => {
|
||||
balances[assetData] = balances[assetData] || {};
|
||||
@@ -176,7 +155,7 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
expect(orderInfo.orderStatus).to.eq(OrderStatus.FullyFilled);
|
||||
});
|
||||
|
||||
it('can\'t overfill an order', async () => {
|
||||
it("can't overfill an order", async () => {
|
||||
const order = createOrder();
|
||||
const { orderInfo } = await fillOrderAndAssertResultsAsync(order, order.takerAssetAmount.times(1.01));
|
||||
expect(orderInfo.orderStatus).to.eq(OrderStatus.FullyFilled);
|
||||
@@ -266,7 +245,7 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
expect(orderInfos[1].orderStatus).to.eq(OrderStatus.Fillable);
|
||||
});
|
||||
|
||||
it('can\'t overfill an order in two fills', async () => {
|
||||
it("can't overfill an order in two fills", async () => {
|
||||
const order = createOrder();
|
||||
const fillAmounts = splitAmount(order.takerAssetAmount);
|
||||
fillAmounts[0] = fillAmounts[0].times(1.01);
|
||||
@@ -320,7 +299,7 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
});
|
||||
|
||||
describe('bad fills', () => {
|
||||
it('can\'t fill an order with zero takerAssetAmount', async () => {
|
||||
it("can't fill an order with zero takerAssetAmount", async () => {
|
||||
const order = createOrder({
|
||||
takerAssetAmount: ZERO_AMOUNT,
|
||||
});
|
||||
@@ -328,11 +307,10 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
exchange.getOrderHash(order),
|
||||
OrderStatus.InvalidTakerAssetAmount,
|
||||
);
|
||||
return expect(exchange.fillOrderAsync(order, ONE_ETHER))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(exchange.fillOrderAsync(order, ONE_ETHER)).to.revertWith(expectedError);
|
||||
});
|
||||
|
||||
it('can\'t fill an order with zero makerAssetAmount', async () => {
|
||||
it("can't fill an order with zero makerAssetAmount", async () => {
|
||||
const order = createOrder({
|
||||
makerAssetAmount: ZERO_AMOUNT,
|
||||
});
|
||||
@@ -340,22 +318,20 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
exchange.getOrderHash(order),
|
||||
OrderStatus.InvalidMakerAssetAmount,
|
||||
);
|
||||
return expect(exchange.fillOrderAsync(order, ONE_ETHER))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(exchange.fillOrderAsync(order, ONE_ETHER)).to.revertWith(expectedError);
|
||||
});
|
||||
|
||||
it('can\'t fill an order that is fully filled', async () => {
|
||||
it("can't fill an order that is fully filled", async () => {
|
||||
const order = createOrder();
|
||||
const expectedError = new ExchangeRevertErrors.OrderStatusError(
|
||||
exchange.getOrderHash(order),
|
||||
OrderStatus.FullyFilled,
|
||||
);
|
||||
await exchange.fillOrderAsync(order, order.takerAssetAmount);
|
||||
return expect(exchange.fillOrderAsync(order, 1))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(exchange.fillOrderAsync(order, 1)).to.revertWith(expectedError);
|
||||
});
|
||||
|
||||
it('can\'t fill an order that is expired', async () => {
|
||||
it("can't fill an order that is expired", async () => {
|
||||
const order = createOrder({
|
||||
expirationTimeSeconds: new BigNumber(getCurrentTime() - 60),
|
||||
});
|
||||
@@ -363,11 +339,10 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
exchange.getOrderHash(order),
|
||||
OrderStatus.Expired,
|
||||
);
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount)).to.revertWith(expectedError);
|
||||
});
|
||||
|
||||
it('can\'t fill an order that is cancelled by `cancelOrder()`', async () => {
|
||||
it("can't fill an order that is cancelled by `cancelOrder()`", async () => {
|
||||
const order = createOrder({
|
||||
makerAddress: notTakerAddress,
|
||||
});
|
||||
@@ -376,11 +351,10 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
OrderStatus.Cancelled,
|
||||
);
|
||||
await exchange.cancelOrderAsync(order, { from: notTakerAddress });
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount)).to.revertWith(expectedError);
|
||||
});
|
||||
|
||||
it('can\'t fill an order that is cancelled by `cancelOrdersUpTo()`', async () => {
|
||||
it("can't fill an order that is cancelled by `cancelOrdersUpTo()`", async () => {
|
||||
const order = createOrder({
|
||||
makerAddress: notTakerAddress,
|
||||
});
|
||||
@@ -389,11 +363,10 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
OrderStatus.Cancelled,
|
||||
);
|
||||
await exchange.cancelOrdersUpToAsync(order.salt, { from: notTakerAddress });
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount)).to.revertWith(expectedError);
|
||||
});
|
||||
|
||||
it('can\'t fill an order if taker is not `takerAddress`', async () => {
|
||||
it("can't fill an order if taker is not `takerAddress`", async () => {
|
||||
const order = createOrder({
|
||||
takerAddress: randomAddress(),
|
||||
});
|
||||
@@ -401,11 +374,10 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
exchange.getOrderHash(order),
|
||||
takerAddress,
|
||||
);
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount)).to.revertWith(expectedError);
|
||||
});
|
||||
|
||||
it('can\'t fill an order if sender is not `senderAddress`', async () => {
|
||||
it("can't fill an order if sender is not `senderAddress`", async () => {
|
||||
const order = createOrder({
|
||||
senderAddress: randomAddress(),
|
||||
});
|
||||
@@ -413,11 +385,10 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
exchange.getOrderHash(order),
|
||||
takerAddress,
|
||||
);
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount)).to.revertWith(expectedError);
|
||||
});
|
||||
|
||||
it('can\'t fill an order with a taker amount that results in a maker asset rounding error', async () => {
|
||||
it("can't fill an order with a taker amount that results in a maker asset rounding error", async () => {
|
||||
const order = createOrder({
|
||||
makerAssetAmount: new BigNumber(100),
|
||||
takerAssetAmount: ONE_ETHER,
|
||||
@@ -428,11 +399,10 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
order.takerAssetAmount,
|
||||
order.makerAssetAmount,
|
||||
);
|
||||
return expect(exchange.fillOrderAsync(order, takerAssetFillAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(exchange.fillOrderAsync(order, takerAssetFillAmount)).to.revertWith(expectedError);
|
||||
});
|
||||
|
||||
it('can\'t fill an order with a taker amount that results in a maker fee rounding error', async () => {
|
||||
it("can't fill an order with a taker amount that results in a maker fee rounding error", async () => {
|
||||
const order = createOrder({
|
||||
makerAssetAmount: ONE_ETHER.times(2),
|
||||
takerAssetAmount: ONE_ETHER,
|
||||
@@ -444,11 +414,10 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
order.makerAssetAmount,
|
||||
order.makerFee,
|
||||
);
|
||||
return expect(exchange.fillOrderAsync(order, takerAssetFillAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(exchange.fillOrderAsync(order, takerAssetFillAmount)).to.revertWith(expectedError);
|
||||
});
|
||||
|
||||
it('can\'t fill an order with a taker amount that results in a taker fee rounding error', async () => {
|
||||
it("can't fill an order with a taker amount that results in a taker fee rounding error", async () => {
|
||||
const order = createOrder({
|
||||
makerAssetAmount: ONE_ETHER.times(2),
|
||||
takerAssetAmount: ONE_ETHER,
|
||||
@@ -460,11 +429,10 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
order.takerAssetAmount,
|
||||
order.takerFee,
|
||||
);
|
||||
return expect(exchange.fillOrderAsync(order, takerAssetFillAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(exchange.fillOrderAsync(order, takerAssetFillAmount)).to.revertWith(expectedError);
|
||||
});
|
||||
|
||||
it('can\'t fill an order that results in a `makerAssetFilledAmount` overflow.', async () => {
|
||||
it("can't fill an order that results in a `makerAssetFilledAmount` overflow.", async () => {
|
||||
// All values need to be large to ensure we don't trigger a Rounding.
|
||||
const order = createOrder({
|
||||
makerAssetAmount: MAX_UINT256_ROOT.times(2),
|
||||
@@ -476,11 +444,10 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
takerAssetFillAmount,
|
||||
order.makerAssetAmount,
|
||||
);
|
||||
return expect(exchange.fillOrderAsync(order, takerAssetFillAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(exchange.fillOrderAsync(order, takerAssetFillAmount)).to.revertWith(expectedError);
|
||||
});
|
||||
|
||||
it('can\'t fill an order that results in a `makerFeePaid` overflow.', async () => {
|
||||
it("can't fill an order that results in a `makerFeePaid` overflow.", async () => {
|
||||
// All values need to be large to ensure we don't trigger a Rounding.
|
||||
const order = createOrder({
|
||||
makerAssetAmount: MAX_UINT256_ROOT,
|
||||
@@ -498,11 +465,10 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
makerAssetFilledAmount,
|
||||
order.makerFee,
|
||||
);
|
||||
return expect(exchange.fillOrderAsync(order, takerAssetFillAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(exchange.fillOrderAsync(order, takerAssetFillAmount)).to.revertWith(expectedError);
|
||||
});
|
||||
|
||||
it('can\'t fill an order that results in a `takerFeePaid` overflow.', async () => {
|
||||
it("can't fill an order that results in a `takerFeePaid` overflow.", async () => {
|
||||
// All values need to be large to ensure we don't trigger a Rounding.
|
||||
const order = createOrder({
|
||||
makerAssetAmount: MAX_UINT256_ROOT,
|
||||
@@ -515,11 +481,10 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
takerAssetFillAmount,
|
||||
order.takerFee,
|
||||
);
|
||||
return expect(exchange.fillOrderAsync(order, takerAssetFillAmount))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(exchange.fillOrderAsync(order, takerAssetFillAmount)).to.revertWith(expectedError);
|
||||
});
|
||||
|
||||
it('can\'t fill an order with a bad signature', async () => {
|
||||
it("can't fill an order with a bad signature", async () => {
|
||||
const order = createOrder();
|
||||
const signature = createBadSignature();
|
||||
const expectedError = new ExchangeRevertErrors.SignatureError(
|
||||
@@ -528,11 +493,12 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
order.makerAddress,
|
||||
signature,
|
||||
);
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount, signature))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount, signature)).to.revertWith(
|
||||
expectedError,
|
||||
);
|
||||
});
|
||||
|
||||
it('can\'t complementary fill an order with a bad signature that is always checked', async () => {
|
||||
it("can't complementary fill an order with a bad signature that is always checked", async () => {
|
||||
const order = createOrder();
|
||||
const takerAssetFillAmounts = splitAmount(order.takerAssetAmount);
|
||||
const goodSignature = createGoodSignature(SignatureType.Wallet);
|
||||
@@ -544,42 +510,39 @@ blockchainTests('Isolated fillOrder() tests', env => {
|
||||
badSignature,
|
||||
);
|
||||
await exchange.fillOrderAsync(order, takerAssetFillAmounts[0], goodSignature);
|
||||
return expect(exchange.fillOrderAsync(order, takerAssetFillAmounts[1], badSignature))
|
||||
.to.revertWith(expectedError);
|
||||
return expect(exchange.fillOrderAsync(order, takerAssetFillAmounts[1], badSignature)).to.revertWith(
|
||||
expectedError,
|
||||
);
|
||||
});
|
||||
|
||||
const TRANSFER_ERROR = 'TRANSFER_FAILED';
|
||||
|
||||
it('can\'t fill an order with a maker asset that fails to transfer', async () => {
|
||||
it("can't fill an order with a maker asset that fails to transfer", async () => {
|
||||
const order = createOrder({
|
||||
makerAssetData: createBadAssetData(),
|
||||
});
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount))
|
||||
.to.revertWith(TRANSFER_ERROR);
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount)).to.revertWith(TRANSFER_ERROR);
|
||||
});
|
||||
|
||||
it('can\'t fill an order with a taker asset that fails to transfer', async () => {
|
||||
it("can't fill an order with a taker asset that fails to transfer", async () => {
|
||||
const order = createOrder({
|
||||
takerAssetData: createBadAssetData(),
|
||||
});
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount))
|
||||
.to.revertWith(TRANSFER_ERROR);
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount)).to.revertWith(TRANSFER_ERROR);
|
||||
});
|
||||
|
||||
it('can\'t fill an order with a maker fee asset that fails to transfer', async () => {
|
||||
it("can't fill an order with a maker fee asset that fails to transfer", async () => {
|
||||
const order = createOrder({
|
||||
makerFeeAssetData: createBadAssetData(),
|
||||
});
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount))
|
||||
.to.revertWith(TRANSFER_ERROR);
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount)).to.revertWith(TRANSFER_ERROR);
|
||||
});
|
||||
|
||||
it('can\'t fill an order with a taker fee asset that fails to transfer', async () => {
|
||||
it("can't fill an order with a taker fee asset that fails to transfer", async () => {
|
||||
const order = createOrder({
|
||||
takerFeeAssetData: createBadAssetData(),
|
||||
});
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount))
|
||||
.to.revertWith(TRANSFER_ERROR);
|
||||
return expect(exchange.fillOrderAsync(order, order.takerAssetAmount)).to.revertWith(TRANSFER_ERROR);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -270,17 +270,9 @@ describe('matchOrders', () => {
|
||||
const numerator = signedOrderLeft.makerAssetAmount;
|
||||
const denominator = signedOrderLeft.takerAssetAmount;
|
||||
const target = signedOrderRight.makerAssetAmount;
|
||||
const _isRoundingErrorCeil = isRoundingErrorCeil(
|
||||
numerator,
|
||||
denominator,
|
||||
target,
|
||||
);
|
||||
const _isRoundingErrorCeil = isRoundingErrorCeil(numerator, denominator, target);
|
||||
expect(_isRoundingErrorCeil).to.be.true();
|
||||
const _isRoundingErrorFloor = isRoundingErrorFloor(
|
||||
numerator,
|
||||
denominator,
|
||||
target,
|
||||
);
|
||||
const _isRoundingErrorFloor = isRoundingErrorFloor(numerator, denominator, target);
|
||||
expect(_isRoundingErrorFloor).to.be.false();
|
||||
// Match signedOrderLeft with signedOrderRight
|
||||
// Note that the left maker received a slightly better sell price.
|
||||
@@ -336,17 +328,9 @@ describe('matchOrders', () => {
|
||||
const numerator = signedOrderRight.takerAssetAmount;
|
||||
const denominator = signedOrderRight.makerAssetAmount;
|
||||
const target = signedOrderLeft.takerAssetAmount;
|
||||
const _isRoundingErrorFloor = isRoundingErrorFloor(
|
||||
numerator,
|
||||
denominator,
|
||||
target,
|
||||
);
|
||||
const _isRoundingErrorFloor = isRoundingErrorFloor(numerator, denominator, target);
|
||||
expect(_isRoundingErrorFloor).to.be.true();
|
||||
const _isRoundingErrorCeil = isRoundingErrorCeil(
|
||||
numerator,
|
||||
denominator,
|
||||
target,
|
||||
);
|
||||
const _isRoundingErrorCeil = isRoundingErrorCeil(numerator, denominator, target);
|
||||
expect(_isRoundingErrorCeil).to.be.false();
|
||||
// Match signedOrderLeft isRoundingErrorFloor right maker received a slightly better purchase price.
|
||||
// This is intentional; see note in MixinMatchOrders.calculateMatchedFillResults.
|
||||
@@ -1414,17 +1398,9 @@ describe('matchOrders', () => {
|
||||
const numerator = signedOrderLeft.makerAssetAmount;
|
||||
const denominator = signedOrderLeft.takerAssetAmount;
|
||||
const target = signedOrderRight.makerAssetAmount;
|
||||
const _isRoundingErrorCeil = isRoundingErrorCeil(
|
||||
numerator,
|
||||
denominator,
|
||||
target,
|
||||
);
|
||||
const _isRoundingErrorCeil = isRoundingErrorCeil(numerator, denominator, target);
|
||||
expect(_isRoundingErrorCeil).to.be.true();
|
||||
const _isRoundingErrorFloor = isRoundingErrorFloor(
|
||||
numerator,
|
||||
denominator,
|
||||
target,
|
||||
);
|
||||
const _isRoundingErrorFloor = isRoundingErrorFloor(numerator, denominator, target);
|
||||
expect(_isRoundingErrorFloor).to.be.false();
|
||||
// Match signedOrderLeft with signedOrderRight
|
||||
// Note that the left maker received a slightly better sell price.
|
||||
@@ -1480,17 +1456,9 @@ describe('matchOrders', () => {
|
||||
const numerator = signedOrderRight.makerAssetAmount;
|
||||
const denominator = signedOrderRight.takerAssetAmount;
|
||||
const target = signedOrderLeft.makerAssetAmount;
|
||||
const _isRoundingErrorCeil = isRoundingErrorCeil(
|
||||
numerator,
|
||||
denominator,
|
||||
target,
|
||||
);
|
||||
const _isRoundingErrorCeil = isRoundingErrorCeil(numerator, denominator, target);
|
||||
expect(_isRoundingErrorCeil).to.be.false();
|
||||
const _isRoundingErrorFloor = isRoundingErrorFloor(
|
||||
numerator,
|
||||
denominator,
|
||||
target,
|
||||
);
|
||||
const _isRoundingErrorFloor = isRoundingErrorFloor(numerator, denominator, target);
|
||||
expect(_isRoundingErrorFloor).to.be.false();
|
||||
// Match signedOrderLeft with signedOrderRight
|
||||
// Note that the right maker received a slightly better purchase price.
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import { ReferenceFunctions as LibReferenceFunctions } from '@0x/contracts-exchange-libs';
|
||||
import {
|
||||
constants,
|
||||
describe,
|
||||
expect,
|
||||
} from '@0x/contracts-test-utils';
|
||||
import { constants, describe, expect } from '@0x/contracts-test-utils';
|
||||
import { LibMathRevertErrors } from '@0x/order-utils';
|
||||
import { OrderWithoutDomain as Order } from '@0x/types';
|
||||
import { BigNumber, SafeMathRevertErrors } from '@0x/utils';
|
||||
@@ -33,11 +29,7 @@ describe('Reference functions', () => {
|
||||
describe('calculateFillResults', () => {
|
||||
const MAX_UINT256_ROOT = constants.MAX_UINT256_ROOT;
|
||||
function makeOrder(details?: Partial<Order>): Order {
|
||||
return _.assign(
|
||||
{},
|
||||
EMPTY_ORDER,
|
||||
details,
|
||||
);
|
||||
return _.assign({}, EMPTY_ORDER, details);
|
||||
}
|
||||
|
||||
it('reverts if computing `fillResults.makerAssetFilledAmount` overflows', () => {
|
||||
@@ -52,8 +44,7 @@ describe('Reference functions', () => {
|
||||
takerAssetFilledAmount,
|
||||
order.makerAssetAmount,
|
||||
);
|
||||
return expect(() => calculateFillResults(order, takerAssetFilledAmount))
|
||||
.to.throw(expectedError.message);
|
||||
return expect(() => calculateFillResults(order, takerAssetFilledAmount)).to.throw(expectedError.message);
|
||||
});
|
||||
|
||||
it('reverts if computing `fillResults.makerFeePaid` overflows', () => {
|
||||
@@ -74,8 +65,7 @@ describe('Reference functions', () => {
|
||||
makerAssetFilledAmount,
|
||||
order.makerFee,
|
||||
);
|
||||
return expect(() => calculateFillResults(order, takerAssetFilledAmount))
|
||||
.to.throw(expectedError.message);
|
||||
return expect(() => calculateFillResults(order, takerAssetFilledAmount)).to.throw(expectedError.message);
|
||||
});
|
||||
|
||||
it('reverts if computing `fillResults.takerFeePaid` overflows', () => {
|
||||
@@ -91,8 +81,7 @@ describe('Reference functions', () => {
|
||||
takerAssetFilledAmount,
|
||||
order.takerFee,
|
||||
);
|
||||
return expect(() => calculateFillResults(order, takerAssetFilledAmount))
|
||||
.to.throw(expectedError.message);
|
||||
return expect(() => calculateFillResults(order, takerAssetFilledAmount)).to.throw(expectedError.message);
|
||||
});
|
||||
|
||||
it('reverts if `order.makerAssetAmount` is 0', () => {
|
||||
@@ -102,8 +91,7 @@ describe('Reference functions', () => {
|
||||
});
|
||||
const takerAssetFilledAmount = ONE_ETHER;
|
||||
const expectedError = new LibMathRevertErrors.DivisionByZeroError();
|
||||
return expect(() => calculateFillResults(order, takerAssetFilledAmount))
|
||||
.to.throw(expectedError.message);
|
||||
return expect(() => calculateFillResults(order, takerAssetFilledAmount)).to.throw(expectedError.message);
|
||||
});
|
||||
|
||||
it('reverts if `order.takerAssetAmount` is 0', () => {
|
||||
@@ -113,8 +101,7 @@ describe('Reference functions', () => {
|
||||
});
|
||||
const takerAssetFilledAmount = ONE_ETHER;
|
||||
const expectedError = new LibMathRevertErrors.DivisionByZeroError();
|
||||
return expect(() => calculateFillResults(order, takerAssetFilledAmount))
|
||||
.to.throw(expectedError.message);
|
||||
return expect(() => calculateFillResults(order, takerAssetFilledAmount)).to.throw(expectedError.message);
|
||||
});
|
||||
|
||||
it('reverts if there is a rounding error computing `makerAsssetFilledAmount`', () => {
|
||||
@@ -128,8 +115,7 @@ describe('Reference functions', () => {
|
||||
order.takerAssetAmount,
|
||||
order.makerAssetAmount,
|
||||
);
|
||||
return expect(() => calculateFillResults(order, takerAssetFilledAmount))
|
||||
.to.throw(expectedError.message);
|
||||
return expect(() => calculateFillResults(order, takerAssetFilledAmount)).to.throw(expectedError.message);
|
||||
});
|
||||
|
||||
it('reverts if there is a rounding error computing `makerFeePaid`', () => {
|
||||
@@ -149,8 +135,7 @@ describe('Reference functions', () => {
|
||||
order.makerAssetAmount,
|
||||
order.makerFee,
|
||||
);
|
||||
return expect(() => calculateFillResults(order, takerAssetFilledAmount))
|
||||
.to.throw(expectedError.message);
|
||||
return expect(() => calculateFillResults(order, takerAssetFilledAmount)).to.throw(expectedError.message);
|
||||
});
|
||||
|
||||
it('reverts if there is a rounding error computing `takerFeePaid`', () => {
|
||||
@@ -170,8 +155,7 @@ describe('Reference functions', () => {
|
||||
order.makerAssetAmount,
|
||||
order.takerFee,
|
||||
);
|
||||
return expect(() => calculateFillResults(order, takerAssetFilledAmount))
|
||||
.to.throw(expectedError.message);
|
||||
return expect(() => calculateFillResults(order, takerAssetFilledAmount)).to.throw(expectedError.message);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
import { artifacts as erc1155Artifacts } from '@0x/contracts-erc1155';
|
||||
import { artifacts as erc20Artifacts } from '@0x/contracts-erc20';
|
||||
import { artifacts as erc721Artifacts } from '@0x/contracts-erc721';
|
||||
import {
|
||||
BatchMatchOrder,
|
||||
LogDecoder,
|
||||
orderUtils,
|
||||
Web3ProviderEngine,
|
||||
} from '@0x/contracts-test-utils';
|
||||
import { BatchMatchOrder, LogDecoder, orderUtils, Web3ProviderEngine } from '@0x/contracts-test-utils';
|
||||
import {
|
||||
BatchMatchedFillResults,
|
||||
FillResults,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { BigNumber } from '@0x/utils';
|
||||
|
||||
export enum FeeRecipientAddressScenario {
|
||||
BurnAddress = 'BURN_ADDRESS',
|
||||
EthUserAddress = 'ETH_USER_ADDRESS',
|
||||
|
||||
@@ -130,9 +130,7 @@ export class IsolatedExchangeWrapper {
|
||||
await this.instance.fillOrder.sendTransactionAsync.call(this.instance, ...args),
|
||||
);
|
||||
this.lastTxEvents = extractEvents(receipt.logs);
|
||||
this.lastTxBalanceChanges = getBalanceChangesFromTransferFromCalls(
|
||||
this.lastTxEvents.transferFromCalls,
|
||||
);
|
||||
this.lastTxBalanceChanges = getBalanceChangesFromTransferFromCalls(this.lastTxEvents.transferFromCalls);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -179,21 +177,16 @@ function createEmptyEvents(): IsolatedExchangeEvents {
|
||||
function extractEvents(logs: LogEntry[]): IsolatedExchangeEvents {
|
||||
return {
|
||||
fillEvents: filterLogsToArguments<FillEventArgs>(logs, 'Fill'),
|
||||
transferFromCalls: filterLogsToArguments<DispatchTransferFromCallArgs>(
|
||||
logs,
|
||||
'DispatchTransferFromCalled',
|
||||
),
|
||||
transferFromCalls: filterLogsToArguments<DispatchTransferFromCallArgs>(logs, 'DispatchTransferFromCalled'),
|
||||
};
|
||||
}
|
||||
|
||||
// Executes transferFrom calls to compute relative balances for addresses.
|
||||
function getBalanceChangesFromTransferFromCalls(
|
||||
calls: DispatchTransferFromCallArgs[],
|
||||
): AssetBalances {
|
||||
function getBalanceChangesFromTransferFromCalls(calls: DispatchTransferFromCallArgs[]): AssetBalances {
|
||||
const changes: AssetBalances = {};
|
||||
for (const call of calls) {
|
||||
const { assetData, from, to, amount } = call;
|
||||
const balances = changes[assetData] = changes[assetData ] || {};
|
||||
const balances = (changes[assetData] = changes[assetData] || {});
|
||||
const fromBalance = balances[from] || constants.ZERO_AMOUNT;
|
||||
const toBalance = balances[to] || constants.ZERO_AMOUNT;
|
||||
balances[from] = fromBalance.minus(amount);
|
||||
|
||||
@@ -1,17 +1,7 @@
|
||||
import { ERC1155ProxyWrapper, ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy';
|
||||
import {
|
||||
ERC1155HoldingsByOwner,
|
||||
expect,
|
||||
OrderStatus,
|
||||
} from '@0x/contracts-test-utils';
|
||||
import { ERC1155HoldingsByOwner, expect, OrderStatus } from '@0x/contracts-test-utils';
|
||||
import { assetDataUtils, orderHashUtils } from '@0x/order-utils';
|
||||
import {
|
||||
AssetProxyId,
|
||||
BatchMatchedFillResults,
|
||||
FillResults,
|
||||
MatchedFillResults,
|
||||
SignedOrder,
|
||||
} from '@0x/types';
|
||||
import { AssetProxyId, BatchMatchedFillResults, FillResults, MatchedFillResults, SignedOrder } from '@0x/types';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import { LogWithDecodedArgs, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
@@ -2,5 +2,8 @@
|
||||
"extends": ["@0x/tslint-config"],
|
||||
"rules": {
|
||||
"custom-no-magic-numbers": false
|
||||
},
|
||||
"linterOptions": {
|
||||
"exclude": ["src/artifacts.ts"]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user