[RPC][Refactor] Register calls where they are defined#1926
Merged
random-zebra merged 6 commits intoPIVX-Project:masterfrom Oct 30, 2020
Merged
[RPC][Refactor] Register calls where they are defined#1926random-zebra merged 6 commits intoPIVX-Project:masterfrom
random-zebra merged 6 commits intoPIVX-Project:masterfrom
Conversation
random-zebra
previously approved these changes
Oct 20, 2020
random-zebra
left a comment
There was a problem hiding this comment.
Rebase needed (new getcachedblockhashes introduced in #1904 can be added to the hidden category), otherwise looking good. Left just a couple notes.
fb81bb3 to
03c518a
Compare
Split out methods to every module, apart from 'help' and 'stop' which are implemented in rpcserver.cpp itself. - This makes it easier to add or remove RPC commands - no longer everything that includes rpcserver.h has to be rebuilt when there's a change there. - Cleans up `rpc/server.h` by getting rid of the huge cluttered list of function definitions.
All of these commands are set to be deprecated/removed post-5.0, might as well extract them out of rpcwallet to a dedicated file to reduce bloat in rpcwallet.cpp
This is a better place to have this command, especially since it is already categorized as a "wallet" command.
These commands are primarily only used during regtest functional testing, or are otherwise not relevant to our current mainnet/testnet chains.
Split into two primary categories ("masternode" and "budget") to better
reflect the purpose. `mnsync` and `spork` are now in the "control"
category.
Keeping them in `rpc/blockchain.cpp` because they aren't strictly wallet commands, and `findserials` relies on the `validaterange` function here, no sense in duplicating that code elsewhere. Both are set to be deleted after 5.0 is locked in.
03c518a to
903b618
Compare
Collaborator
Author
|
rebased |
furszy
approved these changes
Oct 28, 2020
| void RegisterBlockchainRPCCommands(CRPCTable &tableRPC) | ||
| { | ||
| for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++) | ||
| tableRPC.appendCommand(commands[vcidx].name, &commands[vcidx]); |
There was a problem hiding this comment.
tiny nit, could be written:
for (const auto& command : commands)
tableRPC.appendCommand(command.name, &command);
(And same for the others RegisterxxxRPCCommands)
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.
Revives/replaces #1720, backporting bitcoin#7766.
Split out methods to every module, apart from 'help' and 'stop' which
are implemented in rpcserver.cpp itself.
everything that includes rpcserver.h has to be rebuilt when there's a
change there.
rpc/server.hby getting rid of the huge cluttered list offunction definitions.
getstakingstatusto the more appropriaterpcwallet.cpp