From 943c378309a84ed142852c6584b53958df7817c8 Mon Sep 17 00:00:00 2001 From: Xianny <8582774+xianny@users.noreply.github.com> Date: Fri, 11 Jan 2019 10:04:30 -0800 Subject: Implement tslint enum-naming to enforce PascalCase on enum members (#1474) --- .../test/extensions/balance_threshold_filter.ts | 28 +++++++++++----------- .../extensions/test/extensions/order_validator.ts | 12 +++++----- 2 files changed, 20 insertions(+), 20 deletions(-) (limited to 'contracts/extensions') 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); -- cgit v1.2.3