Skip to content

Commit

Permalink
unique dest tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaspai committed Jan 14, 2025
1 parent 693ff6b commit 5e29f7f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
11 changes: 9 additions & 2 deletions api/cron-cache-gas-costs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,17 @@ const handler = async (
}
};

const getOutputTokensToChain = (chainId: number) =>
const getOutputTokensToChain = (chainId: number) => {
const destinationTokens = new Set<string>();
availableRoutes
.filter(({ destinationChainId }) => destinationChainId === chainId)
.map(({ destinationToken }) => destinationToken);
.forEach(({ destinationToken }) => {
if (!destinationTokens.has(destinationToken)) {
destinationTokens.add(destinationToken);
}
});
return Array.from(destinationTokens);
};

const cacheUpdatePromise = Promise.all(
mainnetChains.map(async (chain) => {
Expand Down
11 changes: 9 additions & 2 deletions api/cron-cache-l1-data-fee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,17 @@ const handler = async (
}
};

const getOutputTokensToChain = (chainId: number) =>
const getOutputTokensToChain = (chainId: number) => {
const destinationTokens = new Set<string>();
availableRoutes
.filter(({ destinationChainId }) => destinationChainId === chainId)
.map(({ destinationToken }) => destinationToken);
.forEach(({ destinationToken }) => {
if (!destinationTokens.has(destinationToken)) {
destinationTokens.add(destinationToken);
}
});
return Array.from(destinationTokens);
};

const cacheUpdatePromise = Promise.all(
mainnetChains
Expand Down

0 comments on commit 5e29f7f

Please sign in to comment.