Skip to content

Commit 3c51ff6

Browse files
authored
chore: Call defineChain to ensure chain registration in CUSTOM_CHAIN_MAP (#636)
This commit modifies the `getChain` function in the `chain.ts` file to call the `defineChain` function when a matching chain override is found. This ensures that the chain is registered in the `CUSTOM_CHAIN_MAP` even if a `Chain` type is already available.
1 parent 5921658 commit 3c51ff6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/utils/chain.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ export const getChain = async (chainId: number): Promise<Chain> => {
1111

1212
for (const override of config.chainOverridesParsed) {
1313
if (chainId === override.id) {
14-
return override;
14+
// we need to call defineChain to ensure that the chain is registered in CUSTOM_CHAIN_MAP
15+
// even if we have a Chain type, we need to call defineChain to ensure that the chain is registered
16+
return defineChain(override);
1517
}
1618
}
1719

0 commit comments

Comments
 (0)