Remove references to custom-no-magic-numbers ts lint rule [TKR-484] (#533)

* Remove references to `custom-no-magic-numbers ts` lint rule

* Run prettier
This commit is contained in:
Kyu 2022-08-01 17:50:40 -07:00 committed by GitHub
parent 9ce090c8cd
commit d3d4a08f91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 5 additions and 24 deletions

View File

@ -95,7 +95,6 @@ export { DEFAULT_FEE_SCHEDULE, DEFAULT_GAS_SCHEDULE } from './utils/market_opera
export const POSITIVE_SLIPPAGE_FEE_TRANSFORMER_GAS = new BigNumber(30000); export const POSITIVE_SLIPPAGE_FEE_TRANSFORMER_GAS = new BigNumber(30000);
// tslint:disable-next-line: custom-no-magic-numbers
export const KEEP_ALIVE_TTL = 5 * 60 * ONE_SECOND_MS; export const KEEP_ALIVE_TTL = 5 * 60 * ONE_SECOND_MS;
export const constants = { export const constants = {

View File

@ -61,7 +61,6 @@ import {
requiresTransformERC20, requiresTransformERC20,
} from './quote_consumer_utils'; } from './quote_consumer_utils';
// tslint:disable-next-line:custom-no-magic-numbers
const MAX_UINT256 = new BigNumber(2).pow(256).minus(1); const MAX_UINT256 = new BigNumber(2).pow(256).minus(1);
const { NULL_ADDRESS, NULL_BYTES, ZERO_AMOUNT } = constants; const { NULL_ADDRESS, NULL_BYTES, ZERO_AMOUNT } = constants;

View File

@ -104,11 +104,9 @@ function parseIndicativeQuoteResponseFromAltMM(
takerAmount, takerAmount,
// HACK: alt implementation does not return an expiration with indicative quotes // HACK: alt implementation does not return an expiration with indicative quotes
// return now + { IMPUTED EXPIRY SECONDS } to have it included after order checks // return now + { IMPUTED EXPIRY SECONDS } to have it included after order checks
expiry: expiry: new BigNumber(Date.now() / 1000)
// tslint:disable-next-line:custom-no-magic-numbers .integerValue(BigNumber.ROUND_DOWN)
new BigNumber(Date.now() / 1000) .plus(constants.ALT_MM_IMPUTED_INDICATIVE_EXPIRY_SECONDS),
.integerValue(BigNumber.ROUND_DOWN)
.plus(constants.ALT_MM_IMPUTED_INDICATIVE_EXPIRY_SECONDS),
}; };
} }
@ -243,7 +241,6 @@ export async function returnQuoteFromAltMMAsync<ResponseT>(
// empty response will get filtered out in validation // empty response will get filtered out in validation
const emptyResponse = {}; const emptyResponse = {};
// tslint:disable-next-line:custom-no-magic-numbers
if (response.status !== SUCCESS_CODE) { if (response.status !== SUCCESS_CODE) {
const rejectedRequestInfo = { const rejectedRequestInfo = {
status: response.status, status: response.status,

View File

@ -40,7 +40,6 @@ interface Cache {
[key: string]: AaveReserve[]; [key: string]: AaveReserve[];
} }
// tslint:disable-next-line:custom-no-magic-numbers
const RESERVES_REFRESH_INTERVAL_MS = 30 * constants.ONE_MINUTE_MS; const RESERVES_REFRESH_INTERVAL_MS = 30 * constants.ONE_MINUTE_MS;
/** /**

View File

@ -19,7 +19,6 @@ interface Cache {
[key: string]: CToken; [key: string]: CToken;
} }
// tslint:disable-next-line:custom-no-magic-numbers
const CTOKEN_REFRESH_INTERVAL_MS = 30 * constants.ONE_MINUTE_MS; const CTOKEN_REFRESH_INTERVAL_MS = 30 * constants.ONE_MINUTE_MS;
/** /**

View File

@ -37,7 +37,7 @@ import {
UniswapV3FillData, UniswapV3FillData,
} from './types'; } from './types';
// tslint:disable: custom-no-magic-numbers no-bitwise // tslint:disable: no-bitwise
export const ERC20_PROXY_ID = '0xf47261b0'; export const ERC20_PROXY_ID = '0xf47261b0';
export const WALLET_SIGNATURE = '0x04'; export const WALLET_SIGNATURE = '0x04';
@ -2472,7 +2472,6 @@ const uniswapV2CloneGasSchedule = (fillData?: FillData) => {
* I.e remove the overhead cost of ExchangeProxy (130k) and * I.e remove the overhead cost of ExchangeProxy (130k) and
* the ethereum transaction cost (21k) * the ethereum transaction cost (21k)
*/ */
// tslint:disable:custom-no-magic-numbers
export const DEFAULT_GAS_SCHEDULE: Required<GasSchedule> = { export const DEFAULT_GAS_SCHEDULE: Required<GasSchedule> = {
[ERC20BridgeSource.Native]: fillData => { [ERC20BridgeSource.Native]: fillData => {
// TODO jacob re-order imports so there is no circular rependency with SignedNativeOrder // TODO jacob re-order imports so there is no circular rependency with SignedNativeOrder
@ -2697,10 +2696,7 @@ export const POSITIVE_SLIPPAGE_FEE_TRANSFORMER_GAS = new BigNumber(20000);
export const DEFAULT_FEE_ESTIMATE = { gas: 0, fee: ZERO_AMOUNT }; export const DEFAULT_FEE_ESTIMATE = { gas: 0, fee: ZERO_AMOUNT };
// tslint:enable:custom-no-magic-numbers
export const DEFAULT_GET_MARKET_ORDERS_OPTS: Omit<GetMarketOrdersOpts, 'gasPrice'> = { export const DEFAULT_GET_MARKET_ORDERS_OPTS: Omit<GetMarketOrdersOpts, 'gasPrice'> = {
// tslint:disable-next-line: custom-no-magic-numbers
runLimit: 2 ** 15, runLimit: 2 ** 15,
excludedSources: [], excludedSources: [],
excludedFeeSources: [], excludedFeeSources: [],

View File

@ -14,7 +14,7 @@ import { dexSampleToFill, ethToOutputAmount, nativeOrderToFill } from './fills';
import { Path, PathPenaltyOpts } from './path'; import { Path, PathPenaltyOpts } from './path';
import { DexSample, ERC20BridgeSource, FeeSchedule, Fill, FillAdjustor, FillData, SamplerMetrics } from './types'; import { DexSample, ERC20BridgeSource, FeeSchedule, Fill, FillAdjustor, FillData, SamplerMetrics } from './types';
// tslint:disable: prefer-for-of custom-no-magic-numbers completed-docs no-bitwise // tslint:disable: prefer-for-of completed-docs no-bitwise
// NOTE: The Rust router will panic with less than 3 samples // NOTE: The Rust router will panic with less than 3 samples
const MIN_NUM_SAMPLE_INPUTS = 3; const MIN_NUM_SAMPLE_INPUTS = 3;

View File

@ -10,9 +10,7 @@ import { BALANCER_MAX_POOLS_FETCHED, BALANCER_TOP_POOLS_FETCHED } from '../const
import { NoOpPoolsCache } from './no_op_pools_cache'; import { NoOpPoolsCache } from './no_op_pools_cache';
import { AbstractPoolsCache, CacheValue, PoolsCache } from './pools_cache'; import { AbstractPoolsCache, CacheValue, PoolsCache } from './pools_cache';
// tslint:disable:custom-no-magic-numbers
const ONE_DAY_MS = 24 * 60 * 60 * 1000; const ONE_DAY_MS = 24 * 60 * 60 * 1000;
// tslint:enable:custom-no-magic-numbers
// tslint:disable: member-ordering // tslint:disable: member-ordering
const BALANCER_SUBGRAPH_URL = 'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer'; const BALANCER_SUBGRAPH_URL = 'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer';

View File

@ -18,7 +18,6 @@ const BEETHOVEN_X_SUBGRAPH_URL_BY_CHAIN = new Map<ChainId, string>([
[ChainId.Fantom, 'https://api.thegraph.com/subgraphs/name/beethovenxfi/beethovenx'], [ChainId.Fantom, 'https://api.thegraph.com/subgraphs/name/beethovenxfi/beethovenx'],
]); ]);
// tslint:disable-next-line:custom-no-magic-numbers
const ONE_DAY_MS = 24 * 60 * 60 * 1000; const ONE_DAY_MS = 24 * 60 * 60 * 1000;
interface BalancerPoolResponse { interface BalancerPoolResponse {

View File

@ -20,7 +20,6 @@ import { BalancerSwapInfo, BalancerSwaps } from '../types';
import { CacheValue, EMPTY_BALANCER_SWAPS, SwapInfoCache } from './pair_swaps_cache'; import { CacheValue, EMPTY_BALANCER_SWAPS, SwapInfoCache } from './pair_swaps_cache';
import { SubgraphPoolDataService } from './sgPoolDataService'; import { SubgraphPoolDataService } from './sgPoolDataService';
// tslint:disable-next-line:custom-no-magic-numbers
const ONE_DAY_MS = 24 * 60 * 60 * ONE_SECOND_MS; const ONE_DAY_MS = 24 * 60 * 60 * ONE_SECOND_MS;
export interface BalancerPoolResponse { export interface BalancerPoolResponse {

View File

@ -7,12 +7,10 @@ export interface CacheValue {
balancerSwaps: BalancerSwaps; balancerSwaps: BalancerSwaps;
} }
// tslint:disable:custom-no-magic-numbers
// Cache results for 30mins // Cache results for 30mins
const DEFAULT_CACHE_TIME_MS = (ONE_HOUR_IN_SECONDS / 2) * ONE_SECOND_MS; const DEFAULT_CACHE_TIME_MS = (ONE_HOUR_IN_SECONDS / 2) * ONE_SECOND_MS;
const DEFAULT_TIMEOUT_MS = ONE_SECOND_MS; const DEFAULT_TIMEOUT_MS = ONE_SECOND_MS;
export const EMPTY_BALANCER_SWAPS = { swapInfoExactIn: [], swapInfoExactOut: [] }; export const EMPTY_BALANCER_SWAPS = { swapInfoExactIn: [], swapInfoExactOut: [] };
// tslint:enable:custom-no-magic-numbers
/** /**
* Caches SwapInfo for a pair of tokens. * Caches SwapInfo for a pair of tokens.

View File

@ -7,11 +7,9 @@ export interface CacheValue {
pools: Pool[]; pools: Pool[];
} }
// tslint:disable:custom-no-magic-numbers
// Cache results for 30mins // Cache results for 30mins
const DEFAULT_CACHE_TIME_MS = (ONE_HOUR_IN_SECONDS / 2) * ONE_SECOND_MS; const DEFAULT_CACHE_TIME_MS = (ONE_HOUR_IN_SECONDS / 2) * ONE_SECOND_MS;
const DEFAULT_TIMEOUT_MS = 3000; const DEFAULT_TIMEOUT_MS = 3000;
// tslint:enable:custom-no-magic-numbers
export interface PoolsCache { export interface PoolsCache {
getFreshPoolsForPairAsync(takerToken: string, makerToken: string, timeoutMs?: number): Promise<Pool[]>; getFreshPoolsForPairAsync(takerToken: string, makerToken: string, timeoutMs?: number): Promise<Pool[]>;