aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/exchange/wrapper.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/wrapper.ts
parent72fb8460e90237fb7879fc47e95d84b6aa54911b (diff)
downloaddexon-sol-tools-1cc9d9c0713a56b59717498fcae6dc2720ca4fb0.tar.gz
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/wrapper.ts')
-rw-r--r--packages/contracts/test/exchange/wrapper.ts29
1 files changed, 15 insertions, 14 deletions
diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts
index 583ec9f91..18d69a647 100644
--- a/packages/contracts/test/exchange/wrapper.ts
+++ b/packages/contracts/test/exchange/wrapper.ts
@@ -15,6 +15,7 @@ import { ERC721ProxyContract } from '../../src/contract_wrappers/generated/e_r_c
import { ExchangeContract } from '../../src/contract_wrappers/generated/exchange';
import { TokenRegistryContract } from '../../src/contract_wrappers/generated/token_registry';
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';
@@ -172,8 +173,8 @@ describe('Exchange wrappers', () => {
expirationTimeSeconds: new BigNumber(Math.floor((Date.now() - 10000) / 1000)),
});
- return expect(exchangeWrapper.fillOrKillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith(
- constants.REVERT,
+ return expectRevertOrAlwaysFailingTransaction(
+ exchangeWrapper.fillOrKillOrderAsync(signedOrder, takerAddress),
);
});
@@ -184,8 +185,8 @@ describe('Exchange wrappers', () => {
takerAssetFillAmount: signedOrder.takerAssetAmount.div(2),
});
- return expect(exchangeWrapper.fillOrKillOrderAsync(signedOrder, takerAddress)).to.be.rejectedWith(
- constants.REVERT,
+ return expectRevertOrAlwaysFailingTransaction(
+ exchangeWrapper.fillOrKillOrderAsync(signedOrder, takerAddress),
);
});
});
@@ -485,11 +486,11 @@ describe('Exchange wrappers', () => {
await exchangeWrapper.fillOrKillOrderAsync(signedOrders[0], takerAddress);
- return expect(
+ return expectRevertOrAlwaysFailingTransaction(
exchangeWrapper.batchFillOrKillOrdersAsync(signedOrders, takerAddress, {
takerAssetFillAmounts,
}),
- ).to.be.rejectedWith(constants.REVERT);
+ );
});
});
@@ -679,11 +680,11 @@ describe('Exchange wrappers', () => {
orderFactory.newSignedOrder(),
];
- return expect(
+ return expectRevertOrAlwaysFailingTransaction(
exchangeWrapper.marketSellOrdersAsync(signedOrders, takerAddress, {
takerAssetFillAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(1000), 18),
}),
- ).to.be.rejectedWith(constants.REVERT);
+ );
});
});
@@ -768,11 +769,11 @@ describe('Exchange wrappers', () => {
orderFactory.newSignedOrder(),
];
- return expect(
+ return expectRevertOrAlwaysFailingTransaction(
exchangeWrapper.marketSellOrdersNoThrowAsync(signedOrders, takerAddress, {
takerAssetFillAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(1000), 18),
}),
- ).to.be.rejectedWith(constants.REVERT);
+ );
});
});
@@ -857,11 +858,11 @@ describe('Exchange wrappers', () => {
orderFactory.newSignedOrder(),
];
- return expect(
+ return expectRevertOrAlwaysFailingTransaction(
exchangeWrapper.marketBuyOrdersAsync(signedOrders, takerAddress, {
makerAssetFillAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(1000), 18),
}),
- ).to.be.rejectedWith(constants.REVERT);
+ );
});
});
@@ -946,11 +947,11 @@ describe('Exchange wrappers', () => {
orderFactory.newSignedOrder(),
];
- return expect(
+ return expectRevertOrAlwaysFailingTransaction(
exchangeWrapper.marketBuyOrdersNoThrowAsync(signedOrders, takerAddress, {
makerAssetFillAmount: Web3Wrapper.toBaseUnitAmount(new BigNumber(1000), 18),
}),
- ).to.be.rejectedWith(constants.REVERT);
+ );
});
});