aboutsummaryrefslogtreecommitdiffstats
path: root/contracts
diff options
context:
space:
mode:
authorXianny <8582774+xianny@users.noreply.github.com>2019-01-12 02:04:30 +0800
committerGitHub <noreply@github.com>2019-01-12 02:04:30 +0800
commit943c378309a84ed142852c6584b53958df7817c8 (patch)
tree43536b7812b11f3a83db4208bfa5640643cfd6e8 /contracts
parentcf3787edbb9e8acf7160ab93b903b54c63bdffda (diff)
downloaddexon-sol-tools-943c378309a84ed142852c6584b53958df7817c8.tar
dexon-sol-tools-943c378309a84ed142852c6584b53958df7817c8.tar.gz
dexon-sol-tools-943c378309a84ed142852c6584b53958df7817c8.tar.bz2
dexon-sol-tools-943c378309a84ed142852c6584b53958df7817c8.tar.lz
dexon-sol-tools-943c378309a84ed142852c6584b53958df7817c8.tar.xz
dexon-sol-tools-943c378309a84ed142852c6584b53958df7817c8.tar.zst
dexon-sol-tools-943c378309a84ed142852c6584b53958df7817c8.zip
Implement tslint enum-naming to enforce PascalCase on enum members (#1474)
Diffstat (limited to 'contracts')
-rw-r--r--contracts/extensions/test/extensions/balance_threshold_filter.ts28
-rw-r--r--contracts/extensions/test/extensions/order_validator.ts12
-rw-r--r--contracts/protocol/test/exchange/core.ts20
-rw-r--r--contracts/protocol/test/exchange/wrapper.ts24
-rw-r--r--contracts/protocol/test/utils/match_order_tester.ts8
-rw-r--r--contracts/test-utils/CHANGELOG.json9
-rw-r--r--contracts/test-utils/src/types.ts14
7 files changed, 62 insertions, 53 deletions
diff --git a/contracts/extensions/test/extensions/balance_threshold_filter.ts b/contracts/extensions/test/extensions/balance_threshold_filter.ts
index 07199d60b..a1c322e08 100644
--- a/contracts/extensions/test/extensions/balance_threshold_filter.ts
+++ b/contracts/extensions/test/extensions/balance_threshold_filter.ts
@@ -1457,7 +1457,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
const orderInfoBeforeCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync(
validSignedOrder,
);
- expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable);
// Cancel
const txReceipt = await erc721MakerBalanceThresholdWrapper.cancelOrderAsync(
validSignedOrder,
@@ -1470,7 +1470,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
const orderInfoAfterCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync(
validSignedOrder,
);
- expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED);
+ expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled);
});
it('Should successfully cancel order if maker does not meet balance threshold', async () => {
// Create order where maker does not meet balance threshold
@@ -1479,7 +1479,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
const orderInfoBeforeCancelling = await erc721NonValidBalanceThresholdWrapper.getOrderInfoAsync(
signedOrderWithBadMakerAddress,
);
- expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable);
// Cancel
const txReceipt = await erc721NonValidBalanceThresholdWrapper.cancelOrderAsync(
signedOrderWithBadMakerAddress,
@@ -1492,7 +1492,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
const orderInfoAfterCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync(
signedOrderWithBadMakerAddress,
);
- expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED);
+ expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled);
});
});
@@ -1512,7 +1512,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
const orderInfoBeforeCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync(
signedOrder,
);
- return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable);
});
// Cancel
const txReceipt = await erc721MakerBalanceThresholdWrapper.batchCancelOrdersAsync(
@@ -1527,7 +1527,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
const orderInfoAfterCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync(
signedOrder,
);
- return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED);
+ return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled);
});
});
it('Should successfully batch cancel order if maker does not meet balance threshold', async () => {
@@ -1542,7 +1542,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
const orderInfoBeforeCancelling = await erc721NonValidBalanceThresholdWrapper.getOrderInfoAsync(
signedOrder,
);
- return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable);
});
// Cancel
const txReceipt = await erc721NonValidBalanceThresholdWrapper.batchCancelOrdersAsync(
@@ -1557,7 +1557,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
const orderInfoAfterCancelling = await erc721NonValidBalanceThresholdWrapper.getOrderInfoAsync(
signedOrder,
);
- return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED);
+ return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled);
});
});
});
@@ -1578,7 +1578,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
const orderInfoBeforeCancelling = await erc721MakerBalanceThresholdWrapper.getOrderInfoAsync(
signedOrder,
);
- return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable);
});
// Cancel
const cancelOrdersUpToThisSalt = new BigNumber(1);
@@ -1596,9 +1596,9 @@ describe(ContractName.BalanceThresholdFilter, () => {
);
const saltAsBigNumber = new BigNumber(salt);
if (saltAsBigNumber.lessThanOrEqualTo(cancelOrdersUpToThisSalt)) {
- return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED);
+ return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled);
} else {
- return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Fillable);
}
});
});
@@ -1614,7 +1614,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
const orderInfoBeforeCancelling = await erc721NonValidBalanceThresholdWrapper.getOrderInfoAsync(
signedOrder,
);
- return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ return expect(orderInfoBeforeCancelling.orderStatus).to.be.equal(OrderStatus.Fillable);
});
// Cancel
const cancelOrdersUpToThisSalt = new BigNumber(1);
@@ -1632,9 +1632,9 @@ describe(ContractName.BalanceThresholdFilter, () => {
);
const saltAsBigNumber = new BigNumber(salt);
if (saltAsBigNumber.lessThanOrEqualTo(cancelOrdersUpToThisSalt)) {
- return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.CANCELLED);
+ return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled);
} else {
- return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Fillable);
}
});
});
diff --git a/contracts/extensions/test/extensions/order_validator.ts b/contracts/extensions/test/extensions/order_validator.ts
index 82a6b937f..7d8675f36 100644
--- a/contracts/extensions/test/extensions/order_validator.ts
+++ b/contracts/extensions/test/extensions/order_validator.ts
@@ -432,7 +432,7 @@ describe('OrderValidator', () => {
takerAddress,
);
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
- expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ expect(orderInfo.orderStatus).to.be.equal(OrderStatus.Fillable);
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT);
expect(traderInfo.makerBalance).to.be.bignumber.equal(constants.ZERO_AMOUNT);
@@ -485,7 +485,7 @@ describe('OrderValidator', () => {
takerAddress,
);
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
- expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ expect(orderInfo.orderStatus).to.be.equal(OrderStatus.Fillable);
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT);
expect(traderInfo.makerBalance).to.be.bignumber.equal(makerBalance);
@@ -514,10 +514,10 @@ describe('OrderValidator', () => {
] = await orderValidator.getOrdersAndTradersInfo.callAsync(orders, takers);
const expectedOrderHash1 = orderHashUtils.getOrderHashHex(signedOrder);
const expectedOrderHash2 = orderHashUtils.getOrderHashHex(signedOrder2);
- expect(orderInfo1.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ expect(orderInfo1.orderStatus).to.be.equal(OrderStatus.Fillable);
expect(orderInfo1.orderHash).to.be.equal(expectedOrderHash1);
expect(orderInfo1.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT);
- expect(orderInfo2.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ expect(orderInfo2.orderStatus).to.be.equal(OrderStatus.Fillable);
expect(orderInfo2.orderHash).to.be.equal(expectedOrderHash2);
expect(orderInfo2.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT);
expect(traderInfo1.makerBalance).to.be.bignumber.equal(constants.ZERO_AMOUNT);
@@ -581,10 +581,10 @@ describe('OrderValidator', () => {
] = await orderValidator.getOrdersAndTradersInfo.callAsync(orders, takers);
const expectedOrderHash1 = orderHashUtils.getOrderHashHex(signedOrder);
const expectedOrderHash2 = orderHashUtils.getOrderHashHex(signedOrder2);
- expect(orderInfo1.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ expect(orderInfo1.orderStatus).to.be.equal(OrderStatus.Fillable);
expect(orderInfo1.orderHash).to.be.equal(expectedOrderHash1);
expect(orderInfo1.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT);
- expect(orderInfo2.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ expect(orderInfo2.orderStatus).to.be.equal(OrderStatus.Fillable);
expect(orderInfo2.orderHash).to.be.equal(expectedOrderHash2);
expect(orderInfo2.orderTakerAssetFilledAmount).to.be.bignumber.equal(constants.ZERO_AMOUNT);
expect(traderInfo1.makerBalance).to.be.bignumber.equal(makerBalance);
diff --git a/contracts/protocol/test/exchange/core.ts b/contracts/protocol/test/exchange/core.ts
index 42db8623d..700643b79 100644
--- a/contracts/protocol/test/exchange/core.ts
+++ b/contracts/protocol/test/exchange/core.ts
@@ -1043,7 +1043,7 @@ describe('Exchange core', () => {
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = new BigNumber(0);
- const expectedOrderStatus = OrderStatus.FILLABLE;
+ const expectedOrderStatus = OrderStatus.Fillable;
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
@@ -1053,7 +1053,7 @@ describe('Exchange core', () => {
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount;
- const expectedOrderStatus = OrderStatus.FULLY_FILLED;
+ const expectedOrderStatus = OrderStatus.FullyFilled;
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
@@ -1064,7 +1064,7 @@ describe('Exchange core', () => {
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = takerAssetFillAmount;
- const expectedOrderStatus = OrderStatus.FILLABLE;
+ const expectedOrderStatus = OrderStatus.Fillable;
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
@@ -1074,7 +1074,7 @@ describe('Exchange core', () => {
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = new BigNumber(0);
- const expectedOrderStatus = OrderStatus.CANCELLED;
+ const expectedOrderStatus = OrderStatus.Cancelled;
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
@@ -1086,7 +1086,7 @@ describe('Exchange core', () => {
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = takerAssetFillAmount;
- const expectedOrderStatus = OrderStatus.CANCELLED;
+ const expectedOrderStatus = OrderStatus.Cancelled;
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
@@ -1098,7 +1098,7 @@ describe('Exchange core', () => {
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = new BigNumber(0);
- const expectedOrderStatus = OrderStatus.EXPIRED;
+ const expectedOrderStatus = OrderStatus.Expired;
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
@@ -1112,7 +1112,7 @@ describe('Exchange core', () => {
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = takerAssetFillAmount;
- const expectedOrderStatus = OrderStatus.EXPIRED;
+ const expectedOrderStatus = OrderStatus.Expired;
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
@@ -1126,7 +1126,7 @@ describe('Exchange core', () => {
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount;
// FULLY_FILLED takes precedence over EXPIRED
- const expectedOrderStatus = OrderStatus.FULLY_FILLED;
+ const expectedOrderStatus = OrderStatus.FullyFilled;
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
@@ -1136,7 +1136,7 @@ describe('Exchange core', () => {
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = new BigNumber(0);
- const expectedOrderStatus = OrderStatus.INVALID_MAKER_ASSET_AMOUNT;
+ const expectedOrderStatus = OrderStatus.InvalidMakerAssetAmount;
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
@@ -1146,7 +1146,7 @@ describe('Exchange core', () => {
const orderInfo = await exchangeWrapper.getOrderInfoAsync(signedOrder);
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = new BigNumber(0);
- const expectedOrderStatus = OrderStatus.INVALID_TAKER_ASSET_AMOUNT;
+ const expectedOrderStatus = OrderStatus.InvalidTakerAssetAmount;
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
expect(orderInfo.orderStatus).to.equal(expectedOrderStatus);
diff --git a/contracts/protocol/test/exchange/wrapper.ts b/contracts/protocol/test/exchange/wrapper.ts
index c9efb0c9d..4c4506945 100644
--- a/contracts/protocol/test/exchange/wrapper.ts
+++ b/contracts/protocol/test/exchange/wrapper.ts
@@ -1288,7 +1288,7 @@ describe('Exchange wrappers', () => {
_.forEach(signedOrders, (signedOrder, index) => {
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = new BigNumber(0);
- const expectedOrderStatus = OrderStatus.FILLABLE;
+ const expectedOrderStatus = OrderStatus.Fillable;
const orderInfo = ordersInfo[index];
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
@@ -1303,7 +1303,7 @@ describe('Exchange wrappers', () => {
_.forEach(signedOrders, (signedOrder, index) => {
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount.div(2);
- const expectedOrderStatus = OrderStatus.FILLABLE;
+ const expectedOrderStatus = OrderStatus.Fillable;
const orderInfo = ordersInfo[index];
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
@@ -1317,7 +1317,7 @@ describe('Exchange wrappers', () => {
_.forEach(signedOrders, (signedOrder, index) => {
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount;
- const expectedOrderStatus = OrderStatus.FULLY_FILLED;
+ const expectedOrderStatus = OrderStatus.FullyFilled;
const orderInfo = ordersInfo[index];
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
@@ -1331,7 +1331,7 @@ describe('Exchange wrappers', () => {
_.forEach(signedOrders, (signedOrder, index) => {
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = new BigNumber(0);
- const expectedOrderStatus = OrderStatus.CANCELLED;
+ const expectedOrderStatus = OrderStatus.Cancelled;
const orderInfo = ordersInfo[index];
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
@@ -1347,7 +1347,7 @@ describe('Exchange wrappers', () => {
_.forEach(signedOrders, (signedOrder, index) => {
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount.div(2);
- const expectedOrderStatus = OrderStatus.CANCELLED;
+ const expectedOrderStatus = OrderStatus.Cancelled;
const orderInfo = ordersInfo[index];
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
@@ -1363,7 +1363,7 @@ describe('Exchange wrappers', () => {
_.forEach(signedOrders, (signedOrder, index) => {
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = new BigNumber(0);
- const expectedOrderStatus = OrderStatus.EXPIRED;
+ const expectedOrderStatus = OrderStatus.Expired;
const orderInfo = ordersInfo[index];
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
@@ -1381,7 +1381,7 @@ describe('Exchange wrappers', () => {
_.forEach(signedOrders, (signedOrder, index) => {
const expectedOrderHash = orderHashUtils.getOrderHashHex(signedOrder);
const expectedTakerAssetFilledAmount = signedOrder.takerAssetAmount.div(2);
- const expectedOrderStatus = OrderStatus.EXPIRED;
+ const expectedOrderStatus = OrderStatus.Expired;
const orderInfo = ordersInfo[index];
expect(orderInfo.orderHash).to.be.equal(expectedOrderHash);
expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount);
@@ -1408,7 +1408,7 @@ describe('Exchange wrappers', () => {
const expectedUnfilledOrderHash = orderHashUtils.getOrderHashHex(unfilledOrder);
const expectedUnfilledTakerAssetFilledAmount = new BigNumber(0);
- const expectedUnfilledOrderStatus = OrderStatus.FILLABLE;
+ const expectedUnfilledOrderStatus = OrderStatus.Fillable;
const unfilledOrderInfo = ordersInfo[0];
expect(unfilledOrderInfo.orderHash).to.be.equal(expectedUnfilledOrderHash);
expect(unfilledOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(
@@ -1418,7 +1418,7 @@ describe('Exchange wrappers', () => {
const expectedPartialOrderHash = orderHashUtils.getOrderHashHex(partiallyFilledOrder);
const expectedPartialTakerAssetFilledAmount = partiallyFilledOrder.takerAssetAmount.div(2);
- const expectedPartialOrderStatus = OrderStatus.FILLABLE;
+ const expectedPartialOrderStatus = OrderStatus.Fillable;
const partialOrderInfo = ordersInfo[1];
expect(partialOrderInfo.orderHash).to.be.equal(expectedPartialOrderHash);
expect(partialOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(
@@ -1428,7 +1428,7 @@ describe('Exchange wrappers', () => {
const expectedFilledOrderHash = orderHashUtils.getOrderHashHex(fullyFilledOrder);
const expectedFilledTakerAssetFilledAmount = fullyFilledOrder.takerAssetAmount;
- const expectedFilledOrderStatus = OrderStatus.FULLY_FILLED;
+ const expectedFilledOrderStatus = OrderStatus.FullyFilled;
const filledOrderInfo = ordersInfo[2];
expect(filledOrderInfo.orderHash).to.be.equal(expectedFilledOrderHash);
expect(filledOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(
@@ -1438,7 +1438,7 @@ describe('Exchange wrappers', () => {
const expectedCancelledOrderHash = orderHashUtils.getOrderHashHex(cancelledOrder);
const expectedCancelledTakerAssetFilledAmount = new BigNumber(0);
- const expectedCancelledOrderStatus = OrderStatus.CANCELLED;
+ const expectedCancelledOrderStatus = OrderStatus.Cancelled;
const cancelledOrderInfo = ordersInfo[3];
expect(cancelledOrderInfo.orderHash).to.be.equal(expectedCancelledOrderHash);
expect(cancelledOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(
@@ -1448,7 +1448,7 @@ describe('Exchange wrappers', () => {
const expectedExpiredOrderHash = orderHashUtils.getOrderHashHex(expiredOrder);
const expectedExpiredTakerAssetFilledAmount = new BigNumber(0);
- const expectedExpiredOrderStatus = OrderStatus.EXPIRED;
+ const expectedExpiredOrderStatus = OrderStatus.Expired;
const expiredOrderInfo = ordersInfo[4];
expect(expiredOrderInfo.orderHash).to.be.equal(expectedExpiredOrderHash);
expect(expiredOrderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(
diff --git a/contracts/protocol/test/utils/match_order_tester.ts b/contracts/protocol/test/utils/match_order_tester.ts
index 8f574704e..31864820f 100644
--- a/contracts/protocol/test/utils/match_order_tester.ts
+++ b/contracts/protocol/test/utils/match_order_tester.ts
@@ -268,15 +268,15 @@ export class MatchOrderTester {
const maxAmountBoughtByLeftMaker = signedOrderLeft.takerAssetAmount.minus(initialLeftOrderFilledAmount);
const leftOrderInfo: OrderInfo = await this._exchangeWrapper.getOrderInfoAsync(signedOrderLeft);
const leftExpectedStatus = expectedTransferAmounts.amountBoughtByLeftMaker.equals(maxAmountBoughtByLeftMaker)
- ? OrderStatus.FULLY_FILLED
- : OrderStatus.FILLABLE;
+ ? OrderStatus.FullyFilled
+ : OrderStatus.Fillable;
expect(leftOrderInfo.orderStatus, 'Checking exchange status for left order').to.be.equal(leftExpectedStatus);
// Assert right order status
const maxAmountBoughtByRightMaker = signedOrderRight.takerAssetAmount.minus(initialRightOrderFilledAmount);
const rightOrderInfo: OrderInfo = await this._exchangeWrapper.getOrderInfoAsync(signedOrderRight);
const rightExpectedStatus = expectedTransferAmounts.amountBoughtByRightMaker.equals(maxAmountBoughtByRightMaker)
- ? OrderStatus.FULLY_FILLED
- : OrderStatus.FILLABLE;
+ ? OrderStatus.FullyFilled
+ : OrderStatus.Fillable;
expect(rightOrderInfo.orderStatus, 'Checking exchange status for right order').to.be.equal(rightExpectedStatus);
}
/// @dev Asserts account balances after matching orders.
diff --git a/contracts/test-utils/CHANGELOG.json b/contracts/test-utils/CHANGELOG.json
index 13f076893..7bebd0fcb 100644
--- a/contracts/test-utils/CHANGELOG.json
+++ b/contracts/test-utils/CHANGELOG.json
@@ -1,5 +1,14 @@
[
{
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Renamed OrderStatus enum members to PascalCase to conform with tslint enum-naming rule",
+ "pr": 1474
+ }
+ ]
+ },
+ {
"timestamp": 1547225310,
"version": "1.0.4",
"changes": [
diff --git a/contracts/test-utils/src/types.ts b/contracts/test-utils/src/types.ts
index 1630eab0d..60cb2b102 100644
--- a/contracts/test-utils/src/types.ts
+++ b/contracts/test-utils/src/types.ts
@@ -70,13 +70,13 @@ export interface Token {
}
export enum OrderStatus {
- INVALID,
- INVALID_MAKER_ASSET_AMOUNT,
- INVALID_TAKER_ASSET_AMOUNT,
- FILLABLE,
- EXPIRED,
- FULLY_FILLED,
- CANCELLED,
+ Invalid,
+ InvalidMakerAssetAmount,
+ InvalidTakerAssetAmount,
+ Fillable,
+ Expired,
+ FullyFilled,
+ Cancelled,
}
export enum ContractName {