{"action":"created","comment":{"url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/comments/184260804","pull_request_review_id":115418884,"id":184260804,"diff_hunk":"@@ -174,7 +174,9 @@ class ClientBase: public Interface\n     }\n \n     Block block(BlockNumber _h) const;\n-\n+    \n+    virtual int chainId() const override;","path":"libethereum/ClientBase.h","position":null,"original_position":6,"commit_id":"f44cbddae9396402eb181d62f5f29c034529f70a","original_commit_id":"378bb56849670cbbfe7b18171bc691907d420f91","user":{"login":"halfalicious","id":15605026,"avatar_url":"https://avatars1.githubusercontent.com/u/15605026?v=4","gravatar_id":"","url":"https://api.github.com/users/halfalicious","html_url":"https://github.com/halfalicious","followers_url":"https://api.github.com/users/halfalicious/followers","following_url":"https://api.github.com/users/halfalicious/following{/other_user}","gists_url":"https://api.github.com/users/halfalicious/gists{/gist_id}","starred_url":"https://api.github.com/users/halfalicious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halfalicious/subscriptions","organizations_url":"https://api.github.com/users/halfalicious/orgs","repos_url":"https://api.github.com/users/halfalicious/repos","events_url":"https://api.github.com/users/halfalicious/events{/privacy}","received_events_url":"https://api.github.com/users/halfalicious/received_events","type":"User","site_admin":false},"body":"Thanks @gumb0, I've removed virtual from all of the ClientBase functions which override other functions.","created_at":"2018-04-26T03:15:24Z","updated_at":"2018-04-26T03:15:24Z","html_url":"https://github.com/ethereum/cpp-ethereum/pull/4975#discussion_r184260804","pull_request_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/4975","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/comments/184260804"},"html":{"href":"https://github.com/ethereum/cpp-ethereum/pull/4975#discussion_r184260804"},"pull_request":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/4975"}},"in_reply_to_id":183780009},"pull_request":{"url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/4975","id":183623774,"html_url":"https://github.com/ethereum/cpp-ethereum/pull/4975","diff_url":"https://github.com/ethereum/cpp-ethereum/pull/4975.diff","patch_url":"https://github.com/ethereum/cpp-ethereum/pull/4975.patch","issue_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/4975","number":4975,"state":"open","locked":false,"title":"Add support for eth_chainId","user":{"login":"halfalicious","id":15605026,"avatar_url":"https://avatars1.githubusercontent.com/u/15605026?v=4","gravatar_id":"","url":"https://api.github.com/users/halfalicious","html_url":"https://github.com/halfalicious","followers_url":"https://api.github.com/users/halfalicious/followers","following_url":"https://api.github.com/users/halfalicious/following{/other_user}","gists_url":"https://api.github.com/users/halfalicious/gists{/gist_id}","starred_url":"https://api.github.com/users/halfalicious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halfalicious/subscriptions","organizations_url":"https://api.github.com/users/halfalicious/orgs","repos_url":"https://api.github.com/users/halfalicious/repos","events_url":"https://api.github.com/users/halfalicious/events{/privacy}","received_events_url":"https://api.github.com/users/halfalicious/received_events","type":"User","site_admin":false},"body":"Fixes #4810 \r\nImplements https://github.com/ethereum/EIPs/blob/master/EIPS/eip-695.md\r\n\r\nI added a `chainId()` function to the `libethereum\\Interface` class which returns 0 by default (since chainId values start @ 0x1 with MainNet), along with the corresponding function to `libethereum\\ClientBase` which retrieves the current chain id from `BlockChain::chainParams`. I then surfaced the function in the JSON-RPC API by adding it to `libweb3jsonrpc\\eth.json` and regenerating `EthFace.h` via `jsonrpcstub`, and removing unnecessary changes from the generated file.\r\n\r\nI tested my changes on Ubuntu with eth connected to Ropsten and a JSON-RPC server setup via the `jsonrpcproxy.py` script:\r\n\r\n```\r\nlocaladminuser@ELLIOTT:~$ curl -X POST --data '{\"jsonrpc\":\"2.0\",\"method\":\"eth_chainId\",\"params\":[],\"id\":1}' http://localhost:8545\r\n{\"id\":1,\"jsonrpc\":\"2.0\",\"result\":\"0x3\"}\r\nlocaladminuser@ELLIOTT:~$ \r\n```\r\n\r\n","created_at":"2018-04-24T05:24:40Z","updated_at":"2018-04-26T03:15:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be43b72a71f1ed4b0883a6d594111e0149c779c2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/4975/commits","review_comments_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/4975/comments","review_comment_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/4975/comments","statuses_url":"https://api.github.com/repos/ethereum/cpp-ethereum/statuses/f44cbddae9396402eb181d62f5f29c034529f70a","head":{"label":"halfalicious:4810_ExposeChainId","ref":"4810_ExposeChainId","sha":"f44cbddae9396402eb181d62f5f29c034529f70a","user":{"login":"halfalicious","id":15605026,"avatar_url":"https://avatars1.githubusercontent.com/u/15605026?v=4","gravatar_id":"","url":"https://api.github.com/users/halfalicious","html_url":"https://github.com/halfalicious","followers_url":"https://api.github.com/users/halfalicious/followers","following_url":"https://api.github.com/users/halfalicious/following{/other_user}","gists_url":"https://api.github.com/users/halfalicious/gists{/gist_id}","starred_url":"https://api.github.com/users/halfalicious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halfalicious/subscriptions","organizations_url":"https://api.github.com/users/halfalicious/orgs","repos_url":"https://api.github.com/users/halfalicious/repos","events_url":"https://api.github.com/users/halfalicious/events{/privacy}","received_events_url":"https://api.github.com/users/halfalicious/received_events","type":"User","site_admin":false},"repo":{"id":129848787,"name":"cpp-ethereum","full_name":"halfalicious/cpp-ethereum","owner":{"login":"halfalicious","id":15605026,"avatar_url":"https://avatars1.githubusercontent.com/u/15605026?v=4","gravatar_id":"","url":"https://api.github.com/users/halfalicious","html_url":"https://github.com/halfalicious","followers_url":"https://api.github.com/users/halfalicious/followers","following_url":"https://api.github.com/users/halfalicious/following{/other_user}","gists_url":"https://api.github.com/users/halfalicious/gists{/gist_id}","starred_url":"https://api.github.com/users/halfalicious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halfalicious/subscriptions","organizations_url":"https://api.github.com/users/halfalicious/orgs","repos_url":"https://api.github.com/users/halfalicious/repos","events_url":"https://api.github.com/users/halfalicious/events{/privacy}","received_events_url":"https://api.github.com/users/halfalicious/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/halfalicious/cpp-ethereum","description":"Ethereum C++ client","fork":true,"url":"https://api.github.com/repos/halfalicious/cpp-ethereum","forks_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/forks","keys_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/teams","hooks_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/hooks","issue_events_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/issues/events{/number}","events_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/events","assignees_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/assignees{/user}","branches_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/branches{/branch}","tags_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/tags","blobs_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/git/refs{/sha}","trees_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/statuses/{sha}","languages_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/languages","stargazers_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/stargazers","contributors_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/contributors","subscribers_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/subscribers","subscription_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/subscription","commits_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/commits{/sha}","git_commits_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/git/commits{/sha}","comments_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/comments{/number}","issue_comment_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/issues/comments{/number}","contents_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/contents/{+path}","compare_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/merges","archive_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/downloads","issues_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/issues{/number}","pulls_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/pulls{/number}","milestones_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/milestones{/number}","notifications_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/labels{/name}","releases_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/releases{/id}","deployments_url":"https://api.github.com/repos/halfalicious/cpp-ethereum/deployments","created_at":"2018-04-17T05:03:51Z","updated_at":"2018-04-21T20:34:23Z","pushed_at":"2018-04-26T03:14:12Z","git_url":"git://github.com/halfalicious/cpp-ethereum.git","ssh_url":"git@github.com:halfalicious/cpp-ethereum.git","clone_url":"https://github.com/halfalicious/cpp-ethereum.git","svn_url":"https://github.com/halfalicious/cpp-ethereum","homepage":"http://cpp-ethereum.org","size":53952,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"ethereum:develop","ref":"develop","sha":"4ad6f1ccdaed4771fbb549570f2197817f85f0e7","user":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars3.githubusercontent.com/u/6250754?v=4","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"repo":{"id":15460666,"name":"cpp-ethereum","full_name":"ethereum/cpp-ethereum","owner":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars3.githubusercontent.com/u/6250754?v=4","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethereum/cpp-ethereum","description":"Ethereum C++ client","fork":false,"url":"https://api.github.com/repos/ethereum/cpp-ethereum","forks_url":"https://api.github.com/repos/ethereum/cpp-ethereum/forks","keys_url":"https://api.github.com/repos/ethereum/cpp-ethereum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethereum/cpp-ethereum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethereum/cpp-ethereum/teams","hooks_url":"https://api.github.com/repos/ethereum/cpp-ethereum/hooks","issue_events_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/events{/number}","events_url":"https://api.github.com/repos/ethereum/cpp-ethereum/events","assignees_url":"https://api.github.com/repos/ethereum/cpp-ethereum/assignees{/user}","branches_url":"https://api.github.com/repos/ethereum/cpp-ethereum/branches{/branch}","tags_url":"https://api.github.com/repos/ethereum/cpp-ethereum/tags","blobs_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethereum/cpp-ethereum/statuses/{sha}","languages_url":"https://api.github.com/repos/ethereum/cpp-ethereum/languages","stargazers_url":"https://api.github.com/repos/ethereum/cpp-ethereum/stargazers","contributors_url":"https://api.github.com/repos/ethereum/cpp-ethereum/contributors","subscribers_url":"https://api.github.com/repos/ethereum/cpp-ethereum/subscribers","subscription_url":"https://api.github.com/repos/ethereum/cpp-ethereum/subscription","commits_url":"https://api.github.com/repos/ethereum/cpp-ethereum/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethereum/cpp-ethereum/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethereum/cpp-ethereum/contents/{+path}","compare_url":"https://api.github.com/repos/ethereum/cpp-ethereum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethereum/cpp-ethereum/merges","archive_url":"https://api.github.com/repos/ethereum/cpp-ethereum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethereum/cpp-ethereum/downloads","issues_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues{/number}","pulls_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls{/number}","milestones_url":"https://api.github.com/repos/ethereum/cpp-ethereum/milestones{/number}","notifications_url":"https://api.github.com/repos/ethereum/cpp-ethereum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethereum/cpp-ethereum/labels{/name}","releases_url":"https://api.github.com/repos/ethereum/cpp-ethereum/releases{/id}","deployments_url":"https://api.github.com/repos/ethereum/cpp-ethereum/deployments","created_at":"2013-12-26T21:26:06Z","updated_at":"2018-04-26T02:04:43Z","pushed_at":"2018-04-26T03:14:17Z","git_url":"git://github.com/ethereum/cpp-ethereum.git","ssh_url":"git@github.com:ethereum/cpp-ethereum.git","clone_url":"https://github.com/ethereum/cpp-ethereum.git","svn_url":"https://github.com/ethereum/cpp-ethereum","homepage":"http://cpp-ethereum.org","size":54061,"stargazers_count":2988,"watchers_count":2988,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1876,"mirror_url":null,"archived":false,"open_issues_count":318,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":1876,"open_issues":318,"watchers":2988,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/4975"},"html":{"href":"https://github.com/ethereum/cpp-ethereum/pull/4975"},"issue":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/4975"},"comments":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/4975/comments"},"review_comments":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/4975/comments"},"review_comment":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/4975/commits"},"statuses":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/statuses/f44cbddae9396402eb181d62f5f29c034529f70a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"halfalicious"}}