Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
exit early when all sources excluded
Browse files Browse the repository at this point in the history
  • Loading branch information
dekz committed Aug 14, 2020
1 parent dedd721 commit 531b415
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/services/swap_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,11 @@ export class SwapService {
affiliateFee,
} = params;
let _rfqt: RfqtRequestOpts | undefined;
const isAllExcluded = Object.values(ERC20BridgeSource).every(s => excludedSources.includes(s));
if (isAllExcluded) {
logger.info('Request contained all sources excluded', excludedSources);
throw new Error(`All sources excluded: ${excludedSources}`);
}
if (apiKey !== undefined && (isETHSell || from !== undefined)) {
let takerAddress;
switch (swapVersion) {
Expand Down

0 comments on commit 531b415

Please sign in to comment.