{"action":"opened","number":3816,"pull_request":{"url":"https://api.github.com/repos/LiskHQ/lisk-sdk/pulls/3816","id":287852856,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjg3ODUyODU2","html_url":"https://github.com/LiskHQ/lisk-sdk/pull/3816","diff_url":"https://github.com/LiskHQ/lisk-sdk/pull/3816.diff","patch_url":"https://github.com/LiskHQ/lisk-sdk/pull/3816.patch","issue_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/issues/3816","number":3816,"state":"open","locked":false,"title":"Implement getCommonBlocks - Closes #3766","user":{"login":"limiaspasdaniel","id":7485885,"node_id":"MDQ6VXNlcjc0ODU4ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/7485885?v=4","gravatar_id":"","url":"https://api.github.com/users/limiaspasdaniel","html_url":"https://github.com/limiaspasdaniel","followers_url":"https://api.github.com/users/limiaspasdaniel/followers","following_url":"https://api.github.com/users/limiaspasdaniel/following{/other_user}","gists_url":"https://api.github.com/users/limiaspasdaniel/gists{/gist_id}","starred_url":"https://api.github.com/users/limiaspasdaniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/limiaspasdaniel/subscriptions","organizations_url":"https://api.github.com/users/limiaspasdaniel/orgs","repos_url":"https://api.github.com/users/limiaspasdaniel/repos","events_url":"https://api.github.com/users/limiaspasdaniel/events{/privacy}","received_events_url":"https://api.github.com/users/limiaspasdaniel/received_events","type":"User","site_admin":false},"body":"### What was the problem?\r\n`blocksCommon` implementation was outdated and it was also not taking into account the full list of block identifiers sent by the requester.\r\n### How did I fix it?\r\nImplementation:\r\n- Rename `blocksCommon` to `getCommonBlocks`\r\n- Create a public action in `Chain` module\r\n- Ditch input CSV format for JSON arrays.\r\n- Validate the request query using JSON Schema to check if:\r\n\t- an array named \"ids\" is present\r\n\t- the array is not empty (at least 1 block ids needs to included)\r\n\t- the array contains no duplicated ids\r\n- Return an empty array if there are no common blocks\r\n- Feed back validation errors if the input has an invalid format or content\r\n\r\nTesting:\r\n- Update unit tests\r\n- Update functional tests\r\n\r\n### How to test it?\r\nRun the following tests:\r\n- `framework/test/mocha/unit/modules/chain/transport.js`\r\n- `framework/test/mocha/functional/ws/transport/blocks.js`\r\n### Review checklist\r\n* The PR resolves #3769 \r\n* All new code is covered with unit tests\r\n* All new code was formatted with Prettier\r\n* Linting passes\r\n* Tests pass\r\n* Commit messages follow the [commit guidelines](CONTRIBUTING.md#git-commit-messages)\r\n* Documentation has been added/updated\r\n","created_at":"2019-06-13T10:06:14Z","updated_at":"2019-06-13T10:06:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"limiaspasdaniel","id":7485885,"node_id":"MDQ6VXNlcjc0ODU4ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/7485885?v=4","gravatar_id":"","url":"https://api.github.com/users/limiaspasdaniel","html_url":"https://github.com/limiaspasdaniel","followers_url":"https://api.github.com/users/limiaspasdaniel/followers","following_url":"https://api.github.com/users/limiaspasdaniel/following{/other_user}","gists_url":"https://api.github.com/users/limiaspasdaniel/gists{/gist_id}","starred_url":"https://api.github.com/users/limiaspasdaniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/limiaspasdaniel/subscriptions","organizations_url":"https://api.github.com/users/limiaspasdaniel/orgs","repos_url":"https://api.github.com/users/limiaspasdaniel/repos","events_url":"https://api.github.com/users/limiaspasdaniel/events{/privacy}","received_events_url":"https://api.github.com/users/limiaspasdaniel/received_events","type":"User","site_admin":false},"assignees":[{"login":"limiaspasdaniel","id":7485885,"node_id":"MDQ6VXNlcjc0ODU4ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/7485885?v=4","gravatar_id":"","url":"https://api.github.com/users/limiaspasdaniel","html_url":"https://github.com/limiaspasdaniel","followers_url":"https://api.github.com/users/limiaspasdaniel/followers","following_url":"https://api.github.com/users/limiaspasdaniel/following{/other_user}","gists_url":"https://api.github.com/users/limiaspasdaniel/gists{/gist_id}","starred_url":"https://api.github.com/users/limiaspasdaniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/limiaspasdaniel/subscriptions","organizations_url":"https://api.github.com/users/limiaspasdaniel/orgs","repos_url":"https://api.github.com/users/limiaspasdaniel/repos","events_url":"https://api.github.com/users/limiaspasdaniel/events{/privacy}","received_events_url":"https://api.github.com/users/limiaspasdaniel/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/pulls/3816/commits","review_comments_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/pulls/3816/comments","review_comment_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/issues/3816/comments","statuses_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/statuses/0fb077fc0fb6fb20bcaa4057181e2733b997fc72","head":{"label":"LiskHQ:3769-Implement_mechanism_for_finding_common_block","ref":"3769-Implement_mechanism_for_finding_common_block","sha":"0fb077fc0fb6fb20bcaa4057181e2733b997fc72","user":{"login":"LiskHQ","id":16600915,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NjAwOTE1","avatar_url":"https://avatars1.githubusercontent.com/u/16600915?v=4","gravatar_id":"","url":"https://api.github.com/users/LiskHQ","html_url":"https://github.com/LiskHQ","followers_url":"https://api.github.com/users/LiskHQ/followers","following_url":"https://api.github.com/users/LiskHQ/following{/other_user}","gists_url":"https://api.github.com/users/LiskHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/LiskHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiskHQ/subscriptions","organizations_url":"https://api.github.com/users/LiskHQ/orgs","repos_url":"https://api.github.com/users/LiskHQ/repos","events_url":"https://api.github.com/users/LiskHQ/events{/privacy}","received_events_url":"https://api.github.com/users/LiskHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":50873641,"node_id":"MDEwOlJlcG9zaXRvcnk1MDg3MzY0MQ==","name":"lisk-sdk","full_name":"LiskHQ/lisk-sdk","private":false,"owner":{"login":"LiskHQ","id":16600915,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NjAwOTE1","avatar_url":"https://avatars1.githubusercontent.com/u/16600915?v=4","gravatar_id":"","url":"https://api.github.com/users/LiskHQ","html_url":"https://github.com/LiskHQ","followers_url":"https://api.github.com/users/LiskHQ/followers","following_url":"https://api.github.com/users/LiskHQ/following{/other_user}","gists_url":"https://api.github.com/users/LiskHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/LiskHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiskHQ/subscriptions","organizations_url":"https://api.github.com/users/LiskHQ/orgs","repos_url":"https://api.github.com/users/LiskHQ/repos","events_url":"https://api.github.com/users/LiskHQ/events{/privacy}","received_events_url":"https://api.github.com/users/LiskHQ/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/LiskHQ/lisk-sdk","description":"🔩 Lisk software development kit","fork":false,"url":"https://api.github.com/repos/LiskHQ/lisk-sdk","forks_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/forks","keys_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/teams","hooks_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/hooks","issue_events_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/events","assignees_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/tags","blobs_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/languages","stargazers_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/stargazers","contributors_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/contributors","subscribers_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/subscribers","subscription_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/subscription","commits_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/merges","archive_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/downloads","issues_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/labels{/name}","releases_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/deployments","created_at":"2016-02-01T21:45:35Z","updated_at":"2019-06-12T09:48:48Z","pushed_at":"2019-06-13T09:56:57Z","git_url":"git://github.com/LiskHQ/lisk-sdk.git","ssh_url":"git@github.com:LiskHQ/lisk-sdk.git","clone_url":"https://github.com/LiskHQ/lisk-sdk.git","svn_url":"https://github.com/LiskHQ/lisk-sdk","homepage":"https://lisk.io/","size":62390,"stargazers_count":2663,"watchers_count":2663,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":430,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":210,"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","node_id":"MDc6TGljZW5zZTk="},"forks":430,"open_issues":210,"watchers":2663,"default_branch":"development"}},"base":{"label":"LiskHQ:feature/introduce_bft_consensus","ref":"feature/introduce_bft_consensus","sha":"96e5885135da2e5bb4d9614a454c62eafdb14075","user":{"login":"LiskHQ","id":16600915,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NjAwOTE1","avatar_url":"https://avatars1.githubusercontent.com/u/16600915?v=4","gravatar_id":"","url":"https://api.github.com/users/LiskHQ","html_url":"https://github.com/LiskHQ","followers_url":"https://api.github.com/users/LiskHQ/followers","following_url":"https://api.github.com/users/LiskHQ/following{/other_user}","gists_url":"https://api.github.com/users/LiskHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/LiskHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiskHQ/subscriptions","organizations_url":"https://api.github.com/users/LiskHQ/orgs","repos_url":"https://api.github.com/users/LiskHQ/repos","events_url":"https://api.github.com/users/LiskHQ/events{/privacy}","received_events_url":"https://api.github.com/users/LiskHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":50873641,"node_id":"MDEwOlJlcG9zaXRvcnk1MDg3MzY0MQ==","name":"lisk-sdk","full_name":"LiskHQ/lisk-sdk","private":false,"owner":{"login":"LiskHQ","id":16600915,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NjAwOTE1","avatar_url":"https://avatars1.githubusercontent.com/u/16600915?v=4","gravatar_id":"","url":"https://api.github.com/users/LiskHQ","html_url":"https://github.com/LiskHQ","followers_url":"https://api.github.com/users/LiskHQ/followers","following_url":"https://api.github.com/users/LiskHQ/following{/other_user}","gists_url":"https://api.github.com/users/LiskHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/LiskHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiskHQ/subscriptions","organizations_url":"https://api.github.com/users/LiskHQ/orgs","repos_url":"https://api.github.com/users/LiskHQ/repos","events_url":"https://api.github.com/users/LiskHQ/events{/privacy}","received_events_url":"https://api.github.com/users/LiskHQ/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/LiskHQ/lisk-sdk","description":"🔩 Lisk software development kit","fork":false,"url":"https://api.github.com/repos/LiskHQ/lisk-sdk","forks_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/forks","keys_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/teams","hooks_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/hooks","issue_events_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/events","assignees_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/tags","blobs_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/languages","stargazers_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/stargazers","contributors_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/contributors","subscribers_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/subscribers","subscription_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/subscription","commits_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/merges","archive_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/downloads","issues_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/labels{/name}","releases_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/LiskHQ/lisk-sdk/deployments","created_at":"2016-02-01T21:45:35Z","updated_at":"2019-06-12T09:48:48Z","pushed_at":"2019-06-13T09:56:57Z","git_url":"git://github.com/LiskHQ/lisk-sdk.git","ssh_url":"git@github.com:LiskHQ/lisk-sdk.git","clone_url":"https://github.com/LiskHQ/lisk-sdk.git","svn_url":"https://github.com/LiskHQ/lisk-sdk","homepage":"https://lisk.io/","size":62390,"stargazers_count":2663,"watchers_count":2663,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":430,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":210,"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","node_id":"MDc6TGljZW5zZTk="},"forks":430,"open_issues":210,"watchers":2663,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/LiskHQ/lisk-sdk/pulls/3816"},"html":{"href":"https://github.com/LiskHQ/lisk-sdk/pull/3816"},"issue":{"href":"https://api.github.com/repos/LiskHQ/lisk-sdk/issues/3816"},"comments":{"href":"https://api.github.com/repos/LiskHQ/lisk-sdk/issues/3816/comments"},"review_comments":{"href":"https://api.github.com/repos/LiskHQ/lisk-sdk/pulls/3816/comments"},"review_comment":{"href":"https://api.github.com/repos/LiskHQ/lisk-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LiskHQ/lisk-sdk/pulls/3816/commits"},"statuses":{"href":"https://api.github.com/repos/LiskHQ/lisk-sdk/statuses/0fb077fc0fb6fb20bcaa4057181e2733b997fc72"}},"author_association":"MEMBER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"draft","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":105,"deletions":169,"changed_files":7}}
{"actor":{"display_login":"limiaspasdaniel"}}