feat: add mptoken_issuance_history RPC - #3141
Conversation
12615d0 to
f3d1c1f
Compare
f3d1c1f to
05f2826
Compare
|
The handler PR should not contain the migration code |
The mptoken_issuance_history gate went through MigrationInspectorInterface, which required threading a MigrationInspector through ClioApplication and ProductionHandlerProvider purely for one status lookup. MigratorsRegister::getMigratorStatus ultimately just calls BackendInterface::fetchMigratorStatus wrapped in data::synchronous, which spins up a nested io_context and blocks the calling thread. Querying the backend directly with the request's yield context keeps the gate async and drops the extra dependency: ClioApplication, ProductionHandlerProvider and their tests return to their previous shape, and MockMigrationInspector is no longer needed. A missing status row and an unregistered migrator name are now indistinguishable (both nullopt), so the NotKnown warn log is gone. Both already failed closed with the same notReady error, so behaviour is unchanged; tests cover the absent-row and unparseable-status paths instead. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new Clio-only RPC method, mptoken_issuance_history, to retrieve transaction history for a specific MPToken issuance, optionally filtered by account and/or tx_type, and gated behind completion of the MPT transaction-history backfill to avoid serving partial history.
Changes:
- Introduces
MPTokenIssuanceHistoryHandlerwith ledger-range handling, paging/markers, binary/forward options, and optional post-fetchtx_typefiltering. - Registers the new RPC in the handler provider and RPC center, and links
clio_rpcagainstclio_migrationfor migrator-status gating. - Adds comprehensive unit tests covering parameter validation, routing, gating, paging/markers, binary modes, and
tx_typefiltering behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/rpc/handlers/MPTokenIssuanceHistoryTests.cpp | Adds extensive unit coverage for the new handler’s validation, gating, paging, and response shapes across API versions. |
| tests/unit/CMakeLists.txt | Includes the new unit test file in the unit test target. |
| src/rpc/RPCCenter.cpp | Adds mptoken_issuance_history to the handled RPC list. |
| src/rpc/handlers/MPTokenIssuanceHistory.hpp | Defines the new handler, input/output models, and RPC spec (including tx_type validation/modifiers). |
| src/rpc/handlers/MPTokenIssuanceHistory.cpp | Implements migrator gating, ledger range resolution, backend routing, marker/limit behavior, and response formatting. |
| src/rpc/common/impl/HandlerProvider.cpp | Registers the handler as Clio-only under mptoken_issuance_history. |
| src/rpc/CMakeLists.txt | Builds the new handler source and links clio_rpc with clio_migration for migrator-status usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@maria-robobug Please note there is an extra RPC handler we are adding to clio |
mathbunnyru
left a comment
There was a problem hiding this comment.
Please, merge latest changes - CI doesn't seem to have run, and you also didn't allow maintainers to update your branch, so I can't do it myself
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
@BryanJ1ang Could you add more tests regarding the coverage report? |
feat: add mptoken_issuance_history RPC
Summary
Adds mptoken_issuance_history, a Clio-only method that returns the transaction history for a given MPT issuance — the MPT-scoped sibling of nft_history. You can optionally filter by account and/or tx_type.
The index tables, backend fetch methods, and live ETL indexing landed earlier; this wires up the handler on top of them.
The handler