Skip to content

Commit

Permalink
chore: Call defineChain to ensure chain registration in CUSTOM_CHAIN_…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
d4mr authored Sep 3, 2024
1 parent 5921658 commit 3c51ff6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export const getChain = async (chainId: number): Promise<Chain> => {

for (const override of config.chainOverridesParsed) {
if (chainId === override.id) {
return override;
// we need to call defineChain to ensure that the chain is registered in CUSTOM_CHAIN_MAP
// even if we have a Chain type, we need to call defineChain to ensure that the chain is registered
return defineChain(override);
}
}

Expand Down

0 comments on commit 3c51ff6

Please sign in to comment.