Skip to content

Commit

Permalink
verify network too
Browse files Browse the repository at this point in the history
  • Loading branch information
artursapek committed Nov 22, 2024
1 parent d34e807 commit eb2c00d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions connect/src/routes/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export class RouteResolver<N extends Network> {
const [, inputTokenId] = resolveWrappedToken(fromChain.network, fromChain.chain, inputToken);
const tokens = await Promise.all(
this.routeConstructors.map(async (rc) => {
const supportedNetworks = rc.supportedNetworks();
if (!supportedNetworks.includes(fromChain.network)) {
return [];
}

const supportedChains = rc.supportedChains(fromChain.network);
if (!supportedChains.includes(fromChain.chain) || !supportedChains.includes(toChain.chain)) {
return [];
Expand Down

0 comments on commit eb2c00d

Please sign in to comment.