{"action":"created","comment":{"url":"https://api.github.com/repos/stellar/go/pulls/comments/224250192","pull_request_review_id":163572263,"id":224250192,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDI1MDE5Mg==","diff_hunk":"@@ -55,8 +54,8 @@ func (q *Q) TradesForAssetPair(baseAssetId int64, counterAssetId int64) *TradesQ\n }\n \n // ForOffer filters the query results by the offer id.\n-func (q *TradesQ) ForOffer(id int64) *TradesQ {\n-\tq.sql = q.sql.Where(\"htrd.offer_id = ?\", id)\n+func (q *TradesQ) ForOffer(id string) *TradesQ {\n+\tq.sql = q.sql.Where(\"(htrd.base_offer_id = ? OR htrd.counter_offer_id = ?)\", id, id)","path":"services/horizon/internal/db2/history/trade.go","position":22,"original_position":22,"commit_id":"a919d1fa9984c886a9c2c561d05c340beb140aa0","original_commit_id":"a919d1fa9984c886a9c2c561d05c340beb140aa0","user":{"login":"tomerweller","id":815704,"node_id":"MDQ6VXNlcjgxNTcwNA==","avatar_url":"https://avatars2.githubusercontent.com/u/815704?v=4","gravatar_id":"","url":"https://api.github.com/users/tomerweller","html_url":"https://github.com/tomerweller","followers_url":"https://api.github.com/users/tomerweller/followers","following_url":"https://api.github.com/users/tomerweller/following{/other_user}","gists_url":"https://api.github.com/users/tomerweller/gists{/gist_id}","starred_url":"https://api.github.com/users/tomerweller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomerweller/subscriptions","organizations_url":"https://api.github.com/users/tomerweller/orgs","repos_url":"https://api.github.com/users/tomerweller/repos","events_url":"https://api.github.com/users/tomerweller/events{/privacy}","received_events_url":"https://api.github.com/users/tomerweller/received_events","type":"User","site_admin":false},"body":"good catch","created_at":"2018-10-10T21:36:10Z","updated_at":"2018-10-10T21:36:10Z","html_url":"https://github.com/stellar/go/pull/667#discussion_r224250192","pull_request_url":"https://api.github.com/repos/stellar/go/pulls/667","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/stellar/go/pulls/comments/224250192"},"html":{"href":"https://github.com/stellar/go/pull/667#discussion_r224250192"},"pull_request":{"href":"https://api.github.com/repos/stellar/go/pulls/667"}},"in_reply_to_id":224101761},"pull_request":{"url":"https://api.github.com/repos/stellar/go/pulls/667","id":216091033,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2MDkxMDMz","html_url":"https://github.com/stellar/go/pull/667","diff_url":"https://github.com/stellar/go/pull/667.diff","patch_url":"https://github.com/stellar/go/pull/667.patch","issue_url":"https://api.github.com/repos/stellar/go/issues/667","number":667,"state":"open","locked":false,"title":"trade offer ids","user":{"login":"tomerweller","id":815704,"node_id":"MDQ6VXNlcjgxNTcwNA==","avatar_url":"https://avatars2.githubusercontent.com/u/815704?v=4","gravatar_id":"","url":"https://api.github.com/users/tomerweller","html_url":"https://github.com/tomerweller","followers_url":"https://api.github.com/users/tomerweller/followers","following_url":"https://api.github.com/users/tomerweller/following{/other_user}","gists_url":"https://api.github.com/users/tomerweller/gists{/gist_id}","starred_url":"https://api.github.com/users/tomerweller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomerweller/subscriptions","organizations_url":"https://api.github.com/users/tomerweller/orgs","repos_url":"https://api.github.com/users/tomerweller/repos","events_url":"https://api.github.com/users/tomerweller/events{/privacy}","received_events_url":"https://api.github.com/users/tomerweller/received_events","type":"User","site_admin":false},"body":"(DO NOT MERGE. For sanity, I will include the rebuilt test scenarios after discussion has ended) \r\n\r\nadds `base_offer_id` and `counter_offer_id` to trades. This should allow easier audit trails for offers and trades. When offer ids are not created in the protocol level (fully consumed offers and path payments) a synthetic offer id will be created in the form of `O{op_id}` where `{op_id}` is the operation that created the offer.\r\n\r\n- [x] trades table\r\n- [x] trade ingestion\r\n- [x] modify trade resources and protocol\r\n- [x] modify `trades for offer` endpoint to query both offer ids\r\n- [x] documentation and changelog\r\n\r\n\r\ncloses #527 ","created_at":"2018-09-17T19:36:29Z","updated_at":"2018-10-10T21:36:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":709066444,"node_id":"MDU6TGFiZWw3MDkwNjY0NDQ=","url":"https://api.github.com/repos/stellar/go/labels/horizon","name":"horizon","color":"1d76db","default":false}],"milestone":{"url":"https://api.github.com/repos/stellar/go/milestones/4","html_url":"https://github.com/stellar/go/milestone/4","labels_url":"https://api.github.com/repos/stellar/go/milestones/4/labels","id":3621614,"node_id":"MDk6TWlsZXN0b25lMzYyMTYxNA==","number":4,"title":"Horizon v0.15.0","description":"","creator":{"login":"bartekn","id":464938,"node_id":"MDQ6VXNlcjQ2NDkzOA==","avatar_url":"https://avatars1.githubusercontent.com/u/464938?v=4","gravatar_id":"","url":"https://api.github.com/users/bartekn","html_url":"https://github.com/bartekn","followers_url":"https://api.github.com/users/bartekn/followers","following_url":"https://api.github.com/users/bartekn/following{/other_user}","gists_url":"https://api.github.com/users/bartekn/gists{/gist_id}","starred_url":"https://api.github.com/users/bartekn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartekn/subscriptions","organizations_url":"https://api.github.com/users/bartekn/orgs","repos_url":"https://api.github.com/users/bartekn/repos","events_url":"https://api.github.com/users/bartekn/events{/privacy}","received_events_url":"https://api.github.com/users/bartekn/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":7,"state":"open","created_at":"2018-09-04T16:51:45Z","updated_at":"2018-10-08T12:43:22Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/stellar/go/pulls/667/commits","review_comments_url":"https://api.github.com/repos/stellar/go/pulls/667/comments","review_comment_url":"https://api.github.com/repos/stellar/go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stellar/go/issues/667/comments","statuses_url":"https://api.github.com/repos/stellar/go/statuses/a919d1fa9984c886a9c2c561d05c340beb140aa0","head":{"label":"tomerweller:trade_offer_ids","ref":"trade_offer_ids","sha":"a919d1fa9984c886a9c2c561d05c340beb140aa0","user":{"login":"tomerweller","id":815704,"node_id":"MDQ6VXNlcjgxNTcwNA==","avatar_url":"https://avatars2.githubusercontent.com/u/815704?v=4","gravatar_id":"","url":"https://api.github.com/users/tomerweller","html_url":"https://github.com/tomerweller","followers_url":"https://api.github.com/users/tomerweller/followers","following_url":"https://api.github.com/users/tomerweller/following{/other_user}","gists_url":"https://api.github.com/users/tomerweller/gists{/gist_id}","starred_url":"https://api.github.com/users/tomerweller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomerweller/subscriptions","organizations_url":"https://api.github.com/users/tomerweller/orgs","repos_url":"https://api.github.com/users/tomerweller/repos","events_url":"https://api.github.com/users/tomerweller/events{/privacy}","received_events_url":"https://api.github.com/users/tomerweller/received_events","type":"User","site_admin":false},"repo":{"id":110902867,"node_id":"MDEwOlJlcG9zaXRvcnkxMTA5MDI4Njc=","name":"go","full_name":"tomerweller/go","private":false,"owner":{"login":"tomerweller","id":815704,"node_id":"MDQ6VXNlcjgxNTcwNA==","avatar_url":"https://avatars2.githubusercontent.com/u/815704?v=4","gravatar_id":"","url":"https://api.github.com/users/tomerweller","html_url":"https://github.com/tomerweller","followers_url":"https://api.github.com/users/tomerweller/followers","following_url":"https://api.github.com/users/tomerweller/following{/other_user}","gists_url":"https://api.github.com/users/tomerweller/gists{/gist_id}","starred_url":"https://api.github.com/users/tomerweller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomerweller/subscriptions","organizations_url":"https://api.github.com/users/tomerweller/orgs","repos_url":"https://api.github.com/users/tomerweller/repos","events_url":"https://api.github.com/users/tomerweller/events{/privacy}","received_events_url":"https://api.github.com/users/tomerweller/received_events","type":"User","site_admin":false},"html_url":"https://github.com/tomerweller/go","description":"Stellar's public monorepo of go code","fork":true,"url":"https://api.github.com/repos/tomerweller/go","forks_url":"https://api.github.com/repos/tomerweller/go/forks","keys_url":"https://api.github.com/repos/tomerweller/go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tomerweller/go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tomerweller/go/teams","hooks_url":"https://api.github.com/repos/tomerweller/go/hooks","issue_events_url":"https://api.github.com/repos/tomerweller/go/issues/events{/number}","events_url":"https://api.github.com/repos/tomerweller/go/events","assignees_url":"https://api.github.com/repos/tomerweller/go/assignees{/user}","branches_url":"https://api.github.com/repos/tomerweller/go/branches{/branch}","tags_url":"https://api.github.com/repos/tomerweller/go/tags","blobs_url":"https://api.github.com/repos/tomerweller/go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tomerweller/go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tomerweller/go/git/refs{/sha}","trees_url":"https://api.github.com/repos/tomerweller/go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tomerweller/go/statuses/{sha}","languages_url":"https://api.github.com/repos/tomerweller/go/languages","stargazers_url":"https://api.github.com/repos/tomerweller/go/stargazers","contributors_url":"https://api.github.com/repos/tomerweller/go/contributors","subscribers_url":"https://api.github.com/repos/tomerweller/go/subscribers","subscription_url":"https://api.github.com/repos/tomerweller/go/subscription","commits_url":"https://api.github.com/repos/tomerweller/go/commits{/sha}","git_commits_url":"https://api.github.com/repos/tomerweller/go/git/commits{/sha}","comments_url":"https://api.github.com/repos/tomerweller/go/comments{/number}","issue_comment_url":"https://api.github.com/repos/tomerweller/go/issues/comments{/number}","contents_url":"https://api.github.com/repos/tomerweller/go/contents/{+path}","compare_url":"https://api.github.com/repos/tomerweller/go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tomerweller/go/merges","archive_url":"https://api.github.com/repos/tomerweller/go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tomerweller/go/downloads","issues_url":"https://api.github.com/repos/tomerweller/go/issues{/number}","pulls_url":"https://api.github.com/repos/tomerweller/go/pulls{/number}","milestones_url":"https://api.github.com/repos/tomerweller/go/milestones{/number}","notifications_url":"https://api.github.com/repos/tomerweller/go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tomerweller/go/labels{/name}","releases_url":"https://api.github.com/repos/tomerweller/go/releases{/id}","deployments_url":"https://api.github.com/repos/tomerweller/go/deployments","created_at":"2017-11-16T00:31:23Z","updated_at":"2018-09-12T00:30:42Z","pushed_at":"2018-10-04T01:13:31Z","git_url":"git://github.com/tomerweller/go.git","ssh_url":"git@github.com:tomerweller/go.git","clone_url":"https://github.com/tomerweller/go.git","svn_url":"https://github.com/tomerweller/go","homepage":"https://stellar.org/developers","size":16740,"stargazers_count":0,"watchers_count":0,"language":"SQLPL","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":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"stellar:horizon-0.15.0","ref":"horizon-0.15.0","sha":"9c22c839724ea96875a5ac836430aa7eed526ce7","user":{"login":"stellar","id":7386716,"node_id":"MDEyOk9yZ2FuaXphdGlvbjczODY3MTY=","avatar_url":"https://avatars3.githubusercontent.com/u/7386716?v=4","gravatar_id":"","url":"https://api.github.com/users/stellar","html_url":"https://github.com/stellar","followers_url":"https://api.github.com/users/stellar/followers","following_url":"https://api.github.com/users/stellar/following{/other_user}","gists_url":"https://api.github.com/users/stellar/gists{/gist_id}","starred_url":"https://api.github.com/users/stellar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stellar/subscriptions","organizations_url":"https://api.github.com/users/stellar/orgs","repos_url":"https://api.github.com/users/stellar/repos","events_url":"https://api.github.com/users/stellar/events{/privacy}","received_events_url":"https://api.github.com/users/stellar/received_events","type":"Organization","site_admin":false},"repo":{"id":64954128,"node_id":"MDEwOlJlcG9zaXRvcnk2NDk1NDEyOA==","name":"go","full_name":"stellar/go","private":false,"owner":{"login":"stellar","id":7386716,"node_id":"MDEyOk9yZ2FuaXphdGlvbjczODY3MTY=","avatar_url":"https://avatars3.githubusercontent.com/u/7386716?v=4","gravatar_id":"","url":"https://api.github.com/users/stellar","html_url":"https://github.com/stellar","followers_url":"https://api.github.com/users/stellar/followers","following_url":"https://api.github.com/users/stellar/following{/other_user}","gists_url":"https://api.github.com/users/stellar/gists{/gist_id}","starred_url":"https://api.github.com/users/stellar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stellar/subscriptions","organizations_url":"https://api.github.com/users/stellar/orgs","repos_url":"https://api.github.com/users/stellar/repos","events_url":"https://api.github.com/users/stellar/events{/privacy}","received_events_url":"https://api.github.com/users/stellar/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/stellar/go","description":"Stellar's public monorepo of go code","fork":false,"url":"https://api.github.com/repos/stellar/go","forks_url":"https://api.github.com/repos/stellar/go/forks","keys_url":"https://api.github.com/repos/stellar/go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stellar/go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stellar/go/teams","hooks_url":"https://api.github.com/repos/stellar/go/hooks","issue_events_url":"https://api.github.com/repos/stellar/go/issues/events{/number}","events_url":"https://api.github.com/repos/stellar/go/events","assignees_url":"https://api.github.com/repos/stellar/go/assignees{/user}","branches_url":"https://api.github.com/repos/stellar/go/branches{/branch}","tags_url":"https://api.github.com/repos/stellar/go/tags","blobs_url":"https://api.github.com/repos/stellar/go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stellar/go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stellar/go/git/refs{/sha}","trees_url":"https://api.github.com/repos/stellar/go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stellar/go/statuses/{sha}","languages_url":"https://api.github.com/repos/stellar/go/languages","stargazers_url":"https://api.github.com/repos/stellar/go/stargazers","contributors_url":"https://api.github.com/repos/stellar/go/contributors","subscribers_url":"https://api.github.com/repos/stellar/go/subscribers","subscription_url":"https://api.github.com/repos/stellar/go/subscription","commits_url":"https://api.github.com/repos/stellar/go/commits{/sha}","git_commits_url":"https://api.github.com/repos/stellar/go/git/commits{/sha}","comments_url":"https://api.github.com/repos/stellar/go/comments{/number}","issue_comment_url":"https://api.github.com/repos/stellar/go/issues/comments{/number}","contents_url":"https://api.github.com/repos/stellar/go/contents/{+path}","compare_url":"https://api.github.com/repos/stellar/go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stellar/go/merges","archive_url":"https://api.github.com/repos/stellar/go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stellar/go/downloads","issues_url":"https://api.github.com/repos/stellar/go/issues{/number}","pulls_url":"https://api.github.com/repos/stellar/go/pulls{/number}","milestones_url":"https://api.github.com/repos/stellar/go/milestones{/number}","notifications_url":"https://api.github.com/repos/stellar/go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stellar/go/labels{/name}","releases_url":"https://api.github.com/repos/stellar/go/releases{/id}","deployments_url":"https://api.github.com/repos/stellar/go/deployments","created_at":"2016-08-04T17:27:50Z","updated_at":"2018-10-09T12:49:15Z","pushed_at":"2018-10-10T13:29:00Z","git_url":"git://github.com/stellar/go.git","ssh_url":"git@github.com:stellar/go.git","clone_url":"https://github.com/stellar/go.git","svn_url":"https://github.com/stellar/go","homepage":"https://stellar.org/developers","size":16480,"stargazers_count":380,"watchers_count":380,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":193,"mirror_url":null,"archived":false,"open_issues_count":153,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":193,"open_issues":153,"watchers":380,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stellar/go/pulls/667"},"html":{"href":"https://github.com/stellar/go/pull/667"},"issue":{"href":"https://api.github.com/repos/stellar/go/issues/667"},"comments":{"href":"https://api.github.com/repos/stellar/go/issues/667/comments"},"review_comments":{"href":"https://api.github.com/repos/stellar/go/pulls/667/comments"},"review_comment":{"href":"https://api.github.com/repos/stellar/go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stellar/go/pulls/667/commits"},"statuses":{"href":"https://api.github.com/repos/stellar/go/statuses/a919d1fa9984c886a9c2c561d05c340beb140aa0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tomerweller"}}