Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Fix StaticCallProxy Exchange integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abandeali1 committed Jun 24, 2019
1 parent 4c1682a commit f04fce7
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions contracts/exchange/test/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
chaiSetup,
constants,
ERC20BalancesByOwner,
expectTransactionFailedAsync,
getLatestBlockTimestampAsync,
increaseTimeAndMineBlockAsync,
OrderFactory,
Expand Down Expand Up @@ -1724,10 +1723,14 @@ describe('Exchange core', () => {
constants.KECCAK256_NULL,
);
signedOrder = await orderFactory.newSignedOrderAsync({ makerAssetData: assetData });
await expectTransactionFailedAsync(
exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
RevertReason.TargetNotEven,
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
const expectedError = new ExchangeRevertErrors.AssetProxyTransferError(
orderHashHex,
assetData,
new StringRevertError(RevertReason.TargetNotEven).encode(),
);
const tx = exchangeWrapper.fillOrderAsync(signedOrder, takerAddress);
return expect(tx).to.revertWith(expectedError);
});
it('should fill the order if the staticcall is successful', async () => {
const staticCallData = staticCallTarget.assertEvenNumber.getABIEncodedTransactionData(
Expand Down Expand Up @@ -1778,10 +1781,14 @@ describe('Exchange core', () => {
[assetDataUtils.encodeERC20AssetData(defaultMakerAssetAddress), staticCallAssetData],
);
signedOrder = await orderFactory.newSignedOrderAsync({ makerAssetData: assetData });
await expectTransactionFailedAsync(
exchangeWrapper.fillOrderAsync(signedOrder, takerAddress),
RevertReason.TargetNotEven,
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
const expectedError = new ExchangeRevertErrors.AssetProxyTransferError(
orderHashHex,
assetData,
new StringRevertError(RevertReason.TargetNotEven).encode(),
);
const tx = exchangeWrapper.fillOrderAsync(signedOrder, takerAddress);
return expect(tx).to.revertWith(expectedError);
});
it('should fill the order is the staticcall is successful using the MultiAssetProxy', async () => {
const staticCallData = staticCallTarget.assertEvenNumber.getABIEncodedTransactionData(
Expand Down

0 comments on commit f04fce7

Please sign in to comment.