{"action":"created","comment":{"url":"https://api.github.com/repos/google/certificate-transparency/pulls/comments/73486068","id":73486068,"diff_hunk":"@@ -214,3 +223,34 @@ func TestAddJSON(t *testing.T) {\n \t\t}\n \t}\n }\n+\n+func TestGetSTHConsistency(t *testing.T) {\n+\ths := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n+\t\t_, err := w.Write([]byte(`{ \"consistency\": [ \"IqlrapPQKtmCY1jCr8+lpCtscRyjjZAA7nyadtFPRFQ=\", \"ytf6K2GnSRZ3Au+YkivCb7N1DygfKyZmE4aEs9OXl\\/8=\" ] }`))\n+\t\tif err != nil {\n+\t\t\treturn\n+\t\t}\n+\t}))\n+\tdefer hs.Close()\n+\n+\tc := New(hs.URL, &http.Client{})\n+\n+\ttests := []struct {\n+\t\tfirst  uint64\n+\t\tsecond uint64\n+\t\tproof  [][]byte\n+\t}{\n+\t\t{1, 3, [][]byte{b64(\"IqlrapPQKtmCY1jCr8+lpCtscRyjjZAA7nyadtFPRFQ=\"),\n+\t\t\tb64(\"ytf6K2GnSRZ3Au+YkivCb7N1DygfKyZmE4aEs9OXl/8=\")}},\n+\t}\n+\n+\tfor _, tc := range tests {\n+\t\tproof, err := c.GetSTHConsistency(tc.first, tc.second)\n+\t\tif err != nil {\n+\t\t\tt.Fatalf(\"Failed to get consistency proof: %v\", err)\n+\t\t}\n+\t\tif !reflect.DeepEqual(proof, tc.proof) {\n+\t\t\tt.Errorf(\"GetSTHConsistency(): got\\n%v, want\\n%v\", proof, tc.proof)","path":"go/client/logclient_test.go","position":54,"original_position":54,"commit_id":"4761973303a4cbdd32b855b04dafc0b5436e3ae4","original_commit_id":"4761973303a4cbdd32b855b04dafc0b5436e3ae4","user":{"login":"phad","id":874173,"avatar_url":"https://avatars.githubusercontent.com/u/874173?v=3","gravatar_id":"","url":"https://api.github.com/users/phad","html_url":"https://github.com/phad","followers_url":"https://api.github.com/users/phad/followers","following_url":"https://api.github.com/users/phad/following{/other_user}","gists_url":"https://api.github.com/users/phad/gists{/gist_id}","starred_url":"https://api.github.com/users/phad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phad/subscriptions","organizations_url":"https://api.github.com/users/phad/orgs","repos_url":"https://api.github.com/users/phad/repos","events_url":"https://api.github.com/users/phad/events{/privacy}","received_events_url":"https://api.github.com/users/phad/received_events","type":"User","site_admin":false},"body":"I was advised in one of my reviews to reproduce the input in the error message to make the test failure messages more useful when writing tabulated tests.\r\n\r\nt.Errorf(\"GetSTHConsistency(%d, %d): ..... \", tc.first, tc.second, ....)","created_at":"2016-08-04T08:58:07Z","updated_at":"2016-08-04T08:58:07Z","html_url":"https://github.com/google/certificate-transparency/pull/1285#discussion_r73486068","pull_request_url":"https://api.github.com/repos/google/certificate-transparency/pulls/1285","_links":{"self":{"href":"https://api.github.com/repos/google/certificate-transparency/pulls/comments/73486068"},"html":{"href":"https://github.com/google/certificate-transparency/pull/1285#discussion_r73486068"},"pull_request":{"href":"https://api.github.com/repos/google/certificate-transparency/pulls/1285"}}},"pull_request":{"url":"https://api.github.com/repos/google/certificate-transparency/pulls/1285","id":79978347,"html_url":"https://github.com/google/certificate-transparency/pull/1285","diff_url":"https://github.com/google/certificate-transparency/pull/1285.diff","patch_url":"https://github.com/google/certificate-transparency/pull/1285.patch","issue_url":"https://api.github.com/repos/google/certificate-transparency/issues/1285","number":1285,"state":"open","locked":false,"title":"[Go] Add GetSTHConsistency","user":{"login":"gdbelvin","id":198478,"avatar_url":"https://avatars.githubusercontent.com/u/198478?v=3","gravatar_id":"","url":"https://api.github.com/users/gdbelvin","html_url":"https://github.com/gdbelvin","followers_url":"https://api.github.com/users/gdbelvin/followers","following_url":"https://api.github.com/users/gdbelvin/following{/other_user}","gists_url":"https://api.github.com/users/gdbelvin/gists{/gist_id}","starred_url":"https://api.github.com/users/gdbelvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdbelvin/subscriptions","organizations_url":"https://api.github.com/users/gdbelvin/orgs","repos_url":"https://api.github.com/users/gdbelvin/repos","events_url":"https://api.github.com/users/gdbelvin/events{/privacy}","received_events_url":"https://api.github.com/users/gdbelvin/received_events","type":"User","site_admin":false},"body":"Adds GetSTHConsistency to Go client. ","created_at":"2016-08-03T21:01:44Z","updated_at":"2016-08-04T08:58:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc7772bc0553a3a7a4d264046a38608a402663d5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/certificate-transparency/pulls/1285/commits","review_comments_url":"https://api.github.com/repos/google/certificate-transparency/pulls/1285/comments","review_comment_url":"https://api.github.com/repos/google/certificate-transparency/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/certificate-transparency/issues/1285/comments","statuses_url":"https://api.github.com/repos/google/certificate-transparency/statuses/4761973303a4cbdd32b855b04dafc0b5436e3ae4","head":{"label":"gdbelvin:consistency","ref":"consistency","sha":"4761973303a4cbdd32b855b04dafc0b5436e3ae4","user":{"login":"gdbelvin","id":198478,"avatar_url":"https://avatars.githubusercontent.com/u/198478?v=3","gravatar_id":"","url":"https://api.github.com/users/gdbelvin","html_url":"https://github.com/gdbelvin","followers_url":"https://api.github.com/users/gdbelvin/followers","following_url":"https://api.github.com/users/gdbelvin/following{/other_user}","gists_url":"https://api.github.com/users/gdbelvin/gists{/gist_id}","starred_url":"https://api.github.com/users/gdbelvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdbelvin/subscriptions","organizations_url":"https://api.github.com/users/gdbelvin/orgs","repos_url":"https://api.github.com/users/gdbelvin/repos","events_url":"https://api.github.com/users/gdbelvin/events{/privacy}","received_events_url":"https://api.github.com/users/gdbelvin/received_events","type":"User","site_admin":false},"repo":{"id":59695503,"name":"certificate-transparency","full_name":"gdbelvin/certificate-transparency","owner":{"login":"gdbelvin","id":198478,"avatar_url":"https://avatars.githubusercontent.com/u/198478?v=3","gravatar_id":"","url":"https://api.github.com/users/gdbelvin","html_url":"https://github.com/gdbelvin","followers_url":"https://api.github.com/users/gdbelvin/followers","following_url":"https://api.github.com/users/gdbelvin/following{/other_user}","gists_url":"https://api.github.com/users/gdbelvin/gists{/gist_id}","starred_url":"https://api.github.com/users/gdbelvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdbelvin/subscriptions","organizations_url":"https://api.github.com/users/gdbelvin/orgs","repos_url":"https://api.github.com/users/gdbelvin/repos","events_url":"https://api.github.com/users/gdbelvin/events{/privacy}","received_events_url":"https://api.github.com/users/gdbelvin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gdbelvin/certificate-transparency","description":"Auditing for TLS certificates.","fork":true,"url":"https://api.github.com/repos/gdbelvin/certificate-transparency","forks_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/forks","keys_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/teams","hooks_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/hooks","issue_events_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/issues/events{/number}","events_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/events","assignees_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/assignees{/user}","branches_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/branches{/branch}","tags_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/tags","blobs_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/git/refs{/sha}","trees_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/statuses/{sha}","languages_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/languages","stargazers_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/stargazers","contributors_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/contributors","subscribers_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/subscribers","subscription_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/subscription","commits_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/commits{/sha}","git_commits_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/git/commits{/sha}","comments_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/comments{/number}","issue_comment_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/issues/comments{/number}","contents_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/contents/{+path}","compare_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/merges","archive_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/downloads","issues_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/issues{/number}","pulls_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/pulls{/number}","milestones_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/milestones{/number}","notifications_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/labels{/name}","releases_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/releases{/id}","deployments_url":"https://api.github.com/repos/gdbelvin/certificate-transparency/deployments","created_at":"2016-05-25T20:30:49Z","updated_at":"2016-05-25T20:30:51Z","pushed_at":"2016-08-04T01:50:54Z","git_url":"git://github.com/gdbelvin/certificate-transparency.git","ssh_url":"git@github.com:gdbelvin/certificate-transparency.git","clone_url":"https://github.com/gdbelvin/certificate-transparency.git","svn_url":"https://github.com/gdbelvin/certificate-transparency","homepage":"http://www.certificate-transparency.org/","size":27084,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"af9459f7ce47367f4807d957fff37b2d5ae9c4a5","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":19989605,"name":"certificate-transparency","full_name":"google/certificate-transparency","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/certificate-transparency","description":"Auditing for TLS certificates.","fork":false,"url":"https://api.github.com/repos/google/certificate-transparency","forks_url":"https://api.github.com/repos/google/certificate-transparency/forks","keys_url":"https://api.github.com/repos/google/certificate-transparency/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/certificate-transparency/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/certificate-transparency/teams","hooks_url":"https://api.github.com/repos/google/certificate-transparency/hooks","issue_events_url":"https://api.github.com/repos/google/certificate-transparency/issues/events{/number}","events_url":"https://api.github.com/repos/google/certificate-transparency/events","assignees_url":"https://api.github.com/repos/google/certificate-transparency/assignees{/user}","branches_url":"https://api.github.com/repos/google/certificate-transparency/branches{/branch}","tags_url":"https://api.github.com/repos/google/certificate-transparency/tags","blobs_url":"https://api.github.com/repos/google/certificate-transparency/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/certificate-transparency/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/certificate-transparency/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/certificate-transparency/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/certificate-transparency/statuses/{sha}","languages_url":"https://api.github.com/repos/google/certificate-transparency/languages","stargazers_url":"https://api.github.com/repos/google/certificate-transparency/stargazers","contributors_url":"https://api.github.com/repos/google/certificate-transparency/contributors","subscribers_url":"https://api.github.com/repos/google/certificate-transparency/subscribers","subscription_url":"https://api.github.com/repos/google/certificate-transparency/subscription","commits_url":"https://api.github.com/repos/google/certificate-transparency/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/certificate-transparency/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/certificate-transparency/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/certificate-transparency/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/certificate-transparency/contents/{+path}","compare_url":"https://api.github.com/repos/google/certificate-transparency/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/certificate-transparency/merges","archive_url":"https://api.github.com/repos/google/certificate-transparency/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/certificate-transparency/downloads","issues_url":"https://api.github.com/repos/google/certificate-transparency/issues{/number}","pulls_url":"https://api.github.com/repos/google/certificate-transparency/pulls{/number}","milestones_url":"https://api.github.com/repos/google/certificate-transparency/milestones{/number}","notifications_url":"https://api.github.com/repos/google/certificate-transparency/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/certificate-transparency/labels{/name}","releases_url":"https://api.github.com/repos/google/certificate-transparency/releases{/id}","deployments_url":"https://api.github.com/repos/google/certificate-transparency/deployments","created_at":"2014-05-20T17:03:47Z","updated_at":"2016-07-31T14:52:35Z","pushed_at":"2016-08-04T01:50:55Z","git_url":"git://github.com/google/certificate-transparency.git","ssh_url":"git@github.com:google/certificate-transparency.git","clone_url":"https://github.com/google/certificate-transparency.git","svn_url":"https://github.com/google/certificate-transparency","homepage":"http://www.certificate-transparency.org/","size":29282,"stargazers_count":277,"watchers_count":277,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":106,"mirror_url":null,"open_issues_count":97,"forks":106,"open_issues":97,"watchers":277,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/certificate-transparency/pulls/1285"},"html":{"href":"https://github.com/google/certificate-transparency/pull/1285"},"issue":{"href":"https://api.github.com/repos/google/certificate-transparency/issues/1285"},"comments":{"href":"https://api.github.com/repos/google/certificate-transparency/issues/1285/comments"},"review_comments":{"href":"https://api.github.com/repos/google/certificate-transparency/pulls/1285/comments"},"review_comment":{"href":"https://api.github.com/repos/google/certificate-transparency/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/certificate-transparency/pulls/1285/commits"},"statuses":{"href":"https://api.github.com/repos/google/certificate-transparency/statuses/4761973303a4cbdd32b855b04dafc0b5436e3ae4"}}}}
{"actor":{"display_login":"phad"}}