{"action":"created","comment":{"url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments/42700401","id":42700401,"diff_hunk":"@@ -21,20 +21,34 @@ var (\n \terrBadPointer = errors.New(\"cannot decode into invalid pointer\")\n )\n \n-// A SiaMarshaler can encode and write itself to a stream.\n-type SiaMarshaler interface {\n-\tMarshalSia(io.Writer) error\n-}\n+type (\n+\t// GenericMarshaler marshals objects into byte slices and unmarshals byte\n+\t// slices into objects.\n+\tGenericMarshaler interface {\n+\t\tMarshal(interface{}) []byte\n+\t\tUnmarshal([]byte, interface{}) error\n+\t}\n \n-// A SiaUnmarshaler can read and decode itself from a stream.\n-type SiaUnmarshaler interface {\n-\tUnmarshalSia(io.Reader) error\n-}\n+\t// A SiaMarshaler can encode and write itself to a stream.\n+\tSiaMarshaler interface {\n+\t\tMarshalSia(io.Writer) error\n+\t}\n \n-// An Encoder writes objects to an output stream.\n-type Encoder struct {\n-\tw io.Writer\n-}\n+\t// A SiaUnmarshaler can read and decode itself from a stream.\n+\tSiaUnmarshaler interface {\n+\t\tUnmarshalSia(io.Reader) error\n+\t}\n+\n+\t// StdGenericMarshaler is an implementation of GenericMarshaler that uses\n+\t// the encoding.Marshal and encoding.Unmarshal functions to perform\n+\t// its marshaling/unmarshaling.\n+\tStdGenericMarshaler struct{}\n+\n+\t// An Encoder writes objects to an output stream.\n+\tEncoder struct {\n+\t\tw io.Writer\n+\t}","path":"encoding/marshal.go","position":42,"original_position":42,"commit_id":"f2f48998fd558a606ec8529c04f09c7769f39ab4","original_commit_id":"f2f48998fd558a606ec8529c04f09c7769f39ab4","user":{"login":"lukechampine","id":3344749,"avatar_url":"https://avatars.githubusercontent.com/u/3344749?v=3","gravatar_id":"","url":"https://api.github.com/users/lukechampine","html_url":"https://github.com/lukechampine","followers_url":"https://api.github.com/users/lukechampine/followers","following_url":"https://api.github.com/users/lukechampine/following{/other_user}","gists_url":"https://api.github.com/users/lukechampine/gists{/gist_id}","starred_url":"https://api.github.com/users/lukechampine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukechampine/subscriptions","organizations_url":"https://api.github.com/users/lukechampine/orgs","repos_url":"https://api.github.com/users/lukechampine/repos","events_url":"https://api.github.com/users/lukechampine/events{/privacy}","received_events_url":"https://api.github.com/users/lukechampine/received_events","type":"User","site_admin":false},"body":"is this being used anywhere?","created_at":"2015-10-22T00:34:51Z","updated_at":"2015-10-22T00:34:51Z","html_url":"https://github.com/NebulousLabs/Sia/pull/812#discussion_r42700401","pull_request_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/812","_links":{"self":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments/42700401"},"html":{"href":"https://github.com/NebulousLabs/Sia/pull/812#discussion_r42700401"},"pull_request":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/812"}}},"pull_request":{"url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/812","id":47858762,"html_url":"https://github.com/NebulousLabs/Sia/pull/812","diff_url":"https://github.com/NebulousLabs/Sia/pull/812.diff","patch_url":"https://github.com/NebulousLabs/Sia/pull/812.patch","issue_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/812","number":812,"state":"open","locked":false,"title":"Create interfaces for block marshalling","user":{"login":"mtlynch","id":7783288,"avatar_url":"https://avatars.githubusercontent.com/u/7783288?v=3","gravatar_id":"","url":"https://api.github.com/users/mtlynch","html_url":"https://github.com/mtlynch","followers_url":"https://api.github.com/users/mtlynch/followers","following_url":"https://api.github.com/users/mtlynch/following{/other_user}","gists_url":"https://api.github.com/users/mtlynch/gists{/gist_id}","starred_url":"https://api.github.com/users/mtlynch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtlynch/subscriptions","organizations_url":"https://api.github.com/users/mtlynch/orgs","repos_url":"https://api.github.com/users/mtlynch/repos","events_url":"https://api.github.com/users/mtlynch/events{/privacy}","received_events_url":"https://api.github.com/users/mtlynch/received_events","type":"User","site_admin":false},"body":"Create interface for marshalling type.Block and unmarshalling\r\nconsensus.processedBlock. The explicit interfaces will facilitate\r\ntesting of the consensus package (specifically the validHeader\r\nfunction).","created_at":"2015-10-16T00:25:15Z","updated_at":"2015-10-22T00:34:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"98c142ceb10e9bf2978f01f1568e2389063c6b48","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/812/commits","review_comments_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/812/comments","review_comment_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/812/comments","statuses_url":"https://api.github.com/repos/NebulousLabs/Sia/statuses/f2f48998fd558a606ec8529c04f09c7769f39ab4","head":{"label":"mtlynch:block-marshalling","ref":"block-marshalling","sha":"f2f48998fd558a606ec8529c04f09c7769f39ab4","user":{"login":"mtlynch","id":7783288,"avatar_url":"https://avatars.githubusercontent.com/u/7783288?v=3","gravatar_id":"","url":"https://api.github.com/users/mtlynch","html_url":"https://github.com/mtlynch","followers_url":"https://api.github.com/users/mtlynch/followers","following_url":"https://api.github.com/users/mtlynch/following{/other_user}","gists_url":"https://api.github.com/users/mtlynch/gists{/gist_id}","starred_url":"https://api.github.com/users/mtlynch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtlynch/subscriptions","organizations_url":"https://api.github.com/users/mtlynch/orgs","repos_url":"https://api.github.com/users/mtlynch/repos","events_url":"https://api.github.com/users/mtlynch/events{/privacy}","received_events_url":"https://api.github.com/users/mtlynch/received_events","type":"User","site_admin":false},"repo":{"id":41731429,"name":"Sia","full_name":"mtlynch/Sia","owner":{"login":"mtlynch","id":7783288,"avatar_url":"https://avatars.githubusercontent.com/u/7783288?v=3","gravatar_id":"","url":"https://api.github.com/users/mtlynch","html_url":"https://github.com/mtlynch","followers_url":"https://api.github.com/users/mtlynch/followers","following_url":"https://api.github.com/users/mtlynch/following{/other_user}","gists_url":"https://api.github.com/users/mtlynch/gists{/gist_id}","starred_url":"https://api.github.com/users/mtlynch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtlynch/subscriptions","organizations_url":"https://api.github.com/users/mtlynch/orgs","repos_url":"https://api.github.com/users/mtlynch/repos","events_url":"https://api.github.com/users/mtlynch/events{/privacy}","received_events_url":"https://api.github.com/users/mtlynch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mtlynch/Sia","description":"Blockchain-based marketplace for file storage","fork":true,"url":"https://api.github.com/repos/mtlynch/Sia","forks_url":"https://api.github.com/repos/mtlynch/Sia/forks","keys_url":"https://api.github.com/repos/mtlynch/Sia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mtlynch/Sia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mtlynch/Sia/teams","hooks_url":"https://api.github.com/repos/mtlynch/Sia/hooks","issue_events_url":"https://api.github.com/repos/mtlynch/Sia/issues/events{/number}","events_url":"https://api.github.com/repos/mtlynch/Sia/events","assignees_url":"https://api.github.com/repos/mtlynch/Sia/assignees{/user}","branches_url":"https://api.github.com/repos/mtlynch/Sia/branches{/branch}","tags_url":"https://api.github.com/repos/mtlynch/Sia/tags","blobs_url":"https://api.github.com/repos/mtlynch/Sia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mtlynch/Sia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mtlynch/Sia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mtlynch/Sia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mtlynch/Sia/statuses/{sha}","languages_url":"https://api.github.com/repos/mtlynch/Sia/languages","stargazers_url":"https://api.github.com/repos/mtlynch/Sia/stargazers","contributors_url":"https://api.github.com/repos/mtlynch/Sia/contributors","subscribers_url":"https://api.github.com/repos/mtlynch/Sia/subscribers","subscription_url":"https://api.github.com/repos/mtlynch/Sia/subscription","commits_url":"https://api.github.com/repos/mtlynch/Sia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mtlynch/Sia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mtlynch/Sia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mtlynch/Sia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mtlynch/Sia/contents/{+path}","compare_url":"https://api.github.com/repos/mtlynch/Sia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mtlynch/Sia/merges","archive_url":"https://api.github.com/repos/mtlynch/Sia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mtlynch/Sia/downloads","issues_url":"https://api.github.com/repos/mtlynch/Sia/issues{/number}","pulls_url":"https://api.github.com/repos/mtlynch/Sia/pulls{/number}","milestones_url":"https://api.github.com/repos/mtlynch/Sia/milestones{/number}","notifications_url":"https://api.github.com/repos/mtlynch/Sia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mtlynch/Sia/labels{/name}","releases_url":"https://api.github.com/repos/mtlynch/Sia/releases{/id}","created_at":"2015-09-01T10:10:44Z","updated_at":"2015-09-01T10:10:45Z","pushed_at":"2015-10-21T23:41:19Z","git_url":"git://github.com/mtlynch/Sia.git","ssh_url":"git@github.com:mtlynch/Sia.git","clone_url":"https://github.com/mtlynch/Sia.git","svn_url":"https://github.com/mtlynch/Sia","homepage":"http://siacoin.com","size":5571,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"NebulousLabs:master","ref":"master","sha":"96afc0af9ee81de5a3b1899ce48c3bdaec4f7988","user":{"login":"NebulousLabs","id":7471422,"avatar_url":"https://avatars.githubusercontent.com/u/7471422?v=3","gravatar_id":"","url":"https://api.github.com/users/NebulousLabs","html_url":"https://github.com/NebulousLabs","followers_url":"https://api.github.com/users/NebulousLabs/followers","following_url":"https://api.github.com/users/NebulousLabs/following{/other_user}","gists_url":"https://api.github.com/users/NebulousLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/NebulousLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NebulousLabs/subscriptions","organizations_url":"https://api.github.com/users/NebulousLabs/orgs","repos_url":"https://api.github.com/users/NebulousLabs/repos","events_url":"https://api.github.com/users/NebulousLabs/events{/privacy}","received_events_url":"https://api.github.com/users/NebulousLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":25370072,"name":"Sia","full_name":"NebulousLabs/Sia","owner":{"login":"NebulousLabs","id":7471422,"avatar_url":"https://avatars.githubusercontent.com/u/7471422?v=3","gravatar_id":"","url":"https://api.github.com/users/NebulousLabs","html_url":"https://github.com/NebulousLabs","followers_url":"https://api.github.com/users/NebulousLabs/followers","following_url":"https://api.github.com/users/NebulousLabs/following{/other_user}","gists_url":"https://api.github.com/users/NebulousLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/NebulousLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NebulousLabs/subscriptions","organizations_url":"https://api.github.com/users/NebulousLabs/orgs","repos_url":"https://api.github.com/users/NebulousLabs/repos","events_url":"https://api.github.com/users/NebulousLabs/events{/privacy}","received_events_url":"https://api.github.com/users/NebulousLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NebulousLabs/Sia","description":"Blockchain-based marketplace for file storage","fork":false,"url":"https://api.github.com/repos/NebulousLabs/Sia","forks_url":"https://api.github.com/repos/NebulousLabs/Sia/forks","keys_url":"https://api.github.com/repos/NebulousLabs/Sia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NebulousLabs/Sia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NebulousLabs/Sia/teams","hooks_url":"https://api.github.com/repos/NebulousLabs/Sia/hooks","issue_events_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/events{/number}","events_url":"https://api.github.com/repos/NebulousLabs/Sia/events","assignees_url":"https://api.github.com/repos/NebulousLabs/Sia/assignees{/user}","branches_url":"https://api.github.com/repos/NebulousLabs/Sia/branches{/branch}","tags_url":"https://api.github.com/repos/NebulousLabs/Sia/tags","blobs_url":"https://api.github.com/repos/NebulousLabs/Sia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NebulousLabs/Sia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NebulousLabs/Sia/git/refs{/sha}","trees_url":"https://api.github.com/repos/NebulousLabs/Sia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NebulousLabs/Sia/statuses/{sha}","languages_url":"https://api.github.com/repos/NebulousLabs/Sia/languages","stargazers_url":"https://api.github.com/repos/NebulousLabs/Sia/stargazers","contributors_url":"https://api.github.com/repos/NebulousLabs/Sia/contributors","subscribers_url":"https://api.github.com/repos/NebulousLabs/Sia/subscribers","subscription_url":"https://api.github.com/repos/NebulousLabs/Sia/subscription","commits_url":"https://api.github.com/repos/NebulousLabs/Sia/commits{/sha}","git_commits_url":"https://api.github.com/repos/NebulousLabs/Sia/git/commits{/sha}","comments_url":"https://api.github.com/repos/NebulousLabs/Sia/comments{/number}","issue_comment_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/comments{/number}","contents_url":"https://api.github.com/repos/NebulousLabs/Sia/contents/{+path}","compare_url":"https://api.github.com/repos/NebulousLabs/Sia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NebulousLabs/Sia/merges","archive_url":"https://api.github.com/repos/NebulousLabs/Sia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NebulousLabs/Sia/downloads","issues_url":"https://api.github.com/repos/NebulousLabs/Sia/issues{/number}","pulls_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls{/number}","milestones_url":"https://api.github.com/repos/NebulousLabs/Sia/milestones{/number}","notifications_url":"https://api.github.com/repos/NebulousLabs/Sia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NebulousLabs/Sia/labels{/name}","releases_url":"https://api.github.com/repos/NebulousLabs/Sia/releases{/id}","created_at":"2014-10-17T17:50:25Z","updated_at":"2015-10-19T07:39:31Z","pushed_at":"2015-10-21T23:41:19Z","git_url":"git://github.com/NebulousLabs/Sia.git","ssh_url":"git@github.com:NebulousLabs/Sia.git","clone_url":"https://github.com/NebulousLabs/Sia.git","svn_url":"https://github.com/NebulousLabs/Sia","homepage":"http://siacoin.com","size":31821,"stargazers_count":107,"watchers_count":107,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":31,"forks":16,"open_issues":31,"watchers":107,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/812"},"html":{"href":"https://github.com/NebulousLabs/Sia/pull/812"},"issue":{"href":"https://api.github.com/repos/NebulousLabs/Sia/issues/812"},"comments":{"href":"https://api.github.com/repos/NebulousLabs/Sia/issues/812/comments"},"review_comments":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/812/comments"},"review_comment":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/812/commits"},"statuses":{"href":"https://api.github.com/repos/NebulousLabs/Sia/statuses/f2f48998fd558a606ec8529c04f09c7769f39ab4"}}}}