{"action":"created","comment":{"url":"https://api.github.com/repos/tendermint/abci/pulls/comments/190481616","pull_request_review_id":122863884,"id":190481616,"diff_hunk":"@@ -1,121 +1,170 @@\n package types\n \n-import (\n-\t\"bytes\"\n-\t\"encoding/json\"\n+import cmn \"github.com/tendermint/tmlibs/common\"\n \n-\t\"github.com/gogo/protobuf/jsonpb\"\n-)\n-\n-const (\n-\tCodeTypeOK uint32 = 0\n-)\n+// nondeterministic\n+type ResultException struct {\n+\tError string `json:\"error,omitempty\"`\n+}\n \n-// IsOK returns true if Code is OK.\n-func (r ResponseCheckTx) IsOK() bool {\n-\treturn r.Code == CodeTypeOK\n+type ResultEcho struct {\n+\tMessage string `json:\"message,omitempty\"`\n }\n \n-// IsErr returns true if Code is something other than OK.\n-func (r ResponseCheckTx) IsErr() bool {\n-\treturn r.Code != CodeTypeOK\n+type ResultFlush struct {\n }\n \n-// IsOK returns true if Code is OK.\n-func (r ResponseDeliverTx) IsOK() bool {\n-\treturn r.Code == CodeTypeOK\n+type ResultInfo struct {\n+\tData             string `json:\"data,omitempty\"`\n+\tVersion          string `json:\"version,omitempty\"`\n+\tLastBlockHeight  int64  `json:\"last_block_height,omitempty\"`\n+\tLastBlockAppHash []byte `json:\"last_block_app_hash,omitempty\"`\n }\n \n-// IsErr returns true if Code is something other than OK.\n-func (r ResponseDeliverTx) IsErr() bool {\n-\treturn r.Code != CodeTypeOK\n+func FromResultInfo(res ResultInfo) ResponseInfo {\n+\treturn ResponseInfo(res)\n }\n \n-// IsOK returns true if Code is OK.\n-func (r ResponseQuery) IsOK() bool {\n-\treturn r.Code == CodeTypeOK\n+type ResultSetOption struct {\n+\tCode uint32 `json:\"code,omitempty\"`\n+\t// bytes data = 2;\n+\tLog  string `json:\"log,omitempty\"`\n+\tInfo string `json:\"info,omitempty\"`\n }\n \n-// IsErr returns true if Code is something other than OK.\n-func (r ResponseQuery) IsErr() bool {\n-\treturn r.Code != CodeTypeOK\n+func FromResultSetOption(res ResultSetOption) ResponseSetOption {\n+\treturn ResponseSetOption(res)\n }\n \n-//---------------------------------------------------------------------------\n-// override JSON marshalling so we dont emit defaults (ie. disable omitempty)\n-// note we need Unmarshal functions too because protobuf had the bright idea\n-// to marshal int64->string. cool. cool, cool, cool: https://developers.google.com/protocol-buffers/docs/proto3#json\n+type ResultInitChain struct {\n+\tValidators []Validator `json:\"validators\"`\n+}\n \n-var (\n-\tjsonpbMarshaller = jsonpb.Marshaler{\n-\t\tEnumsAsInts:  true,\n-\t\tEmitDefaults: false,\n+func FromResultInitChain(res ResultInitChain) ResponseInitChain {\n+\tvals := valsToPointers(res.Validators)\n+\treturn ResponseInitChain{\n+\t\tValidators: vals,\n \t}\n-\tjsonpbUnmarshaller = jsonpb.Unmarshaler{}\n-)\n+}\n \n-func (r *ResponseSetOption) MarshalJSON() ([]byte, error) {\n-\ts, err := jsonpbMarshaller.MarshalToString(r)\n-\treturn []byte(s), err\n+type ResultQuery struct {\n+\tCode uint32 `json:\"code,omitempty\"`\n+\t// bytes data = 2; // use \"value\" instead.\n+\tLog    string `json:\"log,omitempty\"`\n+\tInfo   string `json:\"info,omitempty\"`\n+\tIndex  int64  `json:\"index,omitempty\"`\n+\tKey    []byte `json:\"key,omitempty\"`\n+\tValue  []byte `json:\"value,omitempty\"`\n+\tProof  []byte `json:\"proof,omitempty\"`\n+\tHeight int64  `json:\"height,omitempty\"`\n }\n \n-func (r *ResponseSetOption) UnmarshalJSON(b []byte) error {\n-\treader := bytes.NewBuffer(b)\n-\treturn jsonpbUnmarshaller.Unmarshal(reader, r)\n+func FromResultQuery(res ResultQuery) ResponseQuery {\n+\treturn ResponseQuery(res)\n }\n \n-func (r *ResponseCheckTx) MarshalJSON() ([]byte, error) {\n-\ts, err := jsonpbMarshaller.MarshalToString(r)\n-\treturn []byte(s), err\n+type ResultBeginBlock struct {\n+\tTags []cmn.KVPair `json:\"tags,omitempty\"`\n }\n \n-func (r *ResponseCheckTx) UnmarshalJSON(b []byte) error {\n-\treader := bytes.NewBuffer(b)\n-\treturn jsonpbUnmarshaller.Unmarshal(reader, r)\n+func FromResultBeginBlock(res ResultBeginBlock) ResponseBeginBlock {\n+\ttags := tagsToPointers(res.Tags)\n+\treturn ResponseBeginBlock{\n+\t\tTags: tags,\n+\t}\n }\n \n-func (r *ResponseDeliverTx) MarshalJSON() ([]byte, error) {\n-\ts, err := jsonpbMarshaller.MarshalToString(r)\n-\treturn []byte(s), err\n+type ResultCheckTx struct {\n+\tCode      uint32       `json:\"code,omitempty\"`\n+\tData      []byte       `json:\"data,omitempty\"`\n+\tLog       string       `json:\"log,omitempty\"`\n+\tInfo      string       `json:\"info,omitempty\"`\n+\tGasWanted int64        `json:\"gas_wanted,omitempty\"`\n+\tGasUsed   int64        `json:\"gas_used,omitempty\"`\n+\tTags      []cmn.KVPair `json:\"tags,omitempty\"`\n+\tFee       cmn.KI64Pair `json:\"fee\"`","path":"types/result.go","position":137,"original_position":137,"commit_id":"6334b3a5018ec0b5e64816c117b837821bfa0a70","original_commit_id":"6334b3a5018ec0b5e64816c117b837821bfa0a70","user":{"login":"melekes","id":1282182,"avatar_url":"https://avatars2.githubusercontent.com/u/1282182?v=4","gravatar_id":"","url":"https://api.github.com/users/melekes","html_url":"https://github.com/melekes","followers_url":"https://api.github.com/users/melekes/followers","following_url":"https://api.github.com/users/melekes/following{/other_user}","gists_url":"https://api.github.com/users/melekes/gists{/gist_id}","starred_url":"https://api.github.com/users/melekes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melekes/subscriptions","organizations_url":"https://api.github.com/users/melekes/orgs","repos_url":"https://api.github.com/users/melekes/repos","events_url":"https://api.github.com/users/melekes/events{/privacy}","received_events_url":"https://api.github.com/users/melekes/received_events","type":"User","site_admin":false},"body":"it correlates with `(gogoproto.nullable)=false`, right?","created_at":"2018-05-24T06:53:41Z","updated_at":"2018-05-24T06:55:05Z","html_url":"https://github.com/tendermint/abci/pull/247#discussion_r190481616","pull_request_url":"https://api.github.com/repos/tendermint/abci/pulls/247","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/tendermint/abci/pulls/comments/190481616"},"html":{"href":"https://github.com/tendermint/abci/pull/247#discussion_r190481616"},"pull_request":{"href":"https://api.github.com/repos/tendermint/abci/pulls/247"}},"in_reply_to_id":190481339},"pull_request":{"url":"https://api.github.com/repos/tendermint/abci/pulls/247","id":190164562,"html_url":"https://github.com/tendermint/abci/pull/247","diff_url":"https://github.com/tendermint/abci/pull/247.diff","patch_url":"https://github.com/tendermint/abci/pull/247.patch","issue_url":"https://api.github.com/repos/tendermint/abci/issues/247","number":247,"state":"open","locked":false,"title":"Bucky/no gogo","user":{"login":"ebuchman","id":2300911,"avatar_url":"https://avatars3.githubusercontent.com/u/2300911?v=4","gravatar_id":"","url":"https://api.github.com/users/ebuchman","html_url":"https://github.com/ebuchman","followers_url":"https://api.github.com/users/ebuchman/followers","following_url":"https://api.github.com/users/ebuchman/following{/other_user}","gists_url":"https://api.github.com/users/ebuchman/gists{/gist_id}","starred_url":"https://api.github.com/users/ebuchman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebuchman/subscriptions","organizations_url":"https://api.github.com/users/ebuchman/orgs","repos_url":"https://api.github.com/users/ebuchman/repos","events_url":"https://api.github.com/users/ebuchman/events{/privacy}","received_events_url":"https://api.github.com/users/ebuchman/received_events","type":"User","site_admin":false},"body":"Depends on https://github.com/tendermint/tmlibs/pull/214\r\n\r\nRemove gogoproto!\r\n\r\nRefs https://github.com/tendermint/abci/issues/179","created_at":"2018-05-24T04:07:10Z","updated_at":"2018-05-24T06:55:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9b9daf3b941e471dc48aab44173900986c8a208f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/tendermint/abci/pulls/247/commits","review_comments_url":"https://api.github.com/repos/tendermint/abci/pulls/247/comments","review_comment_url":"https://api.github.com/repos/tendermint/abci/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tendermint/abci/issues/247/comments","statuses_url":"https://api.github.com/repos/tendermint/abci/statuses/6334b3a5018ec0b5e64816c117b837821bfa0a70","head":{"label":"tendermint:bucky/no-gogo","ref":"bucky/no-gogo","sha":"6334b3a5018ec0b5e64816c117b837821bfa0a70","user":{"login":"tendermint","id":7572940,"avatar_url":"https://avatars1.githubusercontent.com/u/7572940?v=4","gravatar_id":"","url":"https://api.github.com/users/tendermint","html_url":"https://github.com/tendermint","followers_url":"https://api.github.com/users/tendermint/followers","following_url":"https://api.github.com/users/tendermint/following{/other_user}","gists_url":"https://api.github.com/users/tendermint/gists{/gist_id}","starred_url":"https://api.github.com/users/tendermint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tendermint/subscriptions","organizations_url":"https://api.github.com/users/tendermint/orgs","repos_url":"https://api.github.com/users/tendermint/repos","events_url":"https://api.github.com/users/tendermint/events{/privacy}","received_events_url":"https://api.github.com/users/tendermint/received_events","type":"Organization","site_admin":false},"repo":{"id":45712305,"name":"abci","full_name":"tendermint/abci","owner":{"login":"tendermint","id":7572940,"avatar_url":"https://avatars1.githubusercontent.com/u/7572940?v=4","gravatar_id":"","url":"https://api.github.com/users/tendermint","html_url":"https://github.com/tendermint","followers_url":"https://api.github.com/users/tendermint/followers","following_url":"https://api.github.com/users/tendermint/following{/other_user}","gists_url":"https://api.github.com/users/tendermint/gists{/gist_id}","starred_url":"https://api.github.com/users/tendermint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tendermint/subscriptions","organizations_url":"https://api.github.com/users/tendermint/orgs","repos_url":"https://api.github.com/users/tendermint/repos","events_url":"https://api.github.com/users/tendermint/events{/privacy}","received_events_url":"https://api.github.com/users/tendermint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tendermint/abci","description":"BlockchainEngine <-- ABCI --> DeterministicStateMachine","fork":false,"url":"https://api.github.com/repos/tendermint/abci","forks_url":"https://api.github.com/repos/tendermint/abci/forks","keys_url":"https://api.github.com/repos/tendermint/abci/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tendermint/abci/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tendermint/abci/teams","hooks_url":"https://api.github.com/repos/tendermint/abci/hooks","issue_events_url":"https://api.github.com/repos/tendermint/abci/issues/events{/number}","events_url":"https://api.github.com/repos/tendermint/abci/events","assignees_url":"https://api.github.com/repos/tendermint/abci/assignees{/user}","branches_url":"https://api.github.com/repos/tendermint/abci/branches{/branch}","tags_url":"https://api.github.com/repos/tendermint/abci/tags","blobs_url":"https://api.github.com/repos/tendermint/abci/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tendermint/abci/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tendermint/abci/git/refs{/sha}","trees_url":"https://api.github.com/repos/tendermint/abci/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tendermint/abci/statuses/{sha}","languages_url":"https://api.github.com/repos/tendermint/abci/languages","stargazers_url":"https://api.github.com/repos/tendermint/abci/stargazers","contributors_url":"https://api.github.com/repos/tendermint/abci/contributors","subscribers_url":"https://api.github.com/repos/tendermint/abci/subscribers","subscription_url":"https://api.github.com/repos/tendermint/abci/subscription","commits_url":"https://api.github.com/repos/tendermint/abci/commits{/sha}","git_commits_url":"https://api.github.com/repos/tendermint/abci/git/commits{/sha}","comments_url":"https://api.github.com/repos/tendermint/abci/comments{/number}","issue_comment_url":"https://api.github.com/repos/tendermint/abci/issues/comments{/number}","contents_url":"https://api.github.com/repos/tendermint/abci/contents/{+path}","compare_url":"https://api.github.com/repos/tendermint/abci/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tendermint/abci/merges","archive_url":"https://api.github.com/repos/tendermint/abci/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tendermint/abci/downloads","issues_url":"https://api.github.com/repos/tendermint/abci/issues{/number}","pulls_url":"https://api.github.com/repos/tendermint/abci/pulls{/number}","milestones_url":"https://api.github.com/repos/tendermint/abci/milestones{/number}","notifications_url":"https://api.github.com/repos/tendermint/abci/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tendermint/abci/labels{/name}","releases_url":"https://api.github.com/repos/tendermint/abci/releases{/id}","deployments_url":"https://api.github.com/repos/tendermint/abci/deployments","created_at":"2015-11-06T22:48:58Z","updated_at":"2018-05-24T06:02:45Z","pushed_at":"2018-05-24T04:09:54Z","git_url":"git://github.com/tendermint/abci.git","ssh_url":"git@github.com:tendermint/abci.git","clone_url":"https://github.com/tendermint/abci.git","svn_url":"https://github.com/tendermint/abci","homepage":"","size":12581,"stargazers_count":176,"watchers_count":176,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":72,"mirror_url":null,"archived":false,"open_issues_count":16,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":72,"open_issues":16,"watchers":176,"default_branch":"master"}},"base":{"label":"tendermint:develop","ref":"develop","sha":"927c16281c03ad04a404d6d04abf020428481fbd","user":{"login":"tendermint","id":7572940,"avatar_url":"https://avatars1.githubusercontent.com/u/7572940?v=4","gravatar_id":"","url":"https://api.github.com/users/tendermint","html_url":"https://github.com/tendermint","followers_url":"https://api.github.com/users/tendermint/followers","following_url":"https://api.github.com/users/tendermint/following{/other_user}","gists_url":"https://api.github.com/users/tendermint/gists{/gist_id}","starred_url":"https://api.github.com/users/tendermint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tendermint/subscriptions","organizations_url":"https://api.github.com/users/tendermint/orgs","repos_url":"https://api.github.com/users/tendermint/repos","events_url":"https://api.github.com/users/tendermint/events{/privacy}","received_events_url":"https://api.github.com/users/tendermint/received_events","type":"Organization","site_admin":false},"repo":{"id":45712305,"name":"abci","full_name":"tendermint/abci","owner":{"login":"tendermint","id":7572940,"avatar_url":"https://avatars1.githubusercontent.com/u/7572940?v=4","gravatar_id":"","url":"https://api.github.com/users/tendermint","html_url":"https://github.com/tendermint","followers_url":"https://api.github.com/users/tendermint/followers","following_url":"https://api.github.com/users/tendermint/following{/other_user}","gists_url":"https://api.github.com/users/tendermint/gists{/gist_id}","starred_url":"https://api.github.com/users/tendermint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tendermint/subscriptions","organizations_url":"https://api.github.com/users/tendermint/orgs","repos_url":"https://api.github.com/users/tendermint/repos","events_url":"https://api.github.com/users/tendermint/events{/privacy}","received_events_url":"https://api.github.com/users/tendermint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tendermint/abci","description":"BlockchainEngine <-- ABCI --> DeterministicStateMachine","fork":false,"url":"https://api.github.com/repos/tendermint/abci","forks_url":"https://api.github.com/repos/tendermint/abci/forks","keys_url":"https://api.github.com/repos/tendermint/abci/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tendermint/abci/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tendermint/abci/teams","hooks_url":"https://api.github.com/repos/tendermint/abci/hooks","issue_events_url":"https://api.github.com/repos/tendermint/abci/issues/events{/number}","events_url":"https://api.github.com/repos/tendermint/abci/events","assignees_url":"https://api.github.com/repos/tendermint/abci/assignees{/user}","branches_url":"https://api.github.com/repos/tendermint/abci/branches{/branch}","tags_url":"https://api.github.com/repos/tendermint/abci/tags","blobs_url":"https://api.github.com/repos/tendermint/abci/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tendermint/abci/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tendermint/abci/git/refs{/sha}","trees_url":"https://api.github.com/repos/tendermint/abci/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tendermint/abci/statuses/{sha}","languages_url":"https://api.github.com/repos/tendermint/abci/languages","stargazers_url":"https://api.github.com/repos/tendermint/abci/stargazers","contributors_url":"https://api.github.com/repos/tendermint/abci/contributors","subscribers_url":"https://api.github.com/repos/tendermint/abci/subscribers","subscription_url":"https://api.github.com/repos/tendermint/abci/subscription","commits_url":"https://api.github.com/repos/tendermint/abci/commits{/sha}","git_commits_url":"https://api.github.com/repos/tendermint/abci/git/commits{/sha}","comments_url":"https://api.github.com/repos/tendermint/abci/comments{/number}","issue_comment_url":"https://api.github.com/repos/tendermint/abci/issues/comments{/number}","contents_url":"https://api.github.com/repos/tendermint/abci/contents/{+path}","compare_url":"https://api.github.com/repos/tendermint/abci/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tendermint/abci/merges","archive_url":"https://api.github.com/repos/tendermint/abci/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tendermint/abci/downloads","issues_url":"https://api.github.com/repos/tendermint/abci/issues{/number}","pulls_url":"https://api.github.com/repos/tendermint/abci/pulls{/number}","milestones_url":"https://api.github.com/repos/tendermint/abci/milestones{/number}","notifications_url":"https://api.github.com/repos/tendermint/abci/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tendermint/abci/labels{/name}","releases_url":"https://api.github.com/repos/tendermint/abci/releases{/id}","deployments_url":"https://api.github.com/repos/tendermint/abci/deployments","created_at":"2015-11-06T22:48:58Z","updated_at":"2018-05-24T06:02:45Z","pushed_at":"2018-05-24T04:09:54Z","git_url":"git://github.com/tendermint/abci.git","ssh_url":"git@github.com:tendermint/abci.git","clone_url":"https://github.com/tendermint/abci.git","svn_url":"https://github.com/tendermint/abci","homepage":"","size":12581,"stargazers_count":176,"watchers_count":176,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":72,"mirror_url":null,"archived":false,"open_issues_count":16,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":72,"open_issues":16,"watchers":176,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tendermint/abci/pulls/247"},"html":{"href":"https://github.com/tendermint/abci/pull/247"},"issue":{"href":"https://api.github.com/repos/tendermint/abci/issues/247"},"comments":{"href":"https://api.github.com/repos/tendermint/abci/issues/247/comments"},"review_comments":{"href":"https://api.github.com/repos/tendermint/abci/pulls/247/comments"},"review_comment":{"href":"https://api.github.com/repos/tendermint/abci/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tendermint/abci/pulls/247/commits"},"statuses":{"href":"https://api.github.com/repos/tendermint/abci/statuses/6334b3a5018ec0b5e64816c117b837821bfa0a70"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"melekes"}}