{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/151423856","pull_request_review_id":77128054,"id":151423856,"diff_hunk":"@@ -471,6 +487,69 @@ static inline JSONRPCRequest transformNamedArguments(const JSONRPCRequest& in, c\n     return out;\n }\n \n+/**\n+ * Process positional arguments into an Object of named arguments, based on the\n+ * passed-in specification for the RPC call's arguments.\n+ */\n+static inline JSONRPCRequest transformPositionalArguments(const JSONRPCRequest& in, const std::vector<std::string>& argNames)\n+{\n+    JSONRPCRequest out = in;\n+    if (in.params.size() > argNames.size()) {\n+        // Too many params, so just trigger help\n+        out.fHelp = true;\n+        return out;\n+    }\n+    out.params = UniValue(UniValue::VOBJ);\n+    out.params.pushKV(ARGS_WERE_POSITIONAL, true);","path":"src/rpc/server.cpp","position":92,"original_position":92,"commit_id":"2ca71c09a977a14d240ea558accbe3d1dc38ec3a","original_commit_id":"2ca71c09a977a14d240ea558accbe3d1dc38ec3a","user":{"login":"luke-jr","id":1095675,"avatar_url":"https://avatars2.githubusercontent.com/u/1095675?v=4","gravatar_id":"","url":"https://api.github.com/users/luke-jr","html_url":"https://github.com/luke-jr","followers_url":"https://api.github.com/users/luke-jr/followers","following_url":"https://api.github.com/users/luke-jr/following{/other_user}","gists_url":"https://api.github.com/users/luke-jr/gists{/gist_id}","starred_url":"https://api.github.com/users/luke-jr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luke-jr/subscriptions","organizations_url":"https://api.github.com/users/luke-jr/orgs","repos_url":"https://api.github.com/users/luke-jr/repos","events_url":"https://api.github.com/users/luke-jr/events{/privacy}","received_events_url":"https://api.github.com/users/luke-jr/received_events","type":"User","site_admin":false},"body":"It should probably fail if a named-args caller specifies `conf_target` with the explicit fee mode, or if `feerate` is specified with the automatic fee modes, so it would need to check if the duplication is merely because of positional arguments being used or not.","created_at":"2017-11-16T14:16:37Z","updated_at":"2017-11-16T14:16:38Z","html_url":"https://github.com/bitcoin/bitcoin/pull/11660#discussion_r151423856","pull_request_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/11660","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/151423856"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/11660#discussion_r151423856"},"pull_request":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/11660"}},"in_reply_to_id":150875317},"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/11660","id":152053571,"html_url":"https://github.com/bitcoin/bitcoin/pull/11660","diff_url":"https://github.com/bitcoin/bitcoin/pull/11660.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/11660.patch","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/11660","number":11660,"state":"open","locked":false,"title":"RPC: Internal named params","user":{"login":"luke-jr","id":1095675,"avatar_url":"https://avatars2.githubusercontent.com/u/1095675?v=4","gravatar_id":"","url":"https://api.github.com/users/luke-jr","html_url":"https://github.com/luke-jr","followers_url":"https://api.github.com/users/luke-jr/followers","following_url":"https://api.github.com/users/luke-jr/following{/other_user}","gists_url":"https://api.github.com/users/luke-jr/gists{/gist_id}","starred_url":"https://api.github.com/users/luke-jr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luke-jr/subscriptions","organizations_url":"https://api.github.com/users/luke-jr/orgs","repos_url":"https://api.github.com/users/luke-jr/repos","events_url":"https://api.github.com/users/luke-jr/events{/privacy}","received_events_url":"https://api.github.com/users/luke-jr/received_events","type":"User","site_admin":false},"body":"This allows RPC code to use named parameters internally, greatly increasing readability, as well as helping avoid behaviour tied to param count rather than the presence of specific parameters.\r\n\r\nObject type checking is expanded to support multiple allowed types, making param and type-checking clean.\r\n\r\nTemporarily, a boolean is added to the end of CRPCCommand to indicate whether the function expects named params. Once all RPC functions have been converted, we can drop it (as well as old internal-positional-param code).\r\n\r\nAlternative to #11441 ","created_at":"2017-11-11T11:25:31Z","updated_at":"2017-11-16T14:16:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"47bb879631f960b8e95bba7c94e6dd0c1bad6d65","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/11660/commits","review_comments_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/11660/comments","review_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/11660/comments","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/2ca71c09a977a14d240ea558accbe3d1dc38ec3a","head":{"label":"luke-jr:internal_named_params","ref":"internal_named_params","sha":"2ca71c09a977a14d240ea558accbe3d1dc38ec3a","user":{"login":"luke-jr","id":1095675,"avatar_url":"https://avatars2.githubusercontent.com/u/1095675?v=4","gravatar_id":"","url":"https://api.github.com/users/luke-jr","html_url":"https://github.com/luke-jr","followers_url":"https://api.github.com/users/luke-jr/followers","following_url":"https://api.github.com/users/luke-jr/following{/other_user}","gists_url":"https://api.github.com/users/luke-jr/gists{/gist_id}","starred_url":"https://api.github.com/users/luke-jr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luke-jr/subscriptions","organizations_url":"https://api.github.com/users/luke-jr/orgs","repos_url":"https://api.github.com/users/luke-jr/repos","events_url":"https://api.github.com/users/luke-jr/events{/privacy}","received_events_url":"https://api.github.com/users/luke-jr/received_events","type":"User","site_admin":false},"repo":{"id":2514537,"name":"bitcoin","full_name":"luke-jr/bitcoin","owner":{"login":"luke-jr","id":1095675,"avatar_url":"https://avatars2.githubusercontent.com/u/1095675?v=4","gravatar_id":"","url":"https://api.github.com/users/luke-jr","html_url":"https://github.com/luke-jr","followers_url":"https://api.github.com/users/luke-jr/followers","following_url":"https://api.github.com/users/luke-jr/following{/other_user}","gists_url":"https://api.github.com/users/luke-jr/gists{/gist_id}","starred_url":"https://api.github.com/users/luke-jr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luke-jr/subscriptions","organizations_url":"https://api.github.com/users/luke-jr/orgs","repos_url":"https://api.github.com/users/luke-jr/repos","events_url":"https://api.github.com/users/luke-jr/events{/privacy}","received_events_url":"https://api.github.com/users/luke-jr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/luke-jr/bitcoin","description":"Bitcoin integration/staging tree","fork":true,"url":"https://api.github.com/repos/luke-jr/bitcoin","forks_url":"https://api.github.com/repos/luke-jr/bitcoin/forks","keys_url":"https://api.github.com/repos/luke-jr/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/luke-jr/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/luke-jr/bitcoin/teams","hooks_url":"https://api.github.com/repos/luke-jr/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/luke-jr/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/luke-jr/bitcoin/events","assignees_url":"https://api.github.com/repos/luke-jr/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/luke-jr/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/luke-jr/bitcoin/tags","blobs_url":"https://api.github.com/repos/luke-jr/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/luke-jr/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/luke-jr/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/luke-jr/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/luke-jr/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/luke-jr/bitcoin/languages","stargazers_url":"https://api.github.com/repos/luke-jr/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/luke-jr/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/luke-jr/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/luke-jr/bitcoin/subscription","commits_url":"https://api.github.com/repos/luke-jr/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/luke-jr/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/luke-jr/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/luke-jr/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/luke-jr/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/luke-jr/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/luke-jr/bitcoin/merges","archive_url":"https://api.github.com/repos/luke-jr/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/luke-jr/bitcoin/downloads","issues_url":"https://api.github.com/repos/luke-jr/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/luke-jr/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/luke-jr/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/luke-jr/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/luke-jr/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/luke-jr/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/luke-jr/bitcoin/deployments","created_at":"2011-10-04T20:22:23Z","updated_at":"2017-08-17T17:28:41Z","pushed_at":"2017-11-13T15:46:38Z","git_url":"git://github.com/luke-jr/bitcoin.git","ssh_url":"git@github.com:luke-jr/bitcoin.git","clone_url":"https://github.com/luke-jr/bitcoin.git","svn_url":"https://github.com/luke-jr/bitcoin","homepage":"","size":105021,"stargazers_count":15,"watchers_count":15,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":6,"open_issues":0,"watchers":15,"default_branch":"0.11.x-ljrP"}},"base":{"label":"bitcoin:master","ref":"master","sha":"033c78671b91b12d589ebff6c5ede8d94d7500f8","user":{"login":"bitcoin","id":528860,"avatar_url":"https://avatars2.githubusercontent.com/u/528860?v=4","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"repo":{"id":1181927,"name":"bitcoin","full_name":"bitcoin/bitcoin","owner":{"login":"bitcoin","id":528860,"avatar_url":"https://avatars2.githubusercontent.com/u/528860?v=4","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitcoin/bitcoin","description":"Bitcoin Core integration/staging tree","fork":false,"url":"https://api.github.com/repos/bitcoin/bitcoin","forks_url":"https://api.github.com/repos/bitcoin/bitcoin/forks","keys_url":"https://api.github.com/repos/bitcoin/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcoin/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcoin/bitcoin/teams","hooks_url":"https://api.github.com/repos/bitcoin/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/bitcoin/bitcoin/events","assignees_url":"https://api.github.com/repos/bitcoin/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/bitcoin/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/bitcoin/bitcoin/tags","blobs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcoin/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcoin/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcoin/bitcoin/languages","stargazers_url":"https://api.github.com/repos/bitcoin/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/bitcoin/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/bitcoin/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/bitcoin/bitcoin/subscription","commits_url":"https://api.github.com/repos/bitcoin/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcoin/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcoin/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/bitcoin/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcoin/bitcoin/merges","archive_url":"https://api.github.com/repos/bitcoin/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcoin/bitcoin/downloads","issues_url":"https://api.github.com/repos/bitcoin/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcoin/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcoin/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/bitcoin/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/bitcoin/bitcoin/deployments","created_at":"2010-12-19T15:16:43Z","updated_at":"2017-11-16T14:05:32Z","pushed_at":"2017-11-16T13:18:36Z","git_url":"git://github.com/bitcoin/bitcoin.git","ssh_url":"git@github.com:bitcoin/bitcoin.git","clone_url":"https://github.com/bitcoin/bitcoin.git","svn_url":"https://github.com/bitcoin/bitcoin","homepage":"https://bitcoin.org/en/download","size":89669,"stargazers_count":19223,"watchers_count":19223,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":11406,"mirror_url":null,"archived":false,"open_issues_count":748,"forks":11406,"open_issues":748,"watchers":19223,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/11660"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/11660"},"issue":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/11660"},"comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/11660/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/11660/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/11660/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin/bitcoin/statuses/2ca71c09a977a14d240ea558accbe3d1dc38ec3a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"luke-jr"}}