Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: lower db pool connections #319

Merged
merged 4 commits into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ormconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ export const config: ConnectionOptions = {
logging: true,
logger: 'debug',
extra: {
max: 20,
max: 15,
},
};
20 changes: 17 additions & 3 deletions src/services/swap_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
WRAP_QUOTE_GAS,
ZERO,
} from '../constants';
import { InsufficientFundsError } from '../errors';
import { InsufficientFundsError, ValidationError, ValidationErrorCodes } from '../errors';
import { logger } from '../logger';
import { TokenMetadatasForChains } from '../token_metadatas_for_networks';
import {
Expand Down Expand Up @@ -74,8 +74,12 @@ export class SwapService {
...SWAP_QUOTER_OPTS,
rfqt: {
...SWAP_QUOTER_OPTS.rfqt,
warningLogger: logger.warn.bind(logger),
infoLogger: logger.info.bind(logger),
// tslint:disable-next-line:no-empty
warningLogger: () => {},
// tslint:disable-next-line:no-empty
infoLogger: () => {},
// warningLogger: logger.warn.bind(logger),
// infoLogger: logger.info.bind(logger),
},
};
this._swapQuoter = new SwapQuoter(this._provider, orderbook, swapQuoterOpts);
Expand Down Expand Up @@ -449,6 +453,16 @@ export class SwapService {
affiliateFee,
} = params;
let _rfqt: RfqtRequestOpts | undefined;
const isAllExcluded = Object.values(ERC20BridgeSource).every(s => excludedSources.includes(s));
if (isAllExcluded) {
throw new ValidationError([
{
field: 'excludedSources',
code: ValidationErrorCodes.ValueOutOfRange,
reason: 'Request excluded all sources',
},
]);
}
if (apiKey !== undefined && (isETHSell || from !== undefined)) {
let takerAddress;
switch (swapVersion) {
Expand Down
10 changes: 10 additions & 0 deletions src/token_metadatas_for_networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -777,4 +777,14 @@ export const TokenMetadatasForChains: TokenMetadataAndChainAddresses[] = [
[ChainId.Ganache]: NULL_ADDRESS,
},
},
{
symbol: 'CRV',
name: 'Curve DAO Token',
decimals: 18,
tokenAddresses: {
[ChainId.Mainnet]: '0xd533a949740bb3306d119cc777fa900ba034cd52',
[ChainId.Kovan]: NULL_ADDRESS,
[ChainId.Ganache]: NULL_ADDRESS,
},
},
];