Rebased against 3.0
.
Run prettier/linter.
This commit is contained in:
parent
a1293f160f
commit
61bdbd2d74
@ -249,9 +249,7 @@ contract LibExchangeRichErrorDecoder is
|
|||||||
function decodeAssetProxyExistsError(bytes memory encoded)
|
function decodeAssetProxyExistsError(bytes memory encoded)
|
||||||
public
|
public
|
||||||
pure
|
pure
|
||||||
returns (
|
returns (address assetProxyAddress)
|
||||||
address assetProxyAddress
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
_assertSelectorBytes(encoded, ASSET_PROXY_EXISTS_ERROR_SELECTOR);
|
_assertSelectorBytes(encoded, ASSET_PROXY_EXISTS_ERROR_SELECTOR);
|
||||||
assetProxyAddress = _readErrorParameterAsAddress(encoded, 0);
|
assetProxyAddress = _readErrorParameterAsAddress(encoded, 0);
|
||||||
|
@ -275,10 +275,7 @@ describe('Exchange core', () => {
|
|||||||
signedOrder = await orderFactory.newSignedOrderAsync();
|
signedOrder = await orderFactory.newSignedOrderAsync();
|
||||||
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
|
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
|
||||||
await exchangeWrapper.fillOrderAsync(signedOrder, takerAddress);
|
await exchangeWrapper.fillOrderAsync(signedOrder, takerAddress);
|
||||||
const expectedError = new ExchangeRevertErrors.OrderStatusError(
|
const expectedError = new ExchangeRevertErrors.OrderStatusError(orderHashHex, OrderStatus.FullyFilled);
|
||||||
orderHashHex,
|
|
||||||
OrderStatus.FullyFilled,
|
|
||||||
);
|
|
||||||
const tx = exchangeWrapper.fillOrderAsync(signedOrder, takerAddress);
|
const tx = exchangeWrapper.fillOrderAsync(signedOrder, takerAddress);
|
||||||
return expect(tx).to.revertWith(expectedError);
|
return expect(tx).to.revertWith(expectedError);
|
||||||
});
|
});
|
||||||
@ -534,10 +531,7 @@ describe('Exchange core', () => {
|
|||||||
it('should be able to cancel an order', async () => {
|
it('should be able to cancel an order', async () => {
|
||||||
await exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress);
|
await exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress);
|
||||||
const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||||
const expectedError = new ExchangeRevertErrors.OrderStatusError(
|
const expectedError = new ExchangeRevertErrors.OrderStatusError(orderHash, OrderStatus.Cancelled);
|
||||||
orderHash,
|
|
||||||
OrderStatus.Cancelled,
|
|
||||||
);
|
|
||||||
const tx = exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, {
|
const tx = exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, {
|
||||||
takerAssetFillAmount: signedOrder.takerAssetAmount.div(2),
|
takerAssetFillAmount: signedOrder.takerAssetAmount.div(2),
|
||||||
});
|
});
|
||||||
@ -562,10 +556,7 @@ describe('Exchange core', () => {
|
|||||||
it('should throw if already cancelled', async () => {
|
it('should throw if already cancelled', async () => {
|
||||||
await exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress);
|
await exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress);
|
||||||
const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||||
const expectedError = new ExchangeRevertErrors.OrderStatusError(
|
const expectedError = new ExchangeRevertErrors.OrderStatusError(orderHash, OrderStatus.Cancelled);
|
||||||
orderHash,
|
|
||||||
OrderStatus.Cancelled,
|
|
||||||
);
|
|
||||||
const tx = exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress);
|
const tx = exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress);
|
||||||
return expect(tx).to.revertWith(expectedError);
|
return expect(tx).to.revertWith(expectedError);
|
||||||
});
|
});
|
||||||
@ -576,10 +567,7 @@ describe('Exchange core', () => {
|
|||||||
expirationTimeSeconds: new BigNumber(currentTimestamp).minus(10),
|
expirationTimeSeconds: new BigNumber(currentTimestamp).minus(10),
|
||||||
});
|
});
|
||||||
const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
|
||||||
const expectedError = new ExchangeRevertErrors.OrderStatusError(
|
const expectedError = new ExchangeRevertErrors.OrderStatusError(orderHash, OrderStatus.Expired);
|
||||||
orderHash,
|
|
||||||
OrderStatus.Expired,
|
|
||||||
);
|
|
||||||
const tx = exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress);
|
const tx = exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress);
|
||||||
return expect(tx).to.revertWith(expectedError);
|
return expect(tx).to.revertWith(expectedError);
|
||||||
});
|
});
|
||||||
|
@ -14,10 +14,7 @@ import * as chai from 'chai';
|
|||||||
import * as crypto from 'crypto';
|
import * as crypto from 'crypto';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import {
|
import { artifacts, TestLibExchangeRichErrorDecoderContract } from '../src';
|
||||||
artifacts,
|
|
||||||
TestLibExchangeRichErrorDecoderContract,
|
|
||||||
} from '../src';
|
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
@ -48,20 +45,14 @@ describe('LibExchangeRichErrorDecoder', () => {
|
|||||||
return `0x${bytes}`;
|
return `0x${bytes}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createDecodeTest(
|
function createDecodeTest(revertType: new (...args: any[]) => RevertError, parameters: any[]): void {
|
||||||
revertType: new(...args: any[]) => RevertError,
|
|
||||||
parameters: any[],
|
|
||||||
) {
|
|
||||||
const revert = new revertType(...parameters);
|
const revert = new revertType(...parameters);
|
||||||
const encoded = revert.encode();
|
const encoded = revert.encode();
|
||||||
// Exploit the fact that `RevertError` types have the same names as their
|
// Exploit the fact that `RevertError` types have the same names as their
|
||||||
// Solidity counterparts.
|
// Solidity counterparts.
|
||||||
const endpointName = `decode${revert.name}`;
|
const endpointName = `decode${revert.name}`;
|
||||||
const callAsync = (encoded: string) => {
|
const callAsync = (_encoded: string) => {
|
||||||
return (decoder as any)[endpointName].callAsync.call(
|
return (decoder as any)[endpointName].callAsync.call((decoder as any)[endpointName], _encoded);
|
||||||
(decoder as any)[endpointName],
|
|
||||||
encoded,
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
describe(`${endpointName}()`, async () => {
|
describe(`${endpointName}()`, async () => {
|
||||||
it('decodes encoded parameters', async () => {
|
it('decodes encoded parameters', async () => {
|
||||||
@ -78,7 +69,7 @@ describe('LibExchangeRichErrorDecoder', () => {
|
|||||||
return expect(callAsync(withBadSelector)).to.revertWith('BAD_SELECTOR');
|
return expect(callAsync(withBadSelector)).to.revertWith('BAD_SELECTOR');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
const errorCode = ExchangeRevertErrors.SignatureErrorCode.Illegal;
|
const errorCode = ExchangeRevertErrors.SignatureErrorCode.Illegal;
|
||||||
@ -86,212 +77,91 @@ describe('LibExchangeRichErrorDecoder', () => {
|
|||||||
const signer = addressUtils.generatePseudoRandomAddress();
|
const signer = addressUtils.generatePseudoRandomAddress();
|
||||||
const signature = generateRandomBytes(SIGNATURE_LENGTH);
|
const signature = generateRandomBytes(SIGNATURE_LENGTH);
|
||||||
const errorData = generateRandomBytes(ERROR_DATA_LENGTH);
|
const errorData = generateRandomBytes(ERROR_DATA_LENGTH);
|
||||||
createDecodeTest(
|
createDecodeTest(ExchangeRevertErrors.SignatureError, [errorCode, orderHash, signer, signature]);
|
||||||
ExchangeRevertErrors.SignatureError,
|
createDecodeTest(ExchangeRevertErrors.SignatureValidatorError, [orderHash, signer, signature, errorData]);
|
||||||
[
|
createDecodeTest(ExchangeRevertErrors.SignatureWalletError, [orderHash, signer, signature, errorData]);
|
||||||
errorCode,
|
createDecodeTest(ExchangeRevertErrors.SignatureOrderValidatorError, [orderHash, signer, signature, errorData]);
|
||||||
orderHash,
|
createDecodeTest(ExchangeRevertErrors.SignatureWalletOrderValidatorError, [
|
||||||
signer,
|
orderHash,
|
||||||
signature,
|
signer,
|
||||||
],
|
signature,
|
||||||
);
|
errorData,
|
||||||
createDecodeTest(
|
]);
|
||||||
ExchangeRevertErrors.SignatureValidatorError,
|
|
||||||
[
|
|
||||||
orderHash,
|
|
||||||
signer,
|
|
||||||
signature,
|
|
||||||
errorData,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
createDecodeTest(
|
|
||||||
ExchangeRevertErrors.SignatureWalletError,
|
|
||||||
[
|
|
||||||
orderHash,
|
|
||||||
signer,
|
|
||||||
signature,
|
|
||||||
errorData,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
createDecodeTest(
|
|
||||||
ExchangeRevertErrors.SignatureOrderValidatorError,
|
|
||||||
[
|
|
||||||
orderHash,
|
|
||||||
signer,
|
|
||||||
signature,
|
|
||||||
errorData,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
createDecodeTest(
|
|
||||||
ExchangeRevertErrors.SignatureWalletOrderValidatorError,
|
|
||||||
[
|
|
||||||
orderHash,
|
|
||||||
signer,
|
|
||||||
signature,
|
|
||||||
errorData,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
const orderHash = orderUtils.generatePseudoRandomOrderHash();
|
const orderHash = orderUtils.generatePseudoRandomOrderHash();
|
||||||
const orderStatus = OrderStatus.FullyFilled;
|
const orderStatus = OrderStatus.FullyFilled;
|
||||||
createDecodeTest(
|
createDecodeTest(ExchangeRevertErrors.OrderStatusError, [orderHash, orderStatus]);
|
||||||
ExchangeRevertErrors.OrderStatusError,
|
|
||||||
[
|
|
||||||
orderHash,
|
|
||||||
orderStatus,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
const orderHash = orderUtils.generatePseudoRandomOrderHash();
|
const orderHash = orderUtils.generatePseudoRandomOrderHash();
|
||||||
const address = addressUtils.generatePseudoRandomAddress();
|
const address = addressUtils.generatePseudoRandomAddress();
|
||||||
createDecodeTest(
|
createDecodeTest(ExchangeRevertErrors.InvalidSenderError, [orderHash, address]);
|
||||||
ExchangeRevertErrors.InvalidSenderError,
|
createDecodeTest(ExchangeRevertErrors.InvalidMakerError, [orderHash, address]);
|
||||||
[
|
createDecodeTest(ExchangeRevertErrors.InvalidTakerError, [orderHash, address]);
|
||||||
orderHash,
|
|
||||||
address,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
createDecodeTest(
|
|
||||||
ExchangeRevertErrors.InvalidMakerError,
|
|
||||||
[
|
|
||||||
orderHash,
|
|
||||||
address,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
createDecodeTest(
|
|
||||||
ExchangeRevertErrors.InvalidTakerError,
|
|
||||||
[
|
|
||||||
orderHash,
|
|
||||||
address,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
const errorCode = ExchangeRevertErrors.FillErrorCode.TakerOverpay;
|
const errorCode = ExchangeRevertErrors.FillErrorCode.TakerOverpay;
|
||||||
const orderHash = orderUtils.generatePseudoRandomOrderHash();
|
const orderHash = orderUtils.generatePseudoRandomOrderHash();
|
||||||
createDecodeTest(
|
createDecodeTest(ExchangeRevertErrors.FillError, [errorCode, orderHash]);
|
||||||
ExchangeRevertErrors.FillError,
|
|
||||||
[
|
|
||||||
errorCode,
|
|
||||||
orderHash,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
const maker = addressUtils.generatePseudoRandomAddress();
|
const maker = addressUtils.generatePseudoRandomAddress();
|
||||||
const sender = addressUtils.generatePseudoRandomAddress();
|
const sender = addressUtils.generatePseudoRandomAddress();
|
||||||
const currentEpoch = generatePseudoRandomSalt();
|
const currentEpoch = generatePseudoRandomSalt();
|
||||||
createDecodeTest(
|
createDecodeTest(ExchangeRevertErrors.OrderEpochError, [maker, sender, currentEpoch]);
|
||||||
ExchangeRevertErrors.OrderEpochError,
|
|
||||||
[
|
|
||||||
maker,
|
|
||||||
sender,
|
|
||||||
currentEpoch,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
const assetProxyAddress = addressUtils.generatePseudoRandomAddress();
|
const assetProxyAddress = addressUtils.generatePseudoRandomAddress();
|
||||||
createDecodeTest(
|
createDecodeTest(ExchangeRevertErrors.AssetProxyExistsError, [assetProxyAddress]);
|
||||||
ExchangeRevertErrors.AssetProxyExistsError,
|
|
||||||
[
|
|
||||||
assetProxyAddress,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
const errorCode = ExchangeRevertErrors.AssetProxyDispatchErrorCode.UnknownAssetProxy;
|
const errorCode = ExchangeRevertErrors.AssetProxyDispatchErrorCode.UnknownAssetProxy;
|
||||||
const orderHash = orderUtils.generatePseudoRandomOrderHash();
|
const orderHash = orderUtils.generatePseudoRandomOrderHash();
|
||||||
const assetData = generateRandomBytes(ASSET_DATA_LENGTH);
|
const assetData = generateRandomBytes(ASSET_DATA_LENGTH);
|
||||||
createDecodeTest(
|
createDecodeTest(ExchangeRevertErrors.AssetProxyDispatchError, [errorCode, orderHash, assetData]);
|
||||||
ExchangeRevertErrors.AssetProxyDispatchError,
|
|
||||||
[
|
|
||||||
errorCode,
|
|
||||||
orderHash,
|
|
||||||
assetData,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
const orderHash = orderUtils.generatePseudoRandomOrderHash();
|
const orderHash = orderUtils.generatePseudoRandomOrderHash();
|
||||||
const assetData = generateRandomBytes(ASSET_DATA_LENGTH);
|
const assetData = generateRandomBytes(ASSET_DATA_LENGTH);
|
||||||
const errorData = generateRandomBytes(ERROR_DATA_LENGTH);
|
const errorData = generateRandomBytes(ERROR_DATA_LENGTH);
|
||||||
createDecodeTest(
|
createDecodeTest(ExchangeRevertErrors.AssetProxyTransferError, [orderHash, assetData, errorData]);
|
||||||
ExchangeRevertErrors.AssetProxyTransferError,
|
|
||||||
[
|
|
||||||
orderHash,
|
|
||||||
assetData,
|
|
||||||
errorData,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
const leftOrderHash = orderUtils.generatePseudoRandomOrderHash();
|
const leftOrderHash = orderUtils.generatePseudoRandomOrderHash();
|
||||||
const rightOrderHash = orderUtils.generatePseudoRandomOrderHash();
|
const rightOrderHash = orderUtils.generatePseudoRandomOrderHash();
|
||||||
createDecodeTest(
|
createDecodeTest(ExchangeRevertErrors.NegativeSpreadError, [leftOrderHash, rightOrderHash]);
|
||||||
ExchangeRevertErrors.NegativeSpreadError,
|
|
||||||
[
|
|
||||||
leftOrderHash,
|
|
||||||
rightOrderHash,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
const errorCode = ExchangeRevertErrors.TransactionErrorCode.AlreadyExecuted;
|
const errorCode = ExchangeRevertErrors.TransactionErrorCode.AlreadyExecuted;
|
||||||
const transactionHash = orderUtils.generatePseudoRandomOrderHash();
|
const transactionHash = orderUtils.generatePseudoRandomOrderHash();
|
||||||
createDecodeTest(
|
createDecodeTest(ExchangeRevertErrors.TransactionError, [errorCode, transactionHash]);
|
||||||
ExchangeRevertErrors.TransactionError,
|
|
||||||
[
|
|
||||||
errorCode,
|
|
||||||
transactionHash,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
const transactionHash = orderUtils.generatePseudoRandomOrderHash();
|
const transactionHash = orderUtils.generatePseudoRandomOrderHash();
|
||||||
const signer = addressUtils.generatePseudoRandomAddress();
|
const signer = addressUtils.generatePseudoRandomAddress();
|
||||||
const signature = generateRandomBytes(SIGNATURE_LENGTH);
|
const signature = generateRandomBytes(SIGNATURE_LENGTH);
|
||||||
createDecodeTest(
|
createDecodeTest(ExchangeRevertErrors.TransactionSignatureError, [transactionHash, signer, signature]);
|
||||||
ExchangeRevertErrors.TransactionSignatureError,
|
|
||||||
[
|
|
||||||
transactionHash,
|
|
||||||
signer,
|
|
||||||
signature,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
const transactionHash = orderUtils.generatePseudoRandomOrderHash();
|
const transactionHash = orderUtils.generatePseudoRandomOrderHash();
|
||||||
const errorData = generateRandomBytes(ERROR_DATA_LENGTH);
|
const errorData = generateRandomBytes(ERROR_DATA_LENGTH);
|
||||||
createDecodeTest(
|
createDecodeTest(ExchangeRevertErrors.TransactionExecutionError, [transactionHash, errorData]);
|
||||||
ExchangeRevertErrors.TransactionExecutionError,
|
|
||||||
[
|
|
||||||
transactionHash,
|
|
||||||
errorData,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
const orderHash = orderUtils.generatePseudoRandomOrderHash();
|
const orderHash = orderUtils.generatePseudoRandomOrderHash();
|
||||||
createDecodeTest(
|
createDecodeTest(ExchangeRevertErrors.IncompleteFillError, [orderHash]);
|
||||||
ExchangeRevertErrors.IncompleteFillError,
|
|
||||||
[
|
|
||||||
orderHash,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
})();
|
})();
|
||||||
});
|
});
|
||||||
|
@ -1127,10 +1127,7 @@ describe('matchOrders', () => {
|
|||||||
// Cancel left order
|
// Cancel left order
|
||||||
await exchangeWrapper.cancelOrderAsync(signedOrderLeft, signedOrderLeft.makerAddress);
|
await exchangeWrapper.cancelOrderAsync(signedOrderLeft, signedOrderLeft.makerAddress);
|
||||||
// Match orders
|
// Match orders
|
||||||
const expectedError = new ExchangeRevertErrors.OrderStatusError(
|
const expectedError = new ExchangeRevertErrors.OrderStatusError(orderHashHexLeft, OrderStatus.Cancelled);
|
||||||
orderHashHexLeft,
|
|
||||||
OrderStatus.Cancelled,
|
|
||||||
);
|
|
||||||
const tx = exchangeWrapper.matchOrdersAsync(signedOrderLeft, signedOrderRight, takerAddress);
|
const tx = exchangeWrapper.matchOrdersAsync(signedOrderLeft, signedOrderRight, takerAddress);
|
||||||
return expect(tx).to.revertWith(expectedError);
|
return expect(tx).to.revertWith(expectedError);
|
||||||
});
|
});
|
||||||
@ -1149,10 +1146,7 @@ describe('matchOrders', () => {
|
|||||||
// Cancel right order
|
// Cancel right order
|
||||||
await exchangeWrapper.cancelOrderAsync(signedOrderRight, signedOrderRight.makerAddress);
|
await exchangeWrapper.cancelOrderAsync(signedOrderRight, signedOrderRight.makerAddress);
|
||||||
// Match orders
|
// Match orders
|
||||||
const expectedError = new ExchangeRevertErrors.OrderStatusError(
|
const expectedError = new ExchangeRevertErrors.OrderStatusError(orderHashHexRight, OrderStatus.Cancelled);
|
||||||
orderHashHexRight,
|
|
||||||
OrderStatus.Cancelled,
|
|
||||||
);
|
|
||||||
const tx = exchangeWrapper.matchOrdersAsync(signedOrderLeft, signedOrderRight, takerAddress);
|
const tx = exchangeWrapper.matchOrdersAsync(signedOrderLeft, signedOrderRight, takerAddress);
|
||||||
return expect(tx).to.revertWith(expectedError);
|
return expect(tx).to.revertWith(expectedError);
|
||||||
});
|
});
|
||||||
|
@ -213,10 +213,7 @@ describe('Exchange wrappers', () => {
|
|||||||
expirationTimeSeconds: new BigNumber(currentTimestamp).minus(10),
|
expirationTimeSeconds: new BigNumber(currentTimestamp).minus(10),
|
||||||
});
|
});
|
||||||
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
|
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
|
||||||
const expectedError = new ExchangeRevertErrors.OrderStatusError(
|
const expectedError = new ExchangeRevertErrors.OrderStatusError(orderHashHex, OrderStatus.Expired);
|
||||||
orderHashHex,
|
|
||||||
OrderStatus.Expired,
|
|
||||||
);
|
|
||||||
const tx = exchangeWrapper.fillOrKillOrderAsync(signedOrder, takerAddress);
|
const tx = exchangeWrapper.fillOrKillOrderAsync(signedOrder, takerAddress);
|
||||||
return expect(tx).to.revertWith(expectedError);
|
return expect(tx).to.revertWith(expectedError);
|
||||||
});
|
});
|
||||||
@ -597,10 +594,7 @@ describe('Exchange wrappers', () => {
|
|||||||
|
|
||||||
await exchangeWrapper.fillOrKillOrderAsync(signedOrders[0], takerAddress);
|
await exchangeWrapper.fillOrKillOrderAsync(signedOrders[0], takerAddress);
|
||||||
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrders[0]);
|
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrders[0]);
|
||||||
const expectedError = new ExchangeRevertErrors.OrderStatusError(
|
const expectedError = new ExchangeRevertErrors.OrderStatusError(orderHashHex, OrderStatus.FullyFilled);
|
||||||
orderHashHex,
|
|
||||||
OrderStatus.FullyFilled,
|
|
||||||
);
|
|
||||||
const tx = exchangeWrapper.batchFillOrKillOrdersAsync(signedOrders, takerAddress, {
|
const tx = exchangeWrapper.batchFillOrKillOrdersAsync(signedOrders, takerAddress, {
|
||||||
takerAssetFillAmounts,
|
takerAssetFillAmounts,
|
||||||
});
|
});
|
||||||
|
@ -20,6 +20,7 @@ pragma solidity ^0.5.5;
|
|||||||
|
|
||||||
import "./MRichErrorTypes.sol";
|
import "./MRichErrorTypes.sol";
|
||||||
|
|
||||||
|
|
||||||
contract MRichErrors is
|
contract MRichErrors is
|
||||||
MRichErrorTypes
|
MRichErrorTypes
|
||||||
{
|
{
|
||||||
|
@ -107,7 +107,6 @@ export const eip712Utils = {
|
|||||||
name: constants.COORDINATOR_DOMAIN_NAME,
|
name: constants.COORDINATOR_DOMAIN_NAME,
|
||||||
version: constants.COORDINATOR_DOMAIN_VERSION,
|
version: constants.COORDINATOR_DOMAIN_VERSION,
|
||||||
verifyingContractAddress,
|
verifyingContractAddress,
|
||||||
chainId: transaction.chainId,
|
|
||||||
};
|
};
|
||||||
const transactionHash = transactionHashUtils.getTransactionHashHex(transaction);
|
const transactionHash = transactionHashUtils.getTransactionHashHex(transaction);
|
||||||
const approval = {
|
const approval = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user