Skip to content

feat: enhance richlist token holder retrieval for MoveVM - #134

Merged
Benzbeeb merged 2 commits into
mainfrom
fix-xslp
Aug 5, 2026
Merged

feat: enhance richlist token holder retrieval for MoveVM#134
Benzbeeb merged 2 commits into
mainfrom
fix-xslp

Conversation

@Benzbeeb

@Benzbeeb Benzbeeb commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
  • Added support for resolving bank denom "move/" to its corresponding richlist denom using FA metadata.
  • Implemented a new method resolveMoveSymbolDenom to handle metadata resolution and retry fetching token holders if no records are found.
  • Improved error handling in the GetTokenHolders method to ensure robust fetching of token holder data.

This enhancement allows for better integration with MoveVM token holders, ensuring accurate data retrieval.

Summary by CodeRabbit

  • Bug Fixes
    • Improved rich-list results for Move-based assets by automatically retrying with the corresponding metadata denomination when direct results are unavailable.
    • Preserved the requested denomination when valid results are empty, including paginated requests.
    • Added validation to prevent invalid or unresolved denomination mappings from producing incorrect results.
    • Improved holder data retrieval when an asset’s original denomination is unavailable.

- Added support for resolving bank denom "move/<addr>" to its corresponding richlist denom using FA metadata.
- Implemented a new method `resolveMoveSymbolDenom` to handle metadata resolution and retry fetching token holders if no records are found.
- Improved error handling in the `GetTokenHolders` method to ensure robust fetching of token holder data.

This enhancement allows for better integration with MoveVM token holders, ensuring accurate data retrieval.
@Benzbeeb
Benzbeeb requested a review from songwongtp August 5, 2026 08:21
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a240ccf7-43c5-49ac-84dd-8868c4d5f3eb

📥 Commits

Reviewing files that changed from the base of the PR and between 5f8915b and 38fd838.

📒 Files selected for processing (2)
  • api/handler/richlist/richlist.go
  • api/handler/richlist/richlist_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • api/handler/richlist/richlist.go

Walkthrough

The rich-list handler now supports MoveVM fallback queries. When a move/<address> query has no stored records, it resolves the FA metadata denomination and retries the query. Regression tests cover pagination and cached-symbol fallback behavior.

Changes

MoveVM rich-list fallback

Layer / File(s) Summary
Resolve and query Move denominations
api/handler/richlist/richlist.go, api/handler/richlist/richlist_test.go
The handler detects move/ denominations, validates metadata resolution, and retries with a changed denomination when the original query has no records. Tests cover empty offset pages and cached-symbol fallback responses.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: songwongtp

Poem

A rabbit checks the Move list,
Then queries the cached symbol.
Empty pages keep their denom,
Missing records find their match.
Holders return in order.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: enhanced rich-list token holder retrieval for MoveVM.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-xslp

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@api/handler/richlist/richlist.go`:
- Around line 68-83: The fallback in the rich-list handler must not be selected
solely because the paginated query returned no records. Before changing denom in
the MoveVM branch around resolveMoveSymbolDenom, check whether the original
move/<addr> denomination exists using an unpaginated existence/count query; only
resolve and retry the symbol denomination when no original rows exist. Then
execute the normal paginated query for the selected denomination, and add a
regression test covering mixed representations with a non-zero offset.
- Around line 70-71: Update the rich-list handling around resolveMoveSymbolDenom
and GetMoveDenomByMetadataAddr so metadata resolution does not occur while tx is
open. Resolve the Move symbol denomination before Begin, or commit/close tx
before the REST lookup and reopen it afterward, while preserving the existing
cache-hit and record-processing behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 07f77b8a-fbd2-4f59-b3bd-121b6c4461e6

📥 Commits

Reviewing files that changed from the base of the PR and between 3a2b99d and 5f8915b.

📒 Files selected for processing (1)
  • api/handler/richlist/richlist.go

Comment thread api/handler/richlist/richlist.go Outdated
Comment thread api/handler/richlist/richlist.go Outdated
- Introduced comprehensive tests for the `GetTokenHolders` method in the `richlist` handler.
- Added scenarios to verify behavior when handling MoveVM denoms, including cases for empty offset pages and fallback to symbol denoms.
- Utilized sqlmock for database interactions to ensure isolated testing of the handler's logic.

These tests enhance the reliability of the richlist functionality and ensure correct handling of token holder data.
@Benzbeeb
Benzbeeb merged commit ee595ee into main Aug 5, 2026
6 checks passed
@Benzbeeb
Benzbeeb deleted the fix-xslp branch August 5, 2026 09:44
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.

2 participants