Skip to content

fix(asset-tagging): correct UTXO coins incorrectly tagged as Smart Chain#244

Merged
CharlVS merged 2 commits intodevfrom
fix/asset-chain-tagging
Oct 20, 2025
Merged

fix(asset-tagging): correct UTXO coins incorrectly tagged as Smart Chain#244
CharlVS merged 2 commits intodevfrom
fix/asset-chain-tagging

Conversation

@CharlVS
Copy link
Copy Markdown
Collaborator

@CharlVS CharlVS commented Oct 18, 2025

Fixes incorrect asset chain tagging for UTXO coins. Ensures proper classification to avoid Smart Chain mislabeling. No breaking API changes.


Note

Prioritizes exact enum/ticker matching in CoinSubClass.parse and fixes smartChain/utxo identifiers to prevent UTXO mislabeling.

  • Parsing improvements (coin_subclasses.dart):
    • Add exact enum-name and exact ticker matching (sanitized), with UTXO tie-breaker favoring utxo.
    • Introduce _enumNameLower helper and refine partial-match checks (sanitized ticker).
    • Narrow tryParse to catch StateError only; update docs to reflect precedence.
  • Identifier corrections:
    • smartChain.ticker now returns SMART_CHAIN (was UTXO).
    • utxo.formatted now returns Native (was UTXO).

Written by Cursor Bugbot for commit ec40963. This will update automatically on new commits. Configure here.

- Updated CoinSubClass.parse() to prioritize exact enum name matches
- Added separate phase for exact ticker matches to resolve ambiguity
- Changed formatted getter for utxo to return 'Native' instead of 'UTXO'
- This fixes UTXO coins (zcash, ltc, doge) being incorrectly categorized as Smart Chain

Both utxo and smartChain had the same ticker 'UTXO', causing the parser
to match smartChain first due to enum order. The new parsing logic ensures
'UTXO' from coins_config.json correctly maps to CoinSubClass.utxo.
Copilot AI review requested due to automatic review settings October 18, 2025 16:40
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 18, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/asset-chain-tagging

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes asset chain tagging for UTXO coins that were being incorrectly classified as Smart Chain. The changes improve the matching logic by prioritizing exact matches and updates the display name for UTXO coins from "UTXO" to "Native".

Key Changes:

  • Implements a three-tier matching strategy: exact enum name match, exact ticker match, then partial contains match
  • Changes the UTXO display name from "UTXO" to "Native"

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread packages/komodo_defi_types/lib/src/coin_classes/coin_subclasses.dart Outdated
cursor[bot]

This comment was marked as outdated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 18, 2025

Visit the preview URL for this PR (updated for commit ec40963):

https://komodo-playground--pr244-fix-asset-chain-tagg-qvyrj2b5.web.app

(expires Sat, 25 Oct 2025 17:18:46 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2bfedd77fdea45b25ba7c784416e81f177aa5c47

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 18, 2025

Visit the preview URL for this PR (updated for commit ec40963):

https://kdf-sdk--pr244-fix-asset-chain-tagg-j7j75tx8.web.app

(expires Sat, 25 Oct 2025 17:17:47 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 9c1b6e6c010cf0b965c455ba7a69c4aedafa8a1d

- smartChain.ticker -> SMART_CHAIN\n- Sanitize ticker for exact/partial matches\n- Restore partial ticker matching\n- Prefer utxo on exact "UTXO"\n- Catch StateError and deduplicate enum name extraction
@smk762 smk762 self-requested a review October 19, 2025 23:13
@smk762
Copy link
Copy Markdown
Contributor

smk762 commented Oct 19, 2025

Tagging for UTXO confirmed, with Smart Chain subset appropriately tagged.
A couple of potential issues tho:

  • We also use NATIVE for parent coins like ATOM and ETH, though with colors matching their tokens. This should be ok, but makes the filter operate a little unintuatively, as ETH/ATOM wont come up if NATIVE is selected. Suggest keeping the coin type pill as they are (differing colors of native), but change the filter label to UTXO for a more logical deliniation.
image image image image
  • The white text on orange pill has suboptimal contrast in dark mode. The white on yellow for BNB/BEP20 is also hard to read in both ark and light mode. Suggest #ff9900 for UTXO native, and #ddbb00 for BNB/BEP20.

with updated colors:
image

@CharlVS CharlVS merged commit b520355 into dev Oct 20, 2025
8 of 9 checks passed
@CharlVS CharlVS deleted the fix/asset-chain-tagging branch October 20, 2025 12:20
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.

[BUG] UTXO coins tagged as "smart chains" in 0.9.3 release

3 participants