fix: derive active chain descriptions from CHAIN_NAMES (COW-982)#71
Merged
lgahdl merged 3 commits intoMay 29, 2026
Conversation
…W-982) Add CHAIN_NAMES map to src/data.ts as single source of truth for chain labels. ChainIdQuery description now derives from it dynamically. Update docs/api-reference.md and docs/architecture.md to remove hardcoded chain references and point to src/data.ts instead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 tests: CHAIN_NAMES has expected entries, all names are non-empty, ChainIdQuery.description contains every id+name pair from CHAIN_NAMES, and the description is not the old hardcoded string. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jeffersonBastos
approved these changes
May 29, 2026
jeffersonBastos
approved these changes
May 29, 2026
Contributor
There was a problem hiding this comment.
Do we need this test? Looks like little overhead.
yvesfracari
reviewed
May 29, 2026
Comment on lines
+134
to
+137
| export const CHAIN_NAMES: Record<SupportedChainId, string> = { | ||
| 1: "Ethereum mainnet", | ||
| 100: "Gnosis Chain", | ||
| }; |
…-982) Addresses reviewer feedback: import chain labels from getChainInfo() instead of hardcoding, and remove the low-value chain-names unit test. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CHAIN_NAMES: Record<SupportedChainId, string>tosrc/data.tsas single source of truth for chain display namesChainIdQuerydescription insrc/api/schemas/common.tsnow derives the "Indexed chains: ..." text fromCHAIN_NAMES— adding a new chain toSupportedChainIdupdates the API description automaticallydocs/architecture.md; point tosrc/data.tsinsteaddocs/api-reference.mdwith a note pointing tosrc/data.tsas source of truthHow to Test
pnpm typecheck && pnpm lint— passes.Related Issues
COW-982
🤖 Generated with Claude Code