feat: Support filtering txns by mpt_issuance_id - #3153
Open
PeterChen13579 wants to merge 4 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Adds support to filter account_tx results by a specific MPT issuance identifier, reusing ETL-side MPT parsing utilities to determine whether a transaction references an issuance.
Changes:
- Add optional
mpt_issuance_idrequest parameter toaccount_tx(validated as uint192 hex). - Implement issuance-reference detection via new
etl::referencesMptIssuancehelper and apply filtering in the handler. - Extend unit tests with parameter validation cases and several filter scenarios (including binary output).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/rpc/handlers/AccountTxTests.cpp | Adds parameter-validation cases and new scenarios validating mpt_issuance_id filtering behavior. |
| src/rpc/handlers/MPTHolders.cpp | Adds an include needed for compilation after related MPT changes. |
| src/rpc/handlers/AccountTx.hpp | Introduces mpt_issuance_id into the RPC spec and Input struct. |
| src/rpc/handlers/AccountTx.cpp | Parses the new filter field and filters transactions using etl::referencesMptIssuance. |
| src/rpc/CMakeLists.txt | Links clio_rpc against clio_etl to use the new helper. |
| src/etl/MPTHelpers.hpp | Declares referencesMptIssuance helper for checking issuance references. |
| src/etl/MPTHelpers.cpp | Implements issuance-reference detection by scanning metadata nodes and tx fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an optional
mpt_issuance_idfield to Account_tx so that users can filter Account transactions if the transaction is involved in a specificmpt_issuance_id