rpc: Assert named arguments are unique in RPCHelpMan #14885

pull promag wants to merge 1 commits into bitcoin:master from promag:2018-12-assert-unique-args changing 2 files +11 −4
  1. promag commented at 3:43 pm on December 6, 2018: member
    Prevents an obvious mistake.
  2. DrahtBot commented at 3:54 pm on December 6, 2018: 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:

    • #14875 (RPCHelpMan: Support required arguments after optional ones by MarcoFalke)

    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.

  3. in src/rpc/util.cpp:254 in 99e68dc742 outdated
    248@@ -249,7 +249,9 @@ std::string RPCHelpMan::ToString() const
    249     // Oneline summary
    250     ret += m_name;
    251     bool is_optional{false};
    252+    std::set<std::string> args;
    253     for (const auto& arg : m_args) {
    254+        assert(args.insert(arg.m_name).second);
    


    MarcoFalke commented at 4:27 pm on December 6, 2018:
    I guess with “arguments” you mean “named arguments”? Could clarify that in the commit title and put a comment here or name the set appropriately.

    promag commented at 5:10 pm on December 6, 2018:
    Sure, will do.
  4. promag renamed this:
    rpc: Assert arguments are unique in RPCHelpMan
    rpc: Assert named arguments are unique in RPCHelpMan
    on Dec 6, 2018
  5. promag force-pushed on Dec 6, 2018
  6. fanquake added the label RPC/REST/ZMQ on Dec 6, 2018
  7. Empact commented at 9:39 pm on December 6, 2018: member
    nit: might be a bit better to have this validation in the constructor, from a separation of concerns perspective.
  8. rpc: Assert named arguments are unique in RPCHelpMan e09a5875ca
  9. promag force-pushed on Dec 7, 2018
  10. promag commented at 6:21 pm on December 9, 2018: member
    @Empact done.
  11. Empact commented at 6:51 pm on December 9, 2018: member
    utACK e09a5875cac3e691bb9cc8301cb882d63b029cb0
  12. MarcoFalke commented at 7:43 pm on December 9, 2018: member
    utACK e09a587
  13. MarcoFalke referenced this in commit 234b99b921 on Dec 10, 2018
  14. MarcoFalke merged this on Dec 10, 2018
  15. MarcoFalke closed this on Dec 10, 2018

  16. deadalnix referenced this in commit 43d44b2e89 on Apr 20, 2020
  17. DrahtBot locked this on Sep 8, 2021

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-18 12:12 UTC

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