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.ts21
1 files changed, 11 insertions, 10 deletions
diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts
index 2363ba256..7c2ae4db8 100644
--- a/packages/contracts/test/exchange/match_orders.ts
+++ b/packages/contracts/test/exchange/match_orders.ts
@@ -12,6 +12,7 @@ import { ERC20ProxyContract } from '../../src/contract_wrappers/generated/e_r_c2
import { ERC721ProxyContract } from '../../src/contract_wrappers/generated/e_r_c721_proxy';
import { ExchangeContract } from '../../src/contract_wrappers/generated/exchange';
import { artifacts } from '../../src/utils/artifacts';
+import { expectRevertOrAlwaysFailingTransactionAsync } from '../../src/utils/assertions';
import { chaiSetup } from '../../src/utils/chai_setup';
import { constants } from '../../src/utils/constants';
import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
@@ -625,9 +626,9 @@ describe('matchOrders', () => {
// Cancel left order
await exchangeWrapper.cancelOrderAsync(signedOrderLeft, signedOrderLeft.makerAddress);
// Match orders
- return expect(
+ return expectRevertOrAlwaysFailingTransactionAsync(
exchangeWrapper.matchOrdersAsync(signedOrderLeft, signedOrderRight, takerAddress),
- ).to.be.rejectedWith(constants.REVERT);
+ );
});
it('Should throw if right order is not fillable', async () => {
@@ -651,9 +652,9 @@ describe('matchOrders', () => {
// Cancel right order
await exchangeWrapper.cancelOrderAsync(signedOrderRight, signedOrderRight.makerAddress);
// Match orders
- return expect(
+ return expectRevertOrAlwaysFailingTransactionAsync(
exchangeWrapper.matchOrdersAsync(signedOrderLeft, signedOrderRight, takerAddress),
- ).to.be.rejectedWith(constants.REVERT);
+ );
});
it('should throw if there is not a positive spread', async () => {
@@ -675,7 +676,7 @@ describe('matchOrders', () => {
feeRecipientAddress: feeRecipientAddressRight,
});
// Match orders
- return expect(
+ return expectRevertOrAlwaysFailingTransactionAsync(
matchOrderTester.matchOrdersAndVerifyBalancesAsync(
signedOrderLeft,
signedOrderRight,
@@ -683,7 +684,7 @@ describe('matchOrders', () => {
erc20BalancesByOwner,
erc721TokenIdsByOwner,
),
- ).to.be.rejectedWith(constants.REVERT);
+ );
});
it('should throw if the left maker asset is not equal to the right taker asset ', async () => {
@@ -705,7 +706,7 @@ describe('matchOrders', () => {
feeRecipientAddress: feeRecipientAddressRight,
});
// Match orders
- return expect(
+ return expectRevertOrAlwaysFailingTransactionAsync(
matchOrderTester.matchOrdersAndVerifyBalancesAsync(
signedOrderLeft,
signedOrderRight,
@@ -713,7 +714,7 @@ describe('matchOrders', () => {
erc20BalancesByOwner,
erc721TokenIdsByOwner,
),
- ).to.be.rejectedWith(constants.REVERT);
+ );
});
it('should throw if the right maker asset is not equal to the left taker asset', async () => {
@@ -735,7 +736,7 @@ describe('matchOrders', () => {
feeRecipientAddress: feeRecipientAddressRight,
});
// Match orders
- return expect(
+ return expectRevertOrAlwaysFailingTransactionAsync(
matchOrderTester.matchOrdersAndVerifyBalancesAsync(
signedOrderLeft,
signedOrderRight,
@@ -743,7 +744,7 @@ describe('matchOrders', () => {
erc20BalancesByOwner,
erc721TokenIdsByOwner,
),
- ).to.be.rejectedWith(constants.REVERT);
+ );
});
it('should transfer correct amounts when left order maker asset is an ERC721 token', async () => {