Skip to content

feat: update richlist handler to support wildcard denoms - #133

Closed
Benzbeeb wants to merge 1 commit into
mainfrom
hot-fix-denom
Closed

feat: update richlist handler to support wildcard denoms#133
Benzbeeb wants to merge 1 commit into
mainfrom
hot-fix-denom

Conversation

@Benzbeeb

@Benzbeeb Benzbeeb commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
  • Modified the route in the RichListHandler to accept wildcard paths, allowing for denoms with slashes (e.g., move/..., ibc/...) without requiring URL encoding.
  • Added a new function, parseDenomFromPath, to extract and normalize the denom from the path.
  • Introduced unit tests for the denom parsing functionality to ensure correct behavior across various cases.

Summary by CodeRabbit

  • Bug Fixes
    • Rich-list requests now support denominations containing slashes, including nested and IBC-style denominations.
    • Added support for both raw and percent-encoded denomination paths.
    • Denominations continue to be normalized to lowercase, with clear bad-request responses for missing or invalid values.
  • Documentation
    • Updated endpoint documentation to describe wildcard paths and supported denomination formats.

- Modified the route in the RichListHandler to accept wildcard paths, allowing for denoms with slashes (e.g., move/..., ibc/...) without requiring URL encoding.
- Added a new function, parseDenomFromPath, to extract and normalize the denom from the path.
- Introduced unit tests for the denom parsing functionality to ensure correct behavior across various cases.
@Benzbeeb
Benzbeeb requested a review from songwongtp August 5, 2026 07:12
@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: e868f513-5729-4b28-9bb8-274e30f383db

📥 Commits

Reviewing files that changed from the base of the PR and between 3a2b99d and 283b49e.

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

Walkthrough

The rich-list endpoint now uses wildcard routing for denominations with slashes. Centralized parsing decodes path escapes, rejects missing or invalid values, and lowercases denominations. HTTP tests cover supported path formats and error handling.

Changes

Rich-list routing

Layer / File(s) Summary
Wildcard path parsing
api/handler/richlist/handler.go, api/handler/richlist/richlist.go
The route captures the full denomination path. parseDenomFromPath trims, decodes, validates, and lowercases the denomination.
Parser HTTP coverage
api/handler/richlist/richlist_test.go
Tests cover plain, encoded, nested, raw-slash, uppercase, IBC, and empty denomination paths.

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

Suggested reviewers: songwongtp

Poem

A rabbit hops through paths of light,
With slashes tucked in just right.
It decodes each token,
Keeps lowercase spoken,
And tests every route through the night.

🚥 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 and concisely describes the main change: adding wildcard denomination support to the rich-list handler.
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 hot-fix-denom

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

@Benzbeeb Benzbeeb closed this Aug 5, 2026
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