Conversation
- 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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe rich-list handler now supports MoveVM fallback queries. When a ChangesMoveVM rich-list fallback
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
api/handler/richlist/richlist.go
- 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.
resolveMoveSymbolDenomto handle metadata resolution and retry fetching token holders if no records are found.GetTokenHoldersmethod 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