Skip to content

Commit 9cea56f

Browse files
authored
Use the TOKENS_ARR to compute available tokens so that the resulting array is filtered for the specific configured tokens (#1195)
1 parent b4e7cdb commit 9cea56f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

wormhole-connect/src/routes/operator.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from '@wormhole-foundation/wormhole-connect-sdk';
77
import { BigNumber } from 'ethers';
88

9-
import { CHAINS, ROUTES, TOKENS } from 'config';
9+
import { CHAINS, ROUTES, TOKENS, TOKENS_ARR } from 'config';
1010
import { TokenConfig, Route } from 'config/types';
1111
import {
1212
ParsedMessage,
@@ -147,7 +147,8 @@ export class Operator {
147147
): Promise<TokenConfig[]> {
148148
const supported: { [key: string]: TokenConfig } = {};
149149
for (const route of ROUTES) {
150-
for (const key in TOKENS) {
150+
for (const token of TOKENS_ARR) {
151+
const { key } = token;
151152
const alreadySupported = supported[key];
152153
if (!alreadySupported) {
153154
const isSupported = await this.isSupportedSourceToken(
@@ -173,7 +174,8 @@ export class Operator {
173174
): Promise<TokenConfig[]> {
174175
const supported: { [key: string]: TokenConfig } = {};
175176
for (const route of ROUTES) {
176-
for (const key in TOKENS) {
177+
for (const token of TOKENS_ARR) {
178+
const { key } = token;
177179
const alreadySupported = supported[key];
178180
if (!alreadySupported) {
179181
const isSupported = await this.isSupportedDestToken(

0 commit comments

Comments
 (0)