Skip to content

Commit 2b7496f

Browse files
committedFeb 27, 2025
dont fetch foreign address for unconfigured chains
1 parent e866a8f commit 2b7496f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed
 

‎wormhole-connect/scripts/checkForeignAssetsConfig.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ const checkEnvConfig = async (
8686

8787
const configForeignAddress =
8888
wrappedTokens[tokenId.chain]?.[tokenId.address]?.[chain];
89+
90+
if (!configForeignAddress) {
91+
// Skip chain for which there is no foreign asset configured
92+
// Connect can fetch them dynamically at runtime anyway
93+
return;
94+
}
95+
8996
if (chain === tokenId.chain) {
9097
if (configForeignAddress) {
9198
throw new Error(
@@ -120,7 +127,9 @@ const checkEnvConfig = async (
120127
`❌ Invalid foreign address detected! Env: ${env}, Token ${tokenId.chain} ${tokenId.address}, Chain: ${chain}, Expected: ${foreignAddress}, Received: ${configForeignAddress}`,
121128
);
122129
} else {
123-
console.log('✅ Config matches');
130+
console.log(
131+
`✅ ${tokenId.chain} ${tokenId.address} on ${chain} is correctly set to ${foreignAddress}`,
132+
);
124133
}
125134
} else {
126135
if (!recommendedUpdates[tokenId.chain]) {

0 commit comments

Comments
 (0)