Skip to content

feat: Add accounts filter to mpt_holders - #3180

Open
PeterChen13579 wants to merge 7 commits into
developfrom
brjiang-confidential-mpt-filter
Open

feat: Add accounts filter to mpt_holders#3180
PeterChen13579 wants to merge 7 commits into
developfrom
brjiang-confidential-mpt-filter

Conversation

@PeterChen13579

Copy link
Copy Markdown
Contributor

Continuing work from #3154 as we do not have permission to push to their personal fork

@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.12195% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/rpc/handlers/MPTHolders.cpp 96.77% 1 Missing and 1 partial ⚠️
src/rpc/handlers/MPTHolders.hpp 90.00% 0 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 extends the mpt_holders RPC handler to support an optional accounts filter that bypasses the holder-index scan and instead fetches MPToken objects directly by key for the requested accounts, while keeping the response shape consistent.

Changes:

  • Add accounts request parameter validation (non-empty array of base58 accounts, max 100).
  • Implement an accounts fast-path that fetches MPToken ledger objects via keylet::mptoken(...) keys and omits non-holders.
  • Add comprehensive unit tests covering valid/invalid accounts usage, marker rejection, and confidential-transfer fields.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/unit/rpc/handlers/MPTHoldersTests.cpp Adds unit tests for the new accounts filter mode and validation errors; renames test JSON constants.
src/rpc/handlers/MPTHolders.hpp Adds accounts to the handler input and RPC spec with custom validation; introduces kMaxAccounts.
src/rpc/handlers/MPTHolders.cpp Adds accounts fast-path using fetchLedgerObjects and factors MPToken JSON serialization into a helper.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

godexsoft
godexsoft previously approved these changes Aug 25, 2026

@godexsoft godexsoft left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Small nits that can be ignored 👍

Comment thread src/rpc/handlers/MPTHolders.cpp Outdated
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.

4 participants