Skip to content

Commit

Permalink
Use the TOKENS_ARR to compute available tokens so that the resulting …
Browse files Browse the repository at this point in the history
…array is filtered for the specific configured tokens (#1195)
  • Loading branch information
M-Picco authored Nov 2, 2023
1 parent b4e7cdb commit 9cea56f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions wormhole-connect/src/routes/operator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '@wormhole-foundation/wormhole-connect-sdk';
import { BigNumber } from 'ethers';

import { CHAINS, ROUTES, TOKENS } from 'config';
import { CHAINS, ROUTES, TOKENS, TOKENS_ARR } from 'config';
import { TokenConfig, Route } from 'config/types';
import {
ParsedMessage,
Expand Down Expand Up @@ -147,7 +147,8 @@ export class Operator {
): Promise<TokenConfig[]> {
const supported: { [key: string]: TokenConfig } = {};
for (const route of ROUTES) {
for (const key in TOKENS) {
for (const token of TOKENS_ARR) {
const { key } = token;
const alreadySupported = supported[key];
if (!alreadySupported) {
const isSupported = await this.isSupportedSourceToken(
Expand All @@ -173,7 +174,8 @@ export class Operator {
): Promise<TokenConfig[]> {
const supported: { [key: string]: TokenConfig } = {};
for (const route of ROUTES) {
for (const key in TOKENS) {
for (const token of TOKENS_ARR) {
const { key } = token;
const alreadySupported = supported[key];
if (!alreadySupported) {
const isSupported = await this.isSupportedDestToken(
Expand Down

0 comments on commit 9cea56f

Please sign in to comment.