{"action":"created","comment":{"url":"https://api.github.com/repos/ethereum/browser-solidity/pulls/comments/84304829","pull_request_review_id":5090519,"id":84304829,"diff_hunk":"@@ -0,0 +1,65 @@\n+var fs = require('fs')\n+var solc = require('solc/wrapper')\n+var soljson = require('../soljson')\n+var compiler = solc(soljson)\n+\n+var inputs = readInputs()\n+var compilationResult = gatherCompilationResults(inputs)\n+replaceSolCompiler()\n+writeCompilationResult()\n+\n+function readInputs () {\n+  var request = fs.readFileSync('./test-browser/mockcompiler/requests.json', 'utf8')\n+  return JSON.parse(request)\n+}\n+\n+function gatherCompilationResults (sol) {\n+  var compilationResult = {}\n+  for (var k in sol) {\n+    var item = sol[k]\n+    var result = compile(item, 1)\n+    compilationResult[result.key] = result\n+    result = compile(item, 0)\n+    compilationResult[result.key] = result\n+  }\n+  return compilationResult\n+}\n+\n+function compile (source, optimization) {\n+  var missingInputs = []\n+  var result = compiler.compile(source, optimization, function (path) {\n+    missingInputs.push(path)\n+  })\n+  var key = optimization.toString()\n+  for (var k in source.sources) {\n+    key += k + source.sources[k]\n+  }\n+  return {\n+    key: key.trim(),\n+    source: source,\n+    optimization: optimization,\n+    missingInputs: missingInputs,\n+    result: result\n+  }\n+}\n+\n+function replaceSolCompiler () {\n+  fs.readFile('./test-browser/mockcompiler/compiler.js', 'utf8', function (error, data) {","path":"ci/makeMockCompiler.js","position":47,"original_position":47,"commit_id":"d8f5176013668932f36fc14a1633429c6d1fb0aa","original_commit_id":"d8f5176013668932f36fc14a1633429c6d1fb0aa","user":{"login":"chriseth","id":9073706,"avatar_url":"https://avatars.githubusercontent.com/u/9073706?v=3","gravatar_id":"","url":"https://api.github.com/users/chriseth","html_url":"https://github.com/chriseth","followers_url":"https://api.github.com/users/chriseth/followers","following_url":"https://api.github.com/users/chriseth/following{/other_user}","gists_url":"https://api.github.com/users/chriseth/gists{/gist_id}","starred_url":"https://api.github.com/users/chriseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriseth/subscriptions","organizations_url":"https://api.github.com/users/chriseth/orgs","repos_url":"https://api.github.com/users/chriseth/repos","events_url":"https://api.github.com/users/chriseth/events{/privacy}","received_events_url":"https://api.github.com/users/chriseth/received_events","type":"User","site_admin":false},"body":"You could also include the compiler as a literal string here and combine it with the compilation results, i.e. write everything directly into soljson.js.","created_at":"2016-10-20T15:10:10Z","updated_at":"2016-10-20T15:11:20Z","html_url":"https://github.com/ethereum/browser-solidity/pull/273#discussion_r84304829","pull_request_url":"https://api.github.com/repos/ethereum/browser-solidity/pulls/273","_links":{"self":{"href":"https://api.github.com/repos/ethereum/browser-solidity/pulls/comments/84304829"},"html":{"href":"https://github.com/ethereum/browser-solidity/pull/273#discussion_r84304829"},"pull_request":{"href":"https://api.github.com/repos/ethereum/browser-solidity/pulls/273"}}},"pull_request":{"url":"https://api.github.com/repos/ethereum/browser-solidity/pulls/273","id":90210370,"html_url":"https://github.com/ethereum/browser-solidity/pull/273","diff_url":"https://github.com/ethereum/browser-solidity/pull/273.diff","patch_url":"https://github.com/ethereum/browser-solidity/pull/273.patch","issue_url":"https://api.github.com/repos/ethereum/browser-solidity/issues/273","number":273,"state":"open","locked":false,"title":"use mock compiler during browser tests","user":{"login":"yann300","id":6940742,"avatar_url":"https://avatars.githubusercontent.com/u/6940742?v=3","gravatar_id":"","url":"https://api.github.com/users/yann300","html_url":"https://github.com/yann300","followers_url":"https://api.github.com/users/yann300/followers","following_url":"https://api.github.com/users/yann300/following{/other_user}","gists_url":"https://api.github.com/users/yann300/gists{/gist_id}","starred_url":"https://api.github.com/users/yann300/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yann300/subscriptions","organizations_url":"https://api.github.com/users/yann300/orgs","repos_url":"https://api.github.com/users/yann300/repos","events_url":"https://api.github.com/users/yann300/events{/privacy}","received_events_url":"https://api.github.com/users/yann300/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-20T14:20:35Z","updated_at":"2016-10-20T15:18:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88c2d49fd80c939326f480fa89a3127bd2ece08b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ethereum/browser-solidity/pulls/273/commits","review_comments_url":"https://api.github.com/repos/ethereum/browser-solidity/pulls/273/comments","review_comment_url":"https://api.github.com/repos/ethereum/browser-solidity/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ethereum/browser-solidity/issues/273/comments","statuses_url":"https://api.github.com/repos/ethereum/browser-solidity/statuses/d8f5176013668932f36fc14a1633429c6d1fb0aa","head":{"label":"ethereum:fixBrowserTests","ref":"fixBrowserTests","sha":"d8f5176013668932f36fc14a1633429c6d1fb0aa","user":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","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":59065830,"name":"browser-solidity","full_name":"ethereum/browser-solidity","owner":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","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/browser-solidity","description":"Browser-Only Solidity IDE and Runtime Environment","fork":false,"url":"https://api.github.com/repos/ethereum/browser-solidity","forks_url":"https://api.github.com/repos/ethereum/browser-solidity/forks","keys_url":"https://api.github.com/repos/ethereum/browser-solidity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethereum/browser-solidity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethereum/browser-solidity/teams","hooks_url":"https://api.github.com/repos/ethereum/browser-solidity/hooks","issue_events_url":"https://api.github.com/repos/ethereum/browser-solidity/issues/events{/number}","events_url":"https://api.github.com/repos/ethereum/browser-solidity/events","assignees_url":"https://api.github.com/repos/ethereum/browser-solidity/assignees{/user}","branches_url":"https://api.github.com/repos/ethereum/browser-solidity/branches{/branch}","tags_url":"https://api.github.com/repos/ethereum/browser-solidity/tags","blobs_url":"https://api.github.com/repos/ethereum/browser-solidity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethereum/browser-solidity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethereum/browser-solidity/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethereum/browser-solidity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethereum/browser-solidity/statuses/{sha}","languages_url":"https://api.github.com/repos/ethereum/browser-solidity/languages","stargazers_url":"https://api.github.com/repos/ethereum/browser-solidity/stargazers","contributors_url":"https://api.github.com/repos/ethereum/browser-solidity/contributors","subscribers_url":"https://api.github.com/repos/ethereum/browser-solidity/subscribers","subscription_url":"https://api.github.com/repos/ethereum/browser-solidity/subscription","commits_url":"https://api.github.com/repos/ethereum/browser-solidity/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethereum/browser-solidity/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethereum/browser-solidity/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethereum/browser-solidity/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethereum/browser-solidity/contents/{+path}","compare_url":"https://api.github.com/repos/ethereum/browser-solidity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethereum/browser-solidity/merges","archive_url":"https://api.github.com/repos/ethereum/browser-solidity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethereum/browser-solidity/downloads","issues_url":"https://api.github.com/repos/ethereum/browser-solidity/issues{/number}","pulls_url":"https://api.github.com/repos/ethereum/browser-solidity/pulls{/number}","milestones_url":"https://api.github.com/repos/ethereum/browser-solidity/milestones{/number}","notifications_url":"https://api.github.com/repos/ethereum/browser-solidity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethereum/browser-solidity/labels{/name}","releases_url":"https://api.github.com/repos/ethereum/browser-solidity/releases{/id}","deployments_url":"https://api.github.com/repos/ethereum/browser-solidity/deployments","created_at":"2016-05-17T23:17:34Z","updated_at":"2016-10-20T10:08:41Z","pushed_at":"2016-10-20T14:20:35Z","git_url":"git://github.com/ethereum/browser-solidity.git","ssh_url":"git@github.com:ethereum/browser-solidity.git","clone_url":"https://github.com/ethereum/browser-solidity.git","svn_url":"https://github.com/ethereum/browser-solidity","homepage":null,"size":8140,"stargazers_count":61,"watchers_count":61,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":42,"mirror_url":null,"open_issues_count":65,"forks":42,"open_issues":65,"watchers":61,"default_branch":"master"}},"base":{"label":"ethereum:master","ref":"master","sha":"73a5582a6467b0b364cc0f05b136cd41fc0e6b9d","user":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","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":59065830,"name":"browser-solidity","full_name":"ethereum/browser-solidity","owner":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","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/browser-solidity","description":"Browser-Only Solidity IDE and Runtime Environment","fork":false,"url":"https://api.github.com/repos/ethereum/browser-solidity","forks_url":"https://api.github.com/repos/ethereum/browser-solidity/forks","keys_url":"https://api.github.com/repos/ethereum/browser-solidity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethereum/browser-solidity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethereum/browser-solidity/teams","hooks_url":"https://api.github.com/repos/ethereum/browser-solidity/hooks","issue_events_url":"https://api.github.com/repos/ethereum/browser-solidity/issues/events{/number}","events_url":"https://api.github.com/repos/ethereum/browser-solidity/events","assignees_url":"https://api.github.com/repos/ethereum/browser-solidity/assignees{/user}","branches_url":"https://api.github.com/repos/ethereum/browser-solidity/branches{/branch}","tags_url":"https://api.github.com/repos/ethereum/browser-solidity/tags","blobs_url":"https://api.github.com/repos/ethereum/browser-solidity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethereum/browser-solidity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethereum/browser-solidity/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethereum/browser-solidity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethereum/browser-solidity/statuses/{sha}","languages_url":"https://api.github.com/repos/ethereum/browser-solidity/languages","stargazers_url":"https://api.github.com/repos/ethereum/browser-solidity/stargazers","contributors_url":"https://api.github.com/repos/ethereum/browser-solidity/contributors","subscribers_url":"https://api.github.com/repos/ethereum/browser-solidity/subscribers","subscription_url":"https://api.github.com/repos/ethereum/browser-solidity/subscription","commits_url":"https://api.github.com/repos/ethereum/browser-solidity/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethereum/browser-solidity/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethereum/browser-solidity/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethereum/browser-solidity/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethereum/browser-solidity/contents/{+path}","compare_url":"https://api.github.com/repos/ethereum/browser-solidity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethereum/browser-solidity/merges","archive_url":"https://api.github.com/repos/ethereum/browser-solidity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethereum/browser-solidity/downloads","issues_url":"https://api.github.com/repos/ethereum/browser-solidity/issues{/number}","pulls_url":"https://api.github.com/repos/ethereum/browser-solidity/pulls{/number}","milestones_url":"https://api.github.com/repos/ethereum/browser-solidity/milestones{/number}","notifications_url":"https://api.github.com/repos/ethereum/browser-solidity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethereum/browser-solidity/labels{/name}","releases_url":"https://api.github.com/repos/ethereum/browser-solidity/releases{/id}","deployments_url":"https://api.github.com/repos/ethereum/browser-solidity/deployments","created_at":"2016-05-17T23:17:34Z","updated_at":"2016-10-20T10:08:41Z","pushed_at":"2016-10-20T14:20:35Z","git_url":"git://github.com/ethereum/browser-solidity.git","ssh_url":"git@github.com:ethereum/browser-solidity.git","clone_url":"https://github.com/ethereum/browser-solidity.git","svn_url":"https://github.com/ethereum/browser-solidity","homepage":null,"size":8140,"stargazers_count":61,"watchers_count":61,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":42,"mirror_url":null,"open_issues_count":65,"forks":42,"open_issues":65,"watchers":61,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ethereum/browser-solidity/pulls/273"},"html":{"href":"https://github.com/ethereum/browser-solidity/pull/273"},"issue":{"href":"https://api.github.com/repos/ethereum/browser-solidity/issues/273"},"comments":{"href":"https://api.github.com/repos/ethereum/browser-solidity/issues/273/comments"},"review_comments":{"href":"https://api.github.com/repos/ethereum/browser-solidity/pulls/273/comments"},"review_comment":{"href":"https://api.github.com/repos/ethereum/browser-solidity/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ethereum/browser-solidity/pulls/273/commits"},"statuses":{"href":"https://api.github.com/repos/ethereum/browser-solidity/statuses/d8f5176013668932f36fc14a1633429c6d1fb0aa"}}}}
{"actor":{"display_login":"chriseth"}}