{"action":"created","comment":{"url":"https://api.github.com/repos/endpass/endpass-wallet/pulls/comments/234188938","pull_request_review_id":175779342,"id":234188938,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNDE4ODkzOA==","diff_hunk":"@@ -0,0 +1,58 @@\n+import { get } from 'lodash';\n+import Web3 from 'web3';\n+import DebounceProvider from './DebounceProvider';\n+import MockProvider from './MockProvider';\n+import providerMixin from './providerMixin';\n+\n+export default class ProviderFactory {\n+  static getProviderClass(url) {\n+    const { HttpProvider, WebsocketProvider, IpcProvider } = Web3.providers;\n+\n+    HttpProvider.prototype.sendAsync = HttpProvider.prototype.send;\n+    WebsocketProvider.prototype.sendAsync = WebsocketProvider.prototype.send;\n+    IpcProvider.prototype.sendAsync = IpcProvider.prototype.send;\n+\n+    switch (true) {\n+      case url.indexOf('http') === 0:\n+        return HttpProvider;\n+\n+      case url.indexOf('ws') === 0:\n+        return WebsocketProvider;\n+\n+      case url.indexOf('.ipc') > 0:\n+        return IpcProvider;\n+\n+      default:\n+        throw new Error('Invalid url or path parameter for the provider');\n+    }\n+  }\n+\n+  static getInstance(url) {\n+    const AdditionalProvider = window.Cypress ? MockProvider : DebounceProvider;\n+    const BaseProvider = ProviderFactory.getProviderClass(url);\n+    const Provider = providerMixin(BaseProvider, AdditionalProvider);\n+\n+    // TODO fix provider subscriptions\n+    return window.Cypress ? new Provider(url) : new BaseProvider(url);\n+  }\n+\n+  static create(url) {","path":"src/class/provider/ProviderFactory.js","position":39,"original_position":39,"commit_id":"fc9e35926b50216eba49c51c0082683fd283edda","original_commit_id":"fc9e35926b50216eba49c51c0082683fd283edda","user":{"login":"lamartire","id":13414205,"node_id":"MDQ6VXNlcjEzNDE0MjA1","avatar_url":"https://avatars0.githubusercontent.com/u/13414205?v=4","gravatar_id":"","url":"https://api.github.com/users/lamartire","html_url":"https://github.com/lamartire","followers_url":"https://api.github.com/users/lamartire/followers","following_url":"https://api.github.com/users/lamartire/following{/other_user}","gists_url":"https://api.github.com/users/lamartire/gists{/gist_id}","starred_url":"https://api.github.com/users/lamartire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamartire/subscriptions","organizations_url":"https://api.github.com/users/lamartire/orgs","repos_url":"https://api.github.com/users/lamartire/repos","events_url":"https://api.github.com/users/lamartire/events{/privacy}","received_events_url":"https://api.github.com/users/lamartire/received_events","type":"User","site_admin":false},"body":"Не нравится то, что параметр называется url, а на деле он может быть объектом и строкой.\r\nПолучается, что мы сразу поддерживаем 2 формата аргументов, в идеале было бы поддерживать один.\r\nЕсли надо чисто для http – `{ HTTP: string }`, но не строку.","created_at":"2018-11-16T12:31:55Z","updated_at":"2018-11-16T12:44:29Z","html_url":"https://github.com/endpass/endpass-wallet/pull/301#discussion_r234188938","pull_request_url":"https://api.github.com/repos/endpass/endpass-wallet/pulls/301","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/endpass/endpass-wallet/pulls/comments/234188938"},"html":{"href":"https://github.com/endpass/endpass-wallet/pull/301#discussion_r234188938"},"pull_request":{"href":"https://api.github.com/repos/endpass/endpass-wallet/pulls/301"}}},"pull_request":{"url":"https://api.github.com/repos/endpass/endpass-wallet/pulls/301","id":231264563,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxMjY0NTYz","html_url":"https://github.com/endpass/endpass-wallet/pull/301","diff_url":"https://github.com/endpass/endpass-wallet/pull/301.diff","patch_url":"https://github.com/endpass/endpass-wallet/pull/301.patch","issue_url":"https://api.github.com/repos/endpass/endpass-wallet/issues/301","number":301,"state":"open","locked":false,"title":"Add http fallback for web3 websocket provider","user":{"login":"kazurus","id":32077191,"node_id":"MDQ6VXNlcjMyMDc3MTkx","avatar_url":"https://avatars1.githubusercontent.com/u/32077191?v=4","gravatar_id":"","url":"https://api.github.com/users/kazurus","html_url":"https://github.com/kazurus","followers_url":"https://api.github.com/users/kazurus/followers","following_url":"https://api.github.com/users/kazurus/following{/other_user}","gists_url":"https://api.github.com/users/kazurus/gists{/gist_id}","starred_url":"https://api.github.com/users/kazurus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazurus/subscriptions","organizations_url":"https://api.github.com/users/kazurus/orgs","repos_url":"https://api.github.com/users/kazurus/repos","events_url":"https://api.github.com/users/kazurus/events{/privacy}","received_events_url":"https://api.github.com/users/kazurus/received_events","type":"User","site_admin":false},"body":"Add http fallback for web3 websocket provider","created_at":"2018-11-15T16:52:10Z","updated_at":"2018-11-16T12:44:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"138b4661db87027af56c18704ea1575c5250a976","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/endpass/endpass-wallet/pulls/301/commits","review_comments_url":"https://api.github.com/repos/endpass/endpass-wallet/pulls/301/comments","review_comment_url":"https://api.github.com/repos/endpass/endpass-wallet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/endpass/endpass-wallet/issues/301/comments","statuses_url":"https://api.github.com/repos/endpass/endpass-wallet/statuses/fc9e35926b50216eba49c51c0082683fd283edda","head":{"label":"kazurus:fix/websocket-connection","ref":"fix/websocket-connection","sha":"fc9e35926b50216eba49c51c0082683fd283edda","user":{"login":"kazurus","id":32077191,"node_id":"MDQ6VXNlcjMyMDc3MTkx","avatar_url":"https://avatars1.githubusercontent.com/u/32077191?v=4","gravatar_id":"","url":"https://api.github.com/users/kazurus","html_url":"https://github.com/kazurus","followers_url":"https://api.github.com/users/kazurus/followers","following_url":"https://api.github.com/users/kazurus/following{/other_user}","gists_url":"https://api.github.com/users/kazurus/gists{/gist_id}","starred_url":"https://api.github.com/users/kazurus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazurus/subscriptions","organizations_url":"https://api.github.com/users/kazurus/orgs","repos_url":"https://api.github.com/users/kazurus/repos","events_url":"https://api.github.com/users/kazurus/events{/privacy}","received_events_url":"https://api.github.com/users/kazurus/received_events","type":"User","site_admin":false},"repo":{"id":134812101,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQ4MTIxMDE=","name":"endpass-wallet","full_name":"kazurus/endpass-wallet","private":false,"owner":{"login":"kazurus","id":32077191,"node_id":"MDQ6VXNlcjMyMDc3MTkx","avatar_url":"https://avatars1.githubusercontent.com/u/32077191?v=4","gravatar_id":"","url":"https://api.github.com/users/kazurus","html_url":"https://github.com/kazurus","followers_url":"https://api.github.com/users/kazurus/followers","following_url":"https://api.github.com/users/kazurus/following{/other_user}","gists_url":"https://api.github.com/users/kazurus/gists{/gist_id}","starred_url":"https://api.github.com/users/kazurus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazurus/subscriptions","organizations_url":"https://api.github.com/users/kazurus/orgs","repos_url":"https://api.github.com/users/kazurus/repos","events_url":"https://api.github.com/users/kazurus/events{/privacy}","received_events_url":"https://api.github.com/users/kazurus/received_events","type":"User","site_admin":false},"html_url":"https://github.com/kazurus/endpass-wallet","description":"Lightweight, easy to use Ethereum wallet","fork":true,"url":"https://api.github.com/repos/kazurus/endpass-wallet","forks_url":"https://api.github.com/repos/kazurus/endpass-wallet/forks","keys_url":"https://api.github.com/repos/kazurus/endpass-wallet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kazurus/endpass-wallet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kazurus/endpass-wallet/teams","hooks_url":"https://api.github.com/repos/kazurus/endpass-wallet/hooks","issue_events_url":"https://api.github.com/repos/kazurus/endpass-wallet/issues/events{/number}","events_url":"https://api.github.com/repos/kazurus/endpass-wallet/events","assignees_url":"https://api.github.com/repos/kazurus/endpass-wallet/assignees{/user}","branches_url":"https://api.github.com/repos/kazurus/endpass-wallet/branches{/branch}","tags_url":"https://api.github.com/repos/kazurus/endpass-wallet/tags","blobs_url":"https://api.github.com/repos/kazurus/endpass-wallet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kazurus/endpass-wallet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kazurus/endpass-wallet/git/refs{/sha}","trees_url":"https://api.github.com/repos/kazurus/endpass-wallet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kazurus/endpass-wallet/statuses/{sha}","languages_url":"https://api.github.com/repos/kazurus/endpass-wallet/languages","stargazers_url":"https://api.github.com/repos/kazurus/endpass-wallet/stargazers","contributors_url":"https://api.github.com/repos/kazurus/endpass-wallet/contributors","subscribers_url":"https://api.github.com/repos/kazurus/endpass-wallet/subscribers","subscription_url":"https://api.github.com/repos/kazurus/endpass-wallet/subscription","commits_url":"https://api.github.com/repos/kazurus/endpass-wallet/commits{/sha}","git_commits_url":"https://api.github.com/repos/kazurus/endpass-wallet/git/commits{/sha}","comments_url":"https://api.github.com/repos/kazurus/endpass-wallet/comments{/number}","issue_comment_url":"https://api.github.com/repos/kazurus/endpass-wallet/issues/comments{/number}","contents_url":"https://api.github.com/repos/kazurus/endpass-wallet/contents/{+path}","compare_url":"https://api.github.com/repos/kazurus/endpass-wallet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kazurus/endpass-wallet/merges","archive_url":"https://api.github.com/repos/kazurus/endpass-wallet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kazurus/endpass-wallet/downloads","issues_url":"https://api.github.com/repos/kazurus/endpass-wallet/issues{/number}","pulls_url":"https://api.github.com/repos/kazurus/endpass-wallet/pulls{/number}","milestones_url":"https://api.github.com/repos/kazurus/endpass-wallet/milestones{/number}","notifications_url":"https://api.github.com/repos/kazurus/endpass-wallet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kazurus/endpass-wallet/labels{/name}","releases_url":"https://api.github.com/repos/kazurus/endpass-wallet/releases{/id}","deployments_url":"https://api.github.com/repos/kazurus/endpass-wallet/deployments","created_at":"2018-05-25T06:18:48Z","updated_at":"2018-11-15T12:30:42Z","pushed_at":"2018-11-16T12:18:03Z","git_url":"git://github.com/kazurus/endpass-wallet.git","ssh_url":"git@github.com:kazurus/endpass-wallet.git","clone_url":"https://github.com/kazurus/endpass-wallet.git","svn_url":"https://github.com/kazurus/endpass-wallet","homepage":null,"size":7522,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"endpass:master","ref":"master","sha":"db92d3201d1ee98f8bbdf21abd7ee734c802c7c3","user":{"login":"endpass","id":35308615,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1MzA4NjE1","avatar_url":"https://avatars3.githubusercontent.com/u/35308615?v=4","gravatar_id":"","url":"https://api.github.com/users/endpass","html_url":"https://github.com/endpass","followers_url":"https://api.github.com/users/endpass/followers","following_url":"https://api.github.com/users/endpass/following{/other_user}","gists_url":"https://api.github.com/users/endpass/gists{/gist_id}","starred_url":"https://api.github.com/users/endpass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endpass/subscriptions","organizations_url":"https://api.github.com/users/endpass/orgs","repos_url":"https://api.github.com/users/endpass/repos","events_url":"https://api.github.com/users/endpass/events{/privacy}","received_events_url":"https://api.github.com/users/endpass/received_events","type":"Organization","site_admin":false},"repo":{"id":128846976,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg4NDY5NzY=","name":"endpass-wallet","full_name":"endpass/endpass-wallet","private":false,"owner":{"login":"endpass","id":35308615,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1MzA4NjE1","avatar_url":"https://avatars3.githubusercontent.com/u/35308615?v=4","gravatar_id":"","url":"https://api.github.com/users/endpass","html_url":"https://github.com/endpass","followers_url":"https://api.github.com/users/endpass/followers","following_url":"https://api.github.com/users/endpass/following{/other_user}","gists_url":"https://api.github.com/users/endpass/gists{/gist_id}","starred_url":"https://api.github.com/users/endpass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endpass/subscriptions","organizations_url":"https://api.github.com/users/endpass/orgs","repos_url":"https://api.github.com/users/endpass/repos","events_url":"https://api.github.com/users/endpass/events{/privacy}","received_events_url":"https://api.github.com/users/endpass/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/endpass/endpass-wallet","description":"Lightweight, easy to use Ethereum wallet","fork":false,"url":"https://api.github.com/repos/endpass/endpass-wallet","forks_url":"https://api.github.com/repos/endpass/endpass-wallet/forks","keys_url":"https://api.github.com/repos/endpass/endpass-wallet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/endpass/endpass-wallet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/endpass/endpass-wallet/teams","hooks_url":"https://api.github.com/repos/endpass/endpass-wallet/hooks","issue_events_url":"https://api.github.com/repos/endpass/endpass-wallet/issues/events{/number}","events_url":"https://api.github.com/repos/endpass/endpass-wallet/events","assignees_url":"https://api.github.com/repos/endpass/endpass-wallet/assignees{/user}","branches_url":"https://api.github.com/repos/endpass/endpass-wallet/branches{/branch}","tags_url":"https://api.github.com/repos/endpass/endpass-wallet/tags","blobs_url":"https://api.github.com/repos/endpass/endpass-wallet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/endpass/endpass-wallet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/endpass/endpass-wallet/git/refs{/sha}","trees_url":"https://api.github.com/repos/endpass/endpass-wallet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/endpass/endpass-wallet/statuses/{sha}","languages_url":"https://api.github.com/repos/endpass/endpass-wallet/languages","stargazers_url":"https://api.github.com/repos/endpass/endpass-wallet/stargazers","contributors_url":"https://api.github.com/repos/endpass/endpass-wallet/contributors","subscribers_url":"https://api.github.com/repos/endpass/endpass-wallet/subscribers","subscription_url":"https://api.github.com/repos/endpass/endpass-wallet/subscription","commits_url":"https://api.github.com/repos/endpass/endpass-wallet/commits{/sha}","git_commits_url":"https://api.github.com/repos/endpass/endpass-wallet/git/commits{/sha}","comments_url":"https://api.github.com/repos/endpass/endpass-wallet/comments{/number}","issue_comment_url":"https://api.github.com/repos/endpass/endpass-wallet/issues/comments{/number}","contents_url":"https://api.github.com/repos/endpass/endpass-wallet/contents/{+path}","compare_url":"https://api.github.com/repos/endpass/endpass-wallet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/endpass/endpass-wallet/merges","archive_url":"https://api.github.com/repos/endpass/endpass-wallet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/endpass/endpass-wallet/downloads","issues_url":"https://api.github.com/repos/endpass/endpass-wallet/issues{/number}","pulls_url":"https://api.github.com/repos/endpass/endpass-wallet/pulls{/number}","milestones_url":"https://api.github.com/repos/endpass/endpass-wallet/milestones{/number}","notifications_url":"https://api.github.com/repos/endpass/endpass-wallet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/endpass/endpass-wallet/labels{/name}","releases_url":"https://api.github.com/repos/endpass/endpass-wallet/releases{/id}","deployments_url":"https://api.github.com/repos/endpass/endpass-wallet/deployments","created_at":"2018-04-09T23:50:15Z","updated_at":"2018-11-16T12:20:11Z","pushed_at":"2018-11-16T12:20:09Z","git_url":"git://github.com/endpass/endpass-wallet.git","ssh_url":"git@github.com:endpass/endpass-wallet.git","clone_url":"https://github.com/endpass/endpass-wallet.git","svn_url":"https://github.com/endpass/endpass-wallet","homepage":"https://wallet.endpass.com","size":7528,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":8,"open_issues":3,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/endpass/endpass-wallet/pulls/301"},"html":{"href":"https://github.com/endpass/endpass-wallet/pull/301"},"issue":{"href":"https://api.github.com/repos/endpass/endpass-wallet/issues/301"},"comments":{"href":"https://api.github.com/repos/endpass/endpass-wallet/issues/301/comments"},"review_comments":{"href":"https://api.github.com/repos/endpass/endpass-wallet/pulls/301/comments"},"review_comment":{"href":"https://api.github.com/repos/endpass/endpass-wallet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/endpass/endpass-wallet/pulls/301/commits"},"statuses":{"href":"https://api.github.com/repos/endpass/endpass-wallet/statuses/fc9e35926b50216eba49c51c0082683fd283edda"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"lamartire"}}