{"action":"created","comment":{"url":"https://api.github.com/repos/libp2p/js-peer-id/pulls/comments/229251993","pull_request_review_id":169704023,"id":229251993,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTI1MTk5Mw==","diff_hunk":"@@ -119,176 +118,115 @@ class PeerId {\n   /*\n    * Check if this PeerId instance is valid (privKey -> pubKey -> Id)\n    */\n-  isValid (callback) {\n+  isValid () {\n     // TODO Needs better checking\n     if (this.privKey &&\n       this.privKey.public &&\n       this.privKey.public.bytes &&\n       Buffer.isBuffer(this.pubKey.bytes) &&\n       this.privKey.public.bytes.equals(this.pubKey.bytes)) {\n-      callback()\n+      return true\n     } else {\n-      callback(new Error('Keys not match'))\n+      throw new Error('Keys not match')","path":"src/index.js","position":null,"original_position":24,"commit_id":"7e706682fd00f88fb927c729bc5d68d91e32f24a","original_commit_id":"97ed4ac11ccf2ffe479b94ba2359ef8bb077f7f5","user":{"login":"hacdias","id":5447088,"node_id":"MDQ6VXNlcjU0NDcwODg=","avatar_url":"https://avatars2.githubusercontent.com/u/5447088?v=4","gravatar_id":"","url":"https://api.github.com/users/hacdias","html_url":"https://github.com/hacdias","followers_url":"https://api.github.com/users/hacdias/followers","following_url":"https://api.github.com/users/hacdias/following{/other_user}","gists_url":"https://api.github.com/users/hacdias/gists{/gist_id}","starred_url":"https://api.github.com/users/hacdias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hacdias/subscriptions","organizations_url":"https://api.github.com/users/hacdias/orgs","repos_url":"https://api.github.com/users/hacdias/repos","events_url":"https://api.github.com/users/hacdias/events{/privacy}","received_events_url":"https://api.github.com/users/hacdias/received_events","type":"User","site_admin":false},"body":"Done!","created_at":"2018-10-30T10:32:48Z","updated_at":"2018-10-30T10:32:48Z","html_url":"https://github.com/libp2p/js-peer-id/pull/87#discussion_r229251993","pull_request_url":"https://api.github.com/repos/libp2p/js-peer-id/pulls/87","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/libp2p/js-peer-id/pulls/comments/229251993"},"html":{"href":"https://github.com/libp2p/js-peer-id/pull/87#discussion_r229251993"},"pull_request":{"href":"https://api.github.com/repos/libp2p/js-peer-id/pulls/87"}},"in_reply_to_id":229242922},"pull_request":{"url":"https://api.github.com/repos/libp2p/js-peer-id/pulls/87","id":226755132,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2NzU1MTMy","html_url":"https://github.com/libp2p/js-peer-id/pull/87","diff_url":"https://github.com/libp2p/js-peer-id/pull/87.diff","patch_url":"https://github.com/libp2p/js-peer-id/pull/87.patch","issue_url":"https://api.github.com/repos/libp2p/js-peer-id/issues/87","number":87,"state":"open","locked":false,"title":"[WIP] feat: async await","user":{"login":"hacdias","id":5447088,"node_id":"MDQ6VXNlcjU0NDcwODg=","avatar_url":"https://avatars2.githubusercontent.com/u/5447088?v=4","gravatar_id":"","url":"https://api.github.com/users/hacdias","html_url":"https://github.com/hacdias","followers_url":"https://api.github.com/users/hacdias/followers","following_url":"https://api.github.com/users/hacdias/following{/other_user}","gists_url":"https://api.github.com/users/hacdias/gists{/gist_id}","starred_url":"https://api.github.com/users/hacdias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hacdias/subscriptions","organizations_url":"https://api.github.com/users/hacdias/orgs","repos_url":"https://api.github.com/users/hacdias/repos","events_url":"https://api.github.com/users/hacdias/events{/privacy}","received_events_url":"https://api.github.com/users/hacdias/received_events","type":"User","site_admin":false},"body":"More background about this effort: https://github.com/ipfs/js-ipfs/issues/1670.\r\n\r\n**Depends** on https://github.com/libp2p/js-libp2p-crypto/pull/131\r\n\r\nDespite some `createX` function not needing `async`, I added it to all of them to make them consistent. Otherwise we would have half returning a Promise and another half returning a PeerId.","created_at":"2018-10-30T00:23:44Z","updated_at":"2018-10-30T10:32:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e309328529780bb222c141ac10079d4cea0e28ed","assignee":{"login":"hacdias","id":5447088,"node_id":"MDQ6VXNlcjU0NDcwODg=","avatar_url":"https://avatars2.githubusercontent.com/u/5447088?v=4","gravatar_id":"","url":"https://api.github.com/users/hacdias","html_url":"https://github.com/hacdias","followers_url":"https://api.github.com/users/hacdias/followers","following_url":"https://api.github.com/users/hacdias/following{/other_user}","gists_url":"https://api.github.com/users/hacdias/gists{/gist_id}","starred_url":"https://api.github.com/users/hacdias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hacdias/subscriptions","organizations_url":"https://api.github.com/users/hacdias/orgs","repos_url":"https://api.github.com/users/hacdias/repos","events_url":"https://api.github.com/users/hacdias/events{/privacy}","received_events_url":"https://api.github.com/users/hacdias/received_events","type":"User","site_admin":false},"assignees":[{"login":"hacdias","id":5447088,"node_id":"MDQ6VXNlcjU0NDcwODg=","avatar_url":"https://avatars2.githubusercontent.com/u/5447088?v=4","gravatar_id":"","url":"https://api.github.com/users/hacdias","html_url":"https://github.com/hacdias","followers_url":"https://api.github.com/users/hacdias/followers","following_url":"https://api.github.com/users/hacdias/following{/other_user}","gists_url":"https://api.github.com/users/hacdias/gists{/gist_id}","starred_url":"https://api.github.com/users/hacdias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hacdias/subscriptions","organizations_url":"https://api.github.com/users/hacdias/orgs","repos_url":"https://api.github.com/users/hacdias/repos","events_url":"https://api.github.com/users/hacdias/events{/privacy}","received_events_url":"https://api.github.com/users/hacdias/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":419592828,"node_id":"MDU6TGFiZWw0MTk1OTI4Mjg=","url":"https://api.github.com/repos/libp2p/js-peer-id/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/libp2p/js-peer-id/pulls/87/commits","review_comments_url":"https://api.github.com/repos/libp2p/js-peer-id/pulls/87/comments","review_comment_url":"https://api.github.com/repos/libp2p/js-peer-id/pulls/comments{/number}","comments_url":"https://api.github.com/repos/libp2p/js-peer-id/issues/87/comments","statuses_url":"https://api.github.com/repos/libp2p/js-peer-id/statuses/7e706682fd00f88fb927c729bc5d68d91e32f24a","head":{"label":"libp2p:feat/async-await","ref":"feat/async-await","sha":"7e706682fd00f88fb927c729bc5d68d91e32f24a","user":{"login":"libp2p","id":14838238,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0ODM4MjM4","avatar_url":"https://avatars3.githubusercontent.com/u/14838238?v=4","gravatar_id":"","url":"https://api.github.com/users/libp2p","html_url":"https://github.com/libp2p","followers_url":"https://api.github.com/users/libp2p/followers","following_url":"https://api.github.com/users/libp2p/following{/other_user}","gists_url":"https://api.github.com/users/libp2p/gists{/gist_id}","starred_url":"https://api.github.com/users/libp2p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libp2p/subscriptions","organizations_url":"https://api.github.com/users/libp2p/orgs","repos_url":"https://api.github.com/users/libp2p/repos","events_url":"https://api.github.com/users/libp2p/events{/privacy}","received_events_url":"https://api.github.com/users/libp2p/received_events","type":"Organization","site_admin":false},"repo":{"id":38781926,"node_id":"MDEwOlJlcG9zaXRvcnkzODc4MTkyNg==","name":"js-peer-id","full_name":"libp2p/js-peer-id","private":false,"owner":{"login":"libp2p","id":14838238,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0ODM4MjM4","avatar_url":"https://avatars3.githubusercontent.com/u/14838238?v=4","gravatar_id":"","url":"https://api.github.com/users/libp2p","html_url":"https://github.com/libp2p","followers_url":"https://api.github.com/users/libp2p/followers","following_url":"https://api.github.com/users/libp2p/following{/other_user}","gists_url":"https://api.github.com/users/libp2p/gists{/gist_id}","starred_url":"https://api.github.com/users/libp2p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libp2p/subscriptions","organizations_url":"https://api.github.com/users/libp2p/orgs","repos_url":"https://api.github.com/users/libp2p/repos","events_url":"https://api.github.com/users/libp2p/events{/privacy}","received_events_url":"https://api.github.com/users/libp2p/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/libp2p/js-peer-id","description":"peer-id implementation in JavaScript","fork":false,"url":"https://api.github.com/repos/libp2p/js-peer-id","forks_url":"https://api.github.com/repos/libp2p/js-peer-id/forks","keys_url":"https://api.github.com/repos/libp2p/js-peer-id/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libp2p/js-peer-id/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libp2p/js-peer-id/teams","hooks_url":"https://api.github.com/repos/libp2p/js-peer-id/hooks","issue_events_url":"https://api.github.com/repos/libp2p/js-peer-id/issues/events{/number}","events_url":"https://api.github.com/repos/libp2p/js-peer-id/events","assignees_url":"https://api.github.com/repos/libp2p/js-peer-id/assignees{/user}","branches_url":"https://api.github.com/repos/libp2p/js-peer-id/branches{/branch}","tags_url":"https://api.github.com/repos/libp2p/js-peer-id/tags","blobs_url":"https://api.github.com/repos/libp2p/js-peer-id/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libp2p/js-peer-id/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libp2p/js-peer-id/git/refs{/sha}","trees_url":"https://api.github.com/repos/libp2p/js-peer-id/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libp2p/js-peer-id/statuses/{sha}","languages_url":"https://api.github.com/repos/libp2p/js-peer-id/languages","stargazers_url":"https://api.github.com/repos/libp2p/js-peer-id/stargazers","contributors_url":"https://api.github.com/repos/libp2p/js-peer-id/contributors","subscribers_url":"https://api.github.com/repos/libp2p/js-peer-id/subscribers","subscription_url":"https://api.github.com/repos/libp2p/js-peer-id/subscription","commits_url":"https://api.github.com/repos/libp2p/js-peer-id/commits{/sha}","git_commits_url":"https://api.github.com/repos/libp2p/js-peer-id/git/commits{/sha}","comments_url":"https://api.github.com/repos/libp2p/js-peer-id/comments{/number}","issue_comment_url":"https://api.github.com/repos/libp2p/js-peer-id/issues/comments{/number}","contents_url":"https://api.github.com/repos/libp2p/js-peer-id/contents/{+path}","compare_url":"https://api.github.com/repos/libp2p/js-peer-id/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libp2p/js-peer-id/merges","archive_url":"https://api.github.com/repos/libp2p/js-peer-id/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libp2p/js-peer-id/downloads","issues_url":"https://api.github.com/repos/libp2p/js-peer-id/issues{/number}","pulls_url":"https://api.github.com/repos/libp2p/js-peer-id/pulls{/number}","milestones_url":"https://api.github.com/repos/libp2p/js-peer-id/milestones{/number}","notifications_url":"https://api.github.com/repos/libp2p/js-peer-id/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libp2p/js-peer-id/labels{/name}","releases_url":"https://api.github.com/repos/libp2p/js-peer-id/releases{/id}","deployments_url":"https://api.github.com/repos/libp2p/js-peer-id/deployments","created_at":"2015-07-08T21:50:37Z","updated_at":"2018-10-30T10:14:45Z","pushed_at":"2018-10-30T10:32:44Z","git_url":"git://github.com/libp2p/js-peer-id.git","ssh_url":"git@github.com:libp2p/js-peer-id.git","clone_url":"https://github.com/libp2p/js-peer-id.git","svn_url":"https://github.com/libp2p/js-peer-id","homepage":"https://libp2p.io","size":2261,"stargazers_count":24,"watchers_count":24,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":20,"open_issues":15,"watchers":24,"default_branch":"master"}},"base":{"label":"libp2p:master","ref":"master","sha":"eb062759c622b68a23b9c1c18fe86b516c995a62","user":{"login":"libp2p","id":14838238,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0ODM4MjM4","avatar_url":"https://avatars3.githubusercontent.com/u/14838238?v=4","gravatar_id":"","url":"https://api.github.com/users/libp2p","html_url":"https://github.com/libp2p","followers_url":"https://api.github.com/users/libp2p/followers","following_url":"https://api.github.com/users/libp2p/following{/other_user}","gists_url":"https://api.github.com/users/libp2p/gists{/gist_id}","starred_url":"https://api.github.com/users/libp2p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libp2p/subscriptions","organizations_url":"https://api.github.com/users/libp2p/orgs","repos_url":"https://api.github.com/users/libp2p/repos","events_url":"https://api.github.com/users/libp2p/events{/privacy}","received_events_url":"https://api.github.com/users/libp2p/received_events","type":"Organization","site_admin":false},"repo":{"id":38781926,"node_id":"MDEwOlJlcG9zaXRvcnkzODc4MTkyNg==","name":"js-peer-id","full_name":"libp2p/js-peer-id","private":false,"owner":{"login":"libp2p","id":14838238,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0ODM4MjM4","avatar_url":"https://avatars3.githubusercontent.com/u/14838238?v=4","gravatar_id":"","url":"https://api.github.com/users/libp2p","html_url":"https://github.com/libp2p","followers_url":"https://api.github.com/users/libp2p/followers","following_url":"https://api.github.com/users/libp2p/following{/other_user}","gists_url":"https://api.github.com/users/libp2p/gists{/gist_id}","starred_url":"https://api.github.com/users/libp2p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libp2p/subscriptions","organizations_url":"https://api.github.com/users/libp2p/orgs","repos_url":"https://api.github.com/users/libp2p/repos","events_url":"https://api.github.com/users/libp2p/events{/privacy}","received_events_url":"https://api.github.com/users/libp2p/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/libp2p/js-peer-id","description":"peer-id implementation in JavaScript","fork":false,"url":"https://api.github.com/repos/libp2p/js-peer-id","forks_url":"https://api.github.com/repos/libp2p/js-peer-id/forks","keys_url":"https://api.github.com/repos/libp2p/js-peer-id/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libp2p/js-peer-id/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libp2p/js-peer-id/teams","hooks_url":"https://api.github.com/repos/libp2p/js-peer-id/hooks","issue_events_url":"https://api.github.com/repos/libp2p/js-peer-id/issues/events{/number}","events_url":"https://api.github.com/repos/libp2p/js-peer-id/events","assignees_url":"https://api.github.com/repos/libp2p/js-peer-id/assignees{/user}","branches_url":"https://api.github.com/repos/libp2p/js-peer-id/branches{/branch}","tags_url":"https://api.github.com/repos/libp2p/js-peer-id/tags","blobs_url":"https://api.github.com/repos/libp2p/js-peer-id/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libp2p/js-peer-id/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libp2p/js-peer-id/git/refs{/sha}","trees_url":"https://api.github.com/repos/libp2p/js-peer-id/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libp2p/js-peer-id/statuses/{sha}","languages_url":"https://api.github.com/repos/libp2p/js-peer-id/languages","stargazers_url":"https://api.github.com/repos/libp2p/js-peer-id/stargazers","contributors_url":"https://api.github.com/repos/libp2p/js-peer-id/contributors","subscribers_url":"https://api.github.com/repos/libp2p/js-peer-id/subscribers","subscription_url":"https://api.github.com/repos/libp2p/js-peer-id/subscription","commits_url":"https://api.github.com/repos/libp2p/js-peer-id/commits{/sha}","git_commits_url":"https://api.github.com/repos/libp2p/js-peer-id/git/commits{/sha}","comments_url":"https://api.github.com/repos/libp2p/js-peer-id/comments{/number}","issue_comment_url":"https://api.github.com/repos/libp2p/js-peer-id/issues/comments{/number}","contents_url":"https://api.github.com/repos/libp2p/js-peer-id/contents/{+path}","compare_url":"https://api.github.com/repos/libp2p/js-peer-id/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libp2p/js-peer-id/merges","archive_url":"https://api.github.com/repos/libp2p/js-peer-id/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libp2p/js-peer-id/downloads","issues_url":"https://api.github.com/repos/libp2p/js-peer-id/issues{/number}","pulls_url":"https://api.github.com/repos/libp2p/js-peer-id/pulls{/number}","milestones_url":"https://api.github.com/repos/libp2p/js-peer-id/milestones{/number}","notifications_url":"https://api.github.com/repos/libp2p/js-peer-id/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libp2p/js-peer-id/labels{/name}","releases_url":"https://api.github.com/repos/libp2p/js-peer-id/releases{/id}","deployments_url":"https://api.github.com/repos/libp2p/js-peer-id/deployments","created_at":"2015-07-08T21:50:37Z","updated_at":"2018-10-30T10:14:45Z","pushed_at":"2018-10-30T10:32:44Z","git_url":"git://github.com/libp2p/js-peer-id.git","ssh_url":"git@github.com:libp2p/js-peer-id.git","clone_url":"https://github.com/libp2p/js-peer-id.git","svn_url":"https://github.com/libp2p/js-peer-id","homepage":"https://libp2p.io","size":2261,"stargazers_count":24,"watchers_count":24,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":20,"open_issues":15,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/libp2p/js-peer-id/pulls/87"},"html":{"href":"https://github.com/libp2p/js-peer-id/pull/87"},"issue":{"href":"https://api.github.com/repos/libp2p/js-peer-id/issues/87"},"comments":{"href":"https://api.github.com/repos/libp2p/js-peer-id/issues/87/comments"},"review_comments":{"href":"https://api.github.com/repos/libp2p/js-peer-id/pulls/87/comments"},"review_comment":{"href":"https://api.github.com/repos/libp2p/js-peer-id/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/libp2p/js-peer-id/pulls/87/commits"},"statuses":{"href":"https://api.github.com/repos/libp2p/js-peer-id/statuses/7e706682fd00f88fb927c729bc5d68d91e32f24a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"hacdias"}}