Remove deprecated RPCArg::Optional::OMITTED_NAMED_ARG in favour of OMITTED.
scripted-diff: use RPCArg::Optional::OMITTED over OMITTED_NAMED_ARG #26919
pull fanquake wants to merge 2 commits into bitcoin:master from fanquake:remove_omitted_named_arg changing 15 files +59 −64-
fanquake commented at 10:37 AM on January 19, 2023: member
-
DrahtBot commented at 10:37 AM on January 19, 2023: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process.
Type Reviewers ACK kouloumos, aureleoules If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #26485 (RPC: Accept options as named-only parameters by ryanofsky)
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.
- DrahtBot added the label Refactoring on Jan 19, 2023
-
maflcko commented at 3:37 PM on January 19, 2023: member
The scripted diff can be:
sed -i -e "/Deprecated alias for OMITTED, can be removed/d" src/rpc/util.{h,cpp} sed -i -e "s/OMITTED_NAMED_ARG/OMITTED/g" $(git grep -l "OMITTED_NAMED_ARG" src/) - fanquake force-pushed on Jan 19, 2023
-
fanquake commented at 3:40 PM on January 19, 2023: member
The scripted diff can be:
Sure. Updated.
- fanquake force-pushed on Jan 19, 2023
- fanquake requested review from stickies-v on Jan 20, 2023
- fanquake requested review from kouloumos on Jan 20, 2023
-
in src/rpc/util.h:162 in 92e7a51579 outdated
164 | @@ -165,7 +165,6 @@ struct RPCArg { 165 | * When possible, the default value should be specified.
kouloumos commented at 7:21 PM on January 20, 2023:Reading this comment and even going through the changes of how this came to be, I still was a bit confused about the options here as part of the overall logic. The removal of
OMITTED_NAMED_ARGdefinitely makes it easier but may I suggest a different wording for the comments:/** * Optional argument for which the default value is omitted from * help text for one of two reasons: * - It's a named argument and has a default value of `null`. * - Its default value is implicitly clear. That is, elements in an * array may not exist by default. * When possible, the default value should be specified.
fanquake commented at 3:07 PM on January 22, 2023:Taken your suggestions.
kouloumos commented at 8:23 PM on January 20, 2023: contributorACK 92e7a51579712c8108d565a639b206e7555d58e9 I verified that there are no other occurrences of
OMITTED_NAMED_ARG. I've also verified that there is no diff at the rendered RPC doc after this change by using the RPCdump-patch from #14726#pullrequestreview-175423309.<details><summary>Updated RPCdump-patch</summary>
diff --git a/src/init.cpp b/src/init.cpp index 685583bcb..5120d23b5 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1190,6 +1190,30 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) for (const auto& client : node.chain_clients) { client->registerRpcs(); } + JSONRPCRequest jreq; + jreq.mode = JSONRPCRequest::GET_HELP; + UniValue unused_result; + for (const auto& command : tableRPC.mapCommands) { + const CRPCCommand *pcmd = command.second.front(); + try { + pcmd->actor(jreq, unused_result, true); + } catch (const std::exception& e) { + printf("===\n%s\n", e.what()); + continue; + } catch (const UniValue& e) { + printf("===\n%s\n", e.write().c_str()); + continue; + } catch (...) { + printf("===\n%s\n", pcmd->name.c_str()); + fflush(stdout); + assert(0); + } + printf("===\n%s\n", pcmd->name.c_str()); + fflush(stdout); + assert(0); + } + fflush(stdout); + abort(); #if ENABLE_ZMQ RegisterZMQRPCCommands(tableRPC); #endif diff --git a/src/rpc/server.h b/src/rpc/server.h index 01e855605..130819a56 100644 --- a/src/rpc/server.h +++ b/src/rpc/server.h @@ -124,7 +124,7 @@ public: */ class CRPCTable { -private: +public: std::map<std::string, std::vector<const CRPCCommand*>> mapCommands; public: CRPCTable();</details>
ea8c7daf7ascripted-diff: use RPCArg::Optional::OMITTED over OMITTED_NAMED_ARG
-BEGIN VERIFY SCRIPT- sed -i -e "/Deprecated alias for OMITTED, can be removed/d" src/rpc/util.h src/rpc/util.cpp sed -i -e "s/OMITTED_NAMED_ARG/OMITTED/g" $(git grep -l "OMITTED_NAMED_ARG" src/) -END VERIFY SCRIPT-
doc: improve doc for RPCArg::Optional::OMITTED 83f70c8e86fanquake force-pushed on Jan 22, 2023kouloumos commented at 8:43 AM on January 23, 2023: contributorre-ACK 83f70c8e860556426305b1d70fa0a3276784e360
aureleoules approvedaureleoules commented at 9:11 AM on January 23, 2023: memberACK 83f70c8e860556426305b1d70fa0a3276784e360
maflcko merged this on Jan 23, 2023maflcko closed this on Jan 23, 2023fanquake deleted the branch on Jan 23, 2023sidhujag referenced this in commit 049aecafe4 on Jan 23, 2023bitcoin locked this on Jan 23, 2024
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: 2026-05-01 09:13 UTC
More mirrored repositories can be found on mirror.b10c.me