foundry icon indicating copy to clipboard operation
foundry copied to clipboard

fix(config): prefer matching chain in ResolvedEtherscanConfigs::find_chain

Open Galoretka opened this issue 1 month ago • 0 comments

The previous iteration returned the first error in the etherscan configs, even if a valid config for the requested chain existed later. This was inconsistent with the function’s doc (“Returns the first config that matches the chain”) and caused spurious failures when unrelated entries were misconfigured. The new logic returns a matching Ok config if present; otherwise, it prefers UnknownChain errors for the requested chain, then falls back to the first error, else None. Added tests to enforce the intended behavior.

Galoretka avatar Dec 01 '25 21:12 Galoretka