Skip to content

Fix for issue #1791: by pretty printing mangled platform_map codeblock in seed-canonical-heads.mjs - #1792

Open
drQedwards wants to merge 3 commits into
MetaMask:masterfrom
drQedwards:master
Open

Fix for issue #1791: by pretty printing mangled platform_map codeblock in seed-canonical-heads.mjs#1792
drQedwards wants to merge 3 commits into
MetaMask:masterfrom
drQedwards:master

Conversation

@drQedwards

@drQedwards drQedwards commented Apr 23, 2026

Copy link
Copy Markdown

Mangled platform_map code block now looks readable with its canonical constants to align and look like the constants for the canonical_head_group code block.

this closes and resolves issue #1791 only after this PR gets merged.

Only then can we begin fixing the issues we the mismatch errors in CAIP-2 in the metadata and labels directory when it comes to bip122, aka bitcoin having a mismatch where it is labeled in the metadata directory coherently, but not coded in the labels.


Note

Medium Risk
TypeScript syntax (as const, type annotations) in a .mjs file may break running the seed script with plain Node unless another runner is used; platform lookup behavior is equivalent for existing entries but warns on misses.

Overview
Reformats PLATFORM_MAP in scripts/seed-canonical-heads.mjs from a compact object keyed by CoinGecko platform names to an explicit array of { platform, caip2, assetNamespace } entries, styled like CANONICAL_HEAD_GROUPS.

platformToCaip19 is moved above the canonical-head constants and now resolves platforms via PLATFORM_MAP.find() instead of bracket lookup; unknown platforms still return null but also console.warn. The same chain/namespace values are preserved.

The diff also adds TypeScript-style annotations (as const, parameter/return types, typed summary array) and minor formatting tweaks in seed(); there is no change to canonical-head groups or label read/write logic.

Reviewed by Cursor Bugbot for commit 4c9f9b5. Bugbot is set up for automated code reviews on this repo. Configure here.

Mangled code block now looks readable.
@drQedwards
drQedwards requested review from a team and MRabenda as code owners April 23, 2026 04:05

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 036802d. Configure here.

Comment thread scripts/seed-canonical-heads.mjs Outdated
This resolves Cursor’s bug it caught while maintaining form .
@drQedwards

Copy link
Copy Markdown
Author

B
IMG_0607

See? The bug is resolved. As I mentioned, issue #1792 only gets resolved and closed after merging this PR .

Only then can the bigger issue of the mismatch error in the metadata and labeling directories for bip122 Bitcoin can be fixed and addressed.

@drQedwards

Copy link
Copy Markdown
Author

It is Bip122 not bip110 🙄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant