prettier and lint
This commit is contained in:
@@ -12,7 +12,12 @@ export const assert = {
|
||||
sharedAssert.isHexString(`${variableName}.makerAssetData`, swapQuote.makerAssetData);
|
||||
sharedAssert.doesConformToSchema(`${variableName}.orders`, swapQuote.orders, schemas.signedOrdersSchema);
|
||||
sharedAssert.doesConformToSchema(`${variableName}.feeOrders`, swapQuote.feeOrders, schemas.signedOrdersSchema);
|
||||
assert.isValidOrdersForSwapQuote(`${variableName}.orders`, swapQuote.orders, swapQuote.makerAssetData, swapQuote.takerAssetData);
|
||||
assert.isValidOrdersForSwapQuote(
|
||||
`${variableName}.orders`,
|
||||
swapQuote.orders,
|
||||
swapQuote.makerAssetData,
|
||||
swapQuote.takerAssetData,
|
||||
);
|
||||
assert.isValidSwapQuoteInfo(`${variableName}.bestCaseQuoteInfo`, swapQuote.bestCaseQuoteInfo);
|
||||
assert.isValidSwapQuoteInfo(`${variableName}.worstCaseQuoteInfo`, swapQuote.worstCaseQuoteInfo);
|
||||
if (swapQuote.type === MarketOperation.Buy) {
|
||||
@@ -21,10 +26,21 @@ export const assert = {
|
||||
sharedAssert.isBigNumber(`${variableName}.takerAssetFillAmount`, swapQuote.takerAssetFillAmount);
|
||||
}
|
||||
},
|
||||
isValidOrdersForSwapQuote(variableName: string, orders: SignedOrder[], makerAssetData: string, takerAssetData: string): void {
|
||||
isValidOrdersForSwapQuote(
|
||||
variableName: string,
|
||||
orders: SignedOrder[],
|
||||
makerAssetData: string,
|
||||
takerAssetData: string,
|
||||
): void {
|
||||
_.every(orders, (order: SignedOrder, index: number) => {
|
||||
assert.assert(order.takerAssetData === takerAssetData, `Expected ${variableName}[${index}].takerAssetData to be ${takerAssetData}`);
|
||||
assert.assert(order.makerAssetData === makerAssetData, `Expected ${variableName}[${index}].makerAssetData to be ${makerAssetData}`);
|
||||
assert.assert(
|
||||
order.takerAssetData === takerAssetData,
|
||||
`Expected ${variableName}[${index}].takerAssetData to be ${takerAssetData}`,
|
||||
);
|
||||
assert.assert(
|
||||
order.makerAssetData === makerAssetData,
|
||||
`Expected ${variableName}[${index}].makerAssetData to be ${makerAssetData}`,
|
||||
);
|
||||
});
|
||||
},
|
||||
isValidForwarderSwapQuote(variableName: string, swapQuote: SwapQuote, wethAssetData: string): void {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ContractWrappers } from '@0x/contract-wrappers';
|
||||
import { SignedOrder, MarketOperation } from '@0x/types';
|
||||
import { MarketOperation, SignedOrder } from '@0x/types';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import { SupportedProvider, Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { Provider } from 'ethereum-types';
|
||||
|
||||
Reference in New Issue
Block a user