aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/exchange/transactions.ts
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-05-23 03:47:37 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-06-07 03:39:42 +0800
commit1cc9d9c0713a56b59717498fcae6dc2720ca4fb0 (patch)
treeeb20715294306fc61f77ecacaecc85c6d1144165 /packages/contracts/test/exchange/transactions.ts
parent72fb8460e90237fb7879fc47e95d84b6aa54911b (diff)
downloaddexon-sol-tools-1cc9d9c0713a56b59717498fcae6dc2720ca4fb0.tar
dexon-sol-tools-1cc9d9c0713a56b59717498fcae6dc2720ca4fb0.tar.gz
dexon-sol-tools-1cc9d9c0713a56b59717498fcae6dc2720ca4fb0.tar.bz2
dexon-sol-tools-1cc9d9c0713a56b59717498fcae6dc2720ca4fb0.tar.lz
dexon-sol-tools-1cc9d9c0713a56b59717498fcae6dc2720ca4fb0.tar.xz
dexon-sol-tools-1cc9d9c0713a56b59717498fcae6dc2720ca4fb0.tar.zst
dexon-sol-tools-1cc9d9c0713a56b59717498fcae6dc2720ca4fb0.zip
Replace constant.REVERT test assertions with expectRevertOrAlwaysFailingTransaction
Diffstat (limited to 'packages/contracts/test/exchange/transactions.ts')
-rw-r--r--packages/contracts/test/exchange/transactions.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/packages/contracts/test/exchange/transactions.ts b/packages/contracts/test/exchange/transactions.ts
index f31053ad3..8cd800ee2 100644
--- a/packages/contracts/test/exchange/transactions.ts
+++ b/packages/contracts/test/exchange/transactions.ts
@@ -11,6 +11,7 @@ import { ERC20ProxyContract } from '../../src/contract_wrappers/generated/e_r_c2
import { ExchangeContract } from '../../src/contract_wrappers/generated/exchange';
import { WhitelistContract } from '../../src/contract_wrappers/generated/whitelist';
import { artifacts } from '../../src/utils/artifacts';
+import { expectRevertOrAlwaysFailingTransaction } from '../../src/utils/assertions';
import { chaiSetup } from '../../src/utils/chai_setup';
import { constants } from '../../src/utils/constants';
import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
@@ -126,8 +127,8 @@ describe('Exchange transactions', () => {
});
it('should throw if not called by specified sender', async () => {
- return expect(exchangeWrapper.executeTransactionAsync(signedTx, takerAddress)).to.be.rejectedWith(
- constants.REVERT,
+ return expectRevertOrAlwaysFailingTransaction(
+ exchangeWrapper.executeTransactionAsync(signedTx, takerAddress),
);
});
@@ -168,8 +169,8 @@ describe('Exchange transactions', () => {
it('should throw if the a 0x transaction with the same transactionHash has already been executed', async () => {
await exchangeWrapper.executeTransactionAsync(signedTx, senderAddress);
- return expect(exchangeWrapper.executeTransactionAsync(signedTx, senderAddress)).to.be.rejectedWith(
- constants.REVERT,
+ return expectRevertOrAlwaysFailingTransaction(
+ exchangeWrapper.executeTransactionAsync(signedTx, senderAddress),
);
});
@@ -187,8 +188,8 @@ describe('Exchange transactions', () => {
});
it('should throw if not called by specified sender', async () => {
- return expect(exchangeWrapper.executeTransactionAsync(signedTx, makerAddress)).to.be.rejectedWith(
- constants.REVERT,
+ return expectRevertOrAlwaysFailingTransaction(
+ exchangeWrapper.executeTransactionAsync(signedTx, makerAddress),
);
});