refactor: Reorganize RPC handler files - #6628
Conversation
|
/ai-review |
|
Nice, clean reorganisation. LGTM. |
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
There was a problem hiding this comment.
Pull request overview
This PR reorganizes the JSON-RPC handler implementation files into a clearer folder structure (by RPC category) and splits several handlers so each RPC has its own dedicated .cpp file, improving discoverability and navigation.
Changes:
- Moved/split RPC handlers into category subfolders (e.g.,
account/,ledger/,orderbook/,server_info/,transaction/,utility/,admin/...). - Extracted shared helper logic into dedicated headers (e.g.,
NFTOffersHelpers.h,LedgerEntryHelpers.h,GetCounts.h) and adjusted include paths accordingly. - Renamed the internal handler function for
account_txfromdoAccountTxJsontodoAccountTxand updated handler registration.
Reviewed changes
Copilot reviewed 21 out of 82 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/xrpld/rpc/handlers/utility/Random.cpp | New standalone handler file for random. |
| src/xrpld/rpc/handlers/utility/Ping.cpp | New standalone handler file for ping. |
| src/xrpld/rpc/handlers/transaction/TxReduceRelay.cpp | New standalone handler file for tx_reduce_relay. |
| src/xrpld/rpc/handlers/transaction/TxHistory.cpp | New standalone handler file for tx_history. |
| src/xrpld/rpc/handlers/transaction/Tx.cpp | New standalone handler file for tx. |
| src/xrpld/rpc/handlers/transaction/TransactionEntry.cpp | New standalone handler file for transaction_entry. |
| src/xrpld/rpc/handlers/transaction/SubmitMultiSigned.cpp | New standalone handler file for submit_multisigned. |
| src/xrpld/rpc/handlers/transaction/Submit.cpp | New standalone handler file for submit. |
| src/xrpld/rpc/handlers/transaction/Simulate.cpp | New standalone handler file for simulate. |
| src/xrpld/rpc/handlers/subscribe/Unsubscribe.cpp | Moved/split unsubscribe into its own file under subscribe/. |
| src/xrpld/rpc/handlers/subscribe/Subscribe.cpp | Moved/split subscribe into its own file under subscribe/. |
| src/xrpld/rpc/handlers/server_info/Version.h | Moved version handler into server_info/ as a class-based handler. |
| src/xrpld/rpc/handlers/server_info/ServerState.cpp | New standalone handler file for server_state. |
| src/xrpld/rpc/handlers/server_info/ServerInfo.cpp | New standalone handler file for server_info. |
| src/xrpld/rpc/handlers/server_info/ServerDefinitions.cpp | New standalone handler file for server_definitions. |
| src/xrpld/rpc/handlers/server_info/Manifest.cpp | New standalone handler file for manifest. |
| src/xrpld/rpc/handlers/server_info/Fee.cpp | New standalone handler file for fee. |
| src/xrpld/rpc/handlers/server_info/Feature.cpp | New standalone handler file for feature. |
| src/xrpld/rpc/handlers/orderbook/RipplePathFind.cpp | Moved ripple_path_find under orderbook/. |
| src/xrpld/rpc/handlers/orderbook/PathFind.cpp | Moved path_find under orderbook/. |
| src/xrpld/rpc/handlers/orderbook/NFTSellOffers.cpp | Split nft_sell_offers into its own .cpp. |
| src/xrpld/rpc/handlers/orderbook/NFTOffersHelpers.h | Extracted shared NFT offer enumeration helpers into a header. |
| src/xrpld/rpc/handlers/orderbook/NFTBuyOffers.cpp | Split nft_buy_offers into its own .cpp. |
| src/xrpld/rpc/handlers/orderbook/GetAggregatePrice.cpp | Moved get_aggregate_price under orderbook/. |
| src/xrpld/rpc/handlers/orderbook/DepositAuthorized.cpp | Moved deposit_authorized under orderbook/. |
| src/xrpld/rpc/handlers/orderbook/BookOffers.cpp | Removed embedded book_changes handler implementation. |
| src/xrpld/rpc/handlers/orderbook/BookChanges.cpp | New standalone handler file for book_changes. |
| src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp | Moved amm_info under orderbook/. |
| src/xrpld/rpc/handlers/ledger/LedgerHeader.cpp | New standalone handler file for ledger_header. |
| src/xrpld/rpc/handlers/ledger/LedgerEntryHelpers.h | Introduced helper header for ledger_entry parsing/validation. |
| src/xrpld/rpc/handlers/ledger/LedgerEntry.cpp | Updated include path for moved LedgerEntryHelpers.h. |
| src/xrpld/rpc/handlers/ledger/LedgerDiff.cpp | New standalone gRPC handler file for ledger diff. |
| src/xrpld/rpc/handlers/ledger/LedgerData.cpp | New standalone handler file for ledger_data (+ gRPC). |
| src/xrpld/rpc/handlers/ledger/LedgerCurrent.cpp | New standalone handler file for ledger_current. |
| src/xrpld/rpc/handlers/ledger/LedgerClosed.cpp | New standalone handler file for ledger_closed. |
| src/xrpld/rpc/handlers/ledger/Ledger.h | Moved/renamed ledger class-based handler header into ledger/. |
| src/xrpld/rpc/handlers/ledger/Ledger.cpp | Updated include to new ledger/Ledger.h location. |
| src/xrpld/rpc/handlers/Handlers.h | Updated handler declarations / includes (incl. ledger/Ledger.h, doAccountTx). |
| src/xrpld/rpc/handlers/ChannelVerify.cpp | Split channel_verify into its own handler file. |
| src/xrpld/rpc/handlers/admin/UnlList.cpp | Moved unl_list under admin/. |
| src/xrpld/rpc/handlers/admin/status/Validators.cpp | Moved validators under admin/status/. |
| src/xrpld/rpc/handlers/admin/status/ValidatorListSites.cpp | Moved validator_list_sites under admin/status/. |
| src/xrpld/rpc/handlers/admin/status/ValidatorInfo.cpp | Moved validator_info under admin/status/. |
| src/xrpld/rpc/handlers/admin/status/Print.cpp | Moved print under admin/status/. |
| src/xrpld/rpc/handlers/admin/status/GetCounts.h | New header for get_counts shared helper. |
| src/xrpld/rpc/handlers/admin/status/GetCounts.cpp | Moved/split get_counts (and helper) into admin/status/. |
| src/xrpld/rpc/handlers/admin/status/FetchInfo.cpp | Moved fetch_info under admin/status/. |
| src/xrpld/rpc/handlers/admin/status/ConsensusInfo.cpp | Moved consensus_info under admin/status/. |
| src/xrpld/rpc/handlers/admin/signing/SignFor.cpp | Moved sign_for under admin/signing/. |
| src/xrpld/rpc/handlers/admin/signing/Sign.cpp | Moved sign under admin/signing/. |
| src/xrpld/rpc/handlers/admin/signing/ChannelAuthorize.cpp | Removed embedded channel_verify implementation from this file. |
| src/xrpld/rpc/handlers/admin/server_control/Stop.cpp | Moved stop under admin/server_control/. |
| src/xrpld/rpc/handlers/admin/server_control/LedgerAccept.cpp | Moved ledger_accept under admin/server_control/. |
| src/xrpld/rpc/handlers/admin/peer/Peers.cpp | Moved peers under admin/peer/. |
| src/xrpld/rpc/handlers/admin/peer/PeerReservationsList.cpp | Split peer_reservations_list into its own file. |
| src/xrpld/rpc/handlers/admin/peer/PeerReservationsDel.cpp | Split peer_reservations_del into its own file. |
| src/xrpld/rpc/handlers/admin/peer/PeerReservationsAdd.cpp | Removed embedded peer_reservations_del/list implementations from this file. |
| src/xrpld/rpc/handlers/admin/peer/Connect.cpp | Moved connect under admin/peer/. |
| src/xrpld/rpc/handlers/admin/log/LogRotate.cpp | Moved logrotate under admin/log/. |
| src/xrpld/rpc/handlers/admin/log/LogLevel.cpp | Moved log_level under admin/log/. |
| src/xrpld/rpc/handlers/admin/keygen/WalletPropose.h | New header for keygen wallet_propose helper. |
| src/xrpld/rpc/handlers/admin/keygen/WalletPropose.cpp | Updated include path for moved WalletPropose.h. |
| src/xrpld/rpc/handlers/admin/keygen/ValidationCreate.cpp | Moved validation_create under admin/keygen/. |
| src/xrpld/rpc/handlers/admin/data/LedgerRequest.cpp | Moved ledger_request under admin/data/. |
| src/xrpld/rpc/handlers/admin/data/LedgerCleaner.cpp | Moved ledger_cleaner under admin/data/. |
| src/xrpld/rpc/handlers/admin/data/CanDelete.cpp | Moved can_delete under admin/data/. |
| src/xrpld/rpc/handlers/admin/BlackList.cpp | Moved blacklist under admin/. |
| src/xrpld/rpc/handlers/account/OwnerInfo.cpp | Moved owner_info under account/. |
| src/xrpld/rpc/handlers/account/NoRippleCheck.cpp | Moved noripple_check under account/. |
| src/xrpld/rpc/handlers/account/GatewayBalances.cpp | Moved gateway_balances under account/. |
| src/xrpld/rpc/handlers/account/AccountTx.cpp | Renamed internal handler function to doAccountTx. |
| src/xrpld/rpc/handlers/account/AccountOffers.cpp | Moved account_offers under account/. |
| src/xrpld/rpc/handlers/account/AccountObjects.cpp | Removed embedded account_nfts handler implementation. |
| src/xrpld/rpc/handlers/account/AccountNFTs.cpp | New standalone handler file for account_nfts. |
| src/xrpld/rpc/handlers/account/AccountLines.cpp | Moved account_lines under account/. |
| src/xrpld/rpc/handlers/account/AccountInfo.cpp | Moved account_info under account/. |
| src/xrpld/rpc/handlers/account/AccountCurrencies.cpp | Moved account_currencies under account/. |
| src/xrpld/rpc/handlers/account/AccountChannels.cpp | Moved account_channels under account/. |
| src/xrpld/rpc/detail/Handler.cpp | Updated includes and handler registration (account_tx -> doAccountTx, moved Version.h). |
| src/xrpld/overlay/detail/OverlayImpl.cpp | Updated include path for GetCounts.h after refactor. |
| src/test/rpc/KeyGeneration_test.cpp | Updated include path for moved WalletPropose.h. |
| .github/scripts/rename/copyright.sh | Updated paths for moved handler files referenced by the script. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
High Level Overview of Change
This PR:
.cppfile, to make them easier to findThere is no functionality or source code change, only moving code around and renaming files/headers.
Context of Change
Making the repo easier to manage/traverse
API Impact
N/A