prettier and lint

This commit is contained in:
David Sun
2019-07-24 10:38:54 -07:00
parent 9977626de0
commit 91aa716c07
2 changed files with 21 additions and 5 deletions

View File

@@ -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 {

View File

@@ -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';