{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/211386164","pull_request_review_id":147795999,"id":211386164,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTM4NjE2NA==","diff_hunk":"@@ -0,0 +1,31 @@\n+// Copyright (c) 2018 The Bitcoin Core developers\n+// Distributed under the MIT software license, see the accompanying\n+// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n+\n+#include <rpc/rpccategory.h>\n+\n+#include <cassert>\n+\n+namespace rpccategory\n+{\n+\n+std::string Label(const RPCCategory category)\n+{\n+    switch (category) {\n+        case RPCCategory::BLOCKCHAIN: return \"blockchain\";\n+        case RPCCategory::CONTROL: return \"control\";\n+        case RPCCategory::GENERATING: return \"generating\";\n+        case RPCCategory::HIDDEN: return \"hidden\";\n+        case RPCCategory::MINING: return \"mining\";\n+        case RPCCategory::NETWORK: return \"network\";\n+        case RPCCategory::RAWTRANSACTIONS: return \"rawtransactions\";\n+        case RPCCategory::UTIL: return \"util\";\n+        case RPCCategory::WALLET: return \"wallet\";\n+        case RPCCategory::ZMQ: return \"zmq\";\n+        case RPCCategory::TEST: return \"test\";\n+        // if you are missing a case, you'll have a warning here","path":"src/rpc/rpccategory.cpp","position":null,"original_position":26,"commit_id":"7f997989bc63fe14ada94094751c8b4551a4178c","original_commit_id":"b8524567242e44e50c932611687405cd2b920709","user":{"login":"isghe","id":1006078,"node_id":"MDQ6VXNlcjEwMDYwNzg=","avatar_url":"https://avatars1.githubusercontent.com/u/1006078?v=4","gravatar_id":"","url":"https://api.github.com/users/isghe","html_url":"https://github.com/isghe","followers_url":"https://api.github.com/users/isghe/followers","following_url":"https://api.github.com/users/isghe/following{/other_user}","gists_url":"https://api.github.com/users/isghe/gists{/gist_id}","starred_url":"https://api.github.com/users/isghe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isghe/subscriptions","organizations_url":"https://api.github.com/users/isghe/orgs","repos_url":"https://api.github.com/users/isghe/repos","events_url":"https://api.github.com/users/isghe/events{/privacy}","received_events_url":"https://api.github.com/users/isghe/received_events","type":"User","site_admin":false},"body":"done in fa6d149eb264e8594eabbe1f6bd31b7ca5dd0a66","created_at":"2018-08-20T19:50:52Z","updated_at":"2018-08-20T19:50:52Z","html_url":"https://github.com/bitcoin/bitcoin/pull/13945#discussion_r211386164","pull_request_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13945","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/211386164"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/13945#discussion_r211386164"},"pull_request":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13945"}},"in_reply_to_id":211208971},"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13945","id":207796918,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3Nzk2OTE4","html_url":"https://github.com/bitcoin/bitcoin/pull/13945","diff_url":"https://github.com/bitcoin/bitcoin/pull/13945.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/13945.patch","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13945","number":13945,"state":"open","locked":false,"title":"Refactoring CRPCCommand with enum category","user":{"login":"isghe","id":1006078,"node_id":"MDQ6VXNlcjEwMDYwNzg=","avatar_url":"https://avatars1.githubusercontent.com/u/1006078?v=4","gravatar_id":"","url":"https://api.github.com/users/isghe","html_url":"https://github.com/isghe","followers_url":"https://api.github.com/users/isghe/followers","following_url":"https://api.github.com/users/isghe/following{/other_user}","gists_url":"https://api.github.com/users/isghe/gists{/gist_id}","starred_url":"https://api.github.com/users/isghe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isghe/subscriptions","organizations_url":"https://api.github.com/users/isghe/orgs","repos_url":"https://api.github.com/users/isghe/repos","events_url":"https://api.github.com/users/isghe/events{/privacy}","received_events_url":"https://api.github.com/users/isghe/received_events","type":"User","site_admin":false},"body":"refactoring `CRPCCommand` changing the  type of its member `category` from `std::string` to a `typedef enum ERPCCategory`.\r\nThe behaviour should be exactly the same with a very very small, in any way irrelevant, speed dump.\r\n\r\nI am doing this, in preparation to add attributes, likes `visibility` and `state` to `CRPCCommand ` structure, to avoid using category names, for overridden informations like visibility or deprecation.\r\n\r\nFor example, from v0.16.0 the command `getinfo` switched its category from `control` to `hidden`, while I think the idea was to let it to `control` category, with attributes similar to `visibility = false` and `state = deprecated`\r\n\r\nThanks,\r\nIsidoro Ghezzi\r\n\r\np.s:\r\n* Take care on the fact, that I had no warning assigning the enum to a std::string :-(\r\nAlso take care I'm never testing on QT. (I simply never configure nor compile on QT); anyway I was able to catch the QT command `rpcNestedTest`.\r\n* I tested only on `regtest` and `macOS`\r\n\r\nEDITs: \r\n 1. Using `enum class` it's giving right error trying to assign by mistake to a std::string :-) https://github.com/bitcoin/bitcoin/pull/13945/commits/cf190f57a078df1d37bd1822e3fa69ba0d9c90e6\r\n2. I tested on `regtest` on `ubuntu` and `macOS`\r\n3. I never tested nor compiled on windows.","created_at":"2018-08-11T23:21:07Z","updated_at":"2018-08-20T19:50:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"97aead68fd549ba482e1c28ba4ccdc2f6cc20c95","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":98279177,"node_id":"MDU6TGFiZWw5ODI3OTE3Nw==","url":"https://api.github.com/repos/bitcoin/bitcoin/labels/RPC/REST/ZMQ","name":"RPC/REST/ZMQ","color":"0052cc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13945/commits","review_comments_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13945/comments","review_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13945/comments","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/7f997989bc63fe14ada94094751c8b4551a4178c","head":{"label":"isghe:refactoring-CRPCCommand-with-enum-category","ref":"refactoring-CRPCCommand-with-enum-category","sha":"7f997989bc63fe14ada94094751c8b4551a4178c","user":{"login":"isghe","id":1006078,"node_id":"MDQ6VXNlcjEwMDYwNzg=","avatar_url":"https://avatars1.githubusercontent.com/u/1006078?v=4","gravatar_id":"","url":"https://api.github.com/users/isghe","html_url":"https://github.com/isghe","followers_url":"https://api.github.com/users/isghe/followers","following_url":"https://api.github.com/users/isghe/following{/other_user}","gists_url":"https://api.github.com/users/isghe/gists{/gist_id}","starred_url":"https://api.github.com/users/isghe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isghe/subscriptions","organizations_url":"https://api.github.com/users/isghe/orgs","repos_url":"https://api.github.com/users/isghe/repos","events_url":"https://api.github.com/users/isghe/events{/privacy}","received_events_url":"https://api.github.com/users/isghe/received_events","type":"User","site_admin":false},"repo":{"id":17763071,"node_id":"MDEwOlJlcG9zaXRvcnkxNzc2MzA3MQ==","name":"bitcoin","full_name":"isghe/bitcoin","owner":{"login":"isghe","id":1006078,"node_id":"MDQ6VXNlcjEwMDYwNzg=","avatar_url":"https://avatars1.githubusercontent.com/u/1006078?v=4","gravatar_id":"","url":"https://api.github.com/users/isghe","html_url":"https://github.com/isghe","followers_url":"https://api.github.com/users/isghe/followers","following_url":"https://api.github.com/users/isghe/following{/other_user}","gists_url":"https://api.github.com/users/isghe/gists{/gist_id}","starred_url":"https://api.github.com/users/isghe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isghe/subscriptions","organizations_url":"https://api.github.com/users/isghe/orgs","repos_url":"https://api.github.com/users/isghe/repos","events_url":"https://api.github.com/users/isghe/events{/privacy}","received_events_url":"https://api.github.com/users/isghe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/isghe/bitcoin","description":"Bitcoin Core integration/staging tree","fork":true,"url":"https://api.github.com/repos/isghe/bitcoin","forks_url":"https://api.github.com/repos/isghe/bitcoin/forks","keys_url":"https://api.github.com/repos/isghe/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/isghe/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/isghe/bitcoin/teams","hooks_url":"https://api.github.com/repos/isghe/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/isghe/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/isghe/bitcoin/events","assignees_url":"https://api.github.com/repos/isghe/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/isghe/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/isghe/bitcoin/tags","blobs_url":"https://api.github.com/repos/isghe/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/isghe/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/isghe/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/isghe/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/isghe/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/isghe/bitcoin/languages","stargazers_url":"https://api.github.com/repos/isghe/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/isghe/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/isghe/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/isghe/bitcoin/subscription","commits_url":"https://api.github.com/repos/isghe/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/isghe/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/isghe/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/isghe/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/isghe/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/isghe/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/isghe/bitcoin/merges","archive_url":"https://api.github.com/repos/isghe/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/isghe/bitcoin/downloads","issues_url":"https://api.github.com/repos/isghe/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/isghe/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/isghe/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/isghe/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/isghe/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/isghe/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/isghe/bitcoin/deployments","created_at":"2014-03-14T22:57:17Z","updated_at":"2018-08-11T22:39:04Z","pushed_at":"2018-08-20T19:48:19Z","git_url":"git://github.com/isghe/bitcoin.git","ssh_url":"git@github.com:isghe/bitcoin.git","clone_url":"https://github.com/isghe/bitcoin.git","svn_url":"https://github.com/isghe/bitcoin","homepage":"https://bitcoin.org/en/download","size":100276,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"bitcoin:master","ref":"master","sha":"b5591ca0b053623f0d96423b05ad809115a0bdef","user":{"login":"bitcoin","id":528860,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyODg2MA==","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,"node_id":"MDEwOlJlcG9zaXRvcnkxMTgxOTI3","name":"bitcoin","full_name":"bitcoin/bitcoin","owner":{"login":"bitcoin","id":528860,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyODg2MA==","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":"2018-08-20T17:28:36Z","pushed_at":"2018-08-20T19:48:23Z","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://bitcoincore.org/en/download","size":110062,"stargazers_count":34110,"watchers_count":34110,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":20646,"mirror_url":null,"archived":false,"open_issues_count":847,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":20646,"open_issues":847,"watchers":34110,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13945"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/13945"},"issue":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/13945"},"comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/13945/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13945/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13945/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin/bitcoin/statuses/7f997989bc63fe14ada94094751c8b4551a4178c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"isghe"}}