rpc: Remove duplicate name and argNames from CRPCCommand #20012

pull MarcoFalke wants to merge 3 commits into bitcoin:master from MarcoFalke:2009-rpcCheckMapping changing 16 files +284 −349
  1. MarcoFalke commented at 7:28 am on September 25, 2020: member
    Currently, the RPC argument names are specified twice to simplify consistency linting. To avoid having to specify the argnames twice when adding new arguments, remove the linter and add an equivalent test based on RPCHelpMan.
  2. MarcoFalke force-pushed on Sep 25, 2020
  3. DrahtBot added the label GUI on Sep 25, 2020
  4. DrahtBot added the label Mining on Sep 25, 2020
  5. DrahtBot added the label RPC/REST/ZMQ on Sep 25, 2020
  6. DrahtBot added the label Wallet on Sep 25, 2020
  7. promag commented at 9:24 am on September 25, 2020: member
    Concept ACK
  8. DrahtBot commented at 1:05 pm on September 25, 2020: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #20664 (Add scanblocks RPC call by jonasschnelli)
    • #20459 (rpc: Fail to return undocumented return values by MarcoFalke)
    • #20429 (refactor: replace (sizeof(a)/sizeof(a[0])) with C++17 std::size by theStack)
    • #20391 (wallet: introduce setfeerate (an improved settxfee, in sat/vB) by jonatack)
    • #20295 (rpc: getblockfrompeer by Sjors)
    • #19825 (rpc: simpler setban and new ban manipulation commands by dhruv)
    • #19602 (wallet: Migrate legacy wallets to descriptor wallets by achow101)
    • #19521 (Coinstats Index (without UTXO set hash) by fjahr)
    • #19443 (rpc: Add options argument to listtransactions, with paginatebypointer options by kristapsk)
    • #19160 (multiprocess: Add basic spawn and IPC support by ryanofsky)
    • #17211 (Allow fundrawtransaction and walletcreatefundedpsbt to take external inputs by achow101)
    • #16546 (External signer support - Wallet Box edition by Sjors)
    • #16439 (cli/gui: support “@height” in place of blockhash for getblock on client side by ajtowns)
    • #15129 (rpc: Added ability to remove watch only addresses by benthecarman)
    • #14707 ([RPC] Include coinbase transactions in receivedby RPCs by andrewtoth)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  9. MarcoFalke force-pushed on Nov 19, 2020
  10. MarcoFalke removed the label GUI on Nov 19, 2020
  11. MarcoFalke removed the label Mining on Nov 19, 2020
  12. MarcoFalke removed the label Wallet on Nov 19, 2020
  13. MarcoFalke added the label Refactoring on Nov 19, 2020
  14. MarcoFalke marked this as ready for review on Nov 19, 2020
  15. MarcoFalke force-pushed on Nov 20, 2020
  16. MarcoFalke force-pushed on Nov 20, 2020
  17. MarcoFalke force-pushed on Nov 20, 2020
  18. MarcoFalke force-pushed on Nov 20, 2020
  19. stackman27 commented at 1:44 am on December 29, 2020: contributor
    ACK Code review and Built successful. This definitely looks cleaner than the old version and eliminates lots of repetitions
  20. DrahtBot added the label Needs rebase on Jan 11, 2021
  21. MarcoFalke force-pushed on Jan 12, 2021
  22. DrahtBot removed the label Needs rebase on Jan 12, 2021
  23. MarcoFalke commented at 9:34 am on January 12, 2021: member
    Rebased
  24. ryanofsky approved
  25. ryanofsky commented at 4:10 pm on January 21, 2021: member
    Code review ACK fafd58e4dc4089d5aa450feefa9af27f9b34c297. Nice cleanup which gets rid of some parameter repetition dealing with RPCs. It’s also nice to drop some c++ parsing code. The previous asserts and new test updates seem to make this pretty foolproof and ensure there’s no change in behavior.
  26. jonasschnelli commented at 7:52 am on January 25, 2021: contributor
    Much tidier! Concept ACK
  27. DrahtBot added the label Needs rebase on Jan 28, 2021
  28. rpc: [refactor] Use concise C++11 code in CRPCConvertTable constructor faf835680b
  29. rpc: Use RPCHelpMan for check-rpc-mappings linter fa92912b4b
  30. MarcoFalke force-pushed on Jan 28, 2021
  31. rpc: Remove duplicate name and argNames from CRPCCommand fa04f9b4dd
  32. MarcoFalke force-pushed on Jan 28, 2021
  33. MarcoFalke commented at 7:43 am on January 28, 2021: member
    Rebased, should be trivial to re-ACK
  34. MarcoFalke commented at 7:43 am on January 28, 2021: member
    @laanwj As the author of test/lint/check-rpc-mappings.py, could you take a look here on the python changes?
  35. DrahtBot removed the label Needs rebase on Jan 28, 2021
  36. laanwj commented at 6:24 pm on January 28, 2021: member
    ACK fa04f9b4ddffc5ef23c2ee7f3cc72a7c2ae49204 Not sad to see that script go.
  37. laanwj merged this on Jan 28, 2021
  38. laanwj closed this on Jan 28, 2021

  39. MarcoFalke deleted the branch on Jan 28, 2021
  40. sidhujag referenced this in commit 30a8d4142f on Jan 29, 2021
  41. sidhujag referenced this in commit 48442dd499 on Jan 29, 2021
  42. in src/rpc/server.cpp:492 in fa92912b4b outdated
    483@@ -479,6 +484,18 @@ std::vector<std::string> CRPCTable::listCommands() const
    484     return commandList;
    485 }
    486 
    487+UniValue CRPCTable::dumpArgMap() const
    488+{
    489+    UniValue ret{UniValue::VARR};
    490+    for (const auto& cmd : mapCommands) {
    491+        for (const auto& c : cmd.second) {
    492+            const auto help = RpcMethodFnType(c->unique_id)();
    


    ryanofsky commented at 11:58 pm on January 29, 2021:

    In commit “rpc: Use RPCHelpMan for check-rpc-mappings linter” (fa92912b4bb4629addcbfdfb7cc000be701614af)

    I missed this in initial review, but this cast from unique_id to function pointer isn’t really safe. Or at least it results in segfaults with #10102 (https://cirrus-ci.com/task/5469433013469184?command=ci#L2275). The unique_id field was really only supposed to be used to detect RPC aliases, not be converted to a function pointer and called. #21035 updates this to take a different approach making arg retrieval work more like help retrieval.

  43. domob1812 referenced this in commit dd4f6f1a8b on Feb 1, 2021
  44. domob1812 referenced this in commit c4af2fd596 on Feb 1, 2021
  45. Fabcien referenced this in commit 427e5fc8ea on Jan 5, 2022
  46. Fabcien referenced this in commit 25e918ce93 on Jan 5, 2022
  47. Fabcien referenced this in commit 27d3f1aaa0 on Jan 5, 2022
  48. DrahtBot locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 06:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me