{"action":"created","comment":{"url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments/24842307","id":24842307,"diff_hunk":"@@ -94,6 +95,12 @@ func (c Currency) RoundDown(n uint64) (y Currency) {\n \treturn\n }\n \n+// ContractTax returns the amount of Currency that would be taxed from a\n+// contract payout with value c.\n+func (c Currency) ContractTax() Currency {\n+\treturn c.MulFloat(SiafundPortion).RoundDown(SiafundCount)\n+}","path":"consensus/currency.go","position":31,"original_position":31,"commit_id":"f5539f92abece5bccb542005a5ce05419eb4b464","original_commit_id":"f5539f92abece5bccb542005a5ce05419eb4b464","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":"yeah, that makes more sense. This is an improvement everywhere except for renter/negotiate.go, because it needs to calculate the tax before creating the contract. So that function got slightly more awkward.","created_at":"2015-02-17T18:55:26Z","updated_at":"2015-02-17T18:55:26Z","html_url":"https://github.com/NebulousLabs/Sia/pull/339#discussion_r24842307","pull_request_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/339","_links":{"self":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments/24842307"},"html":{"href":"https://github.com/NebulousLabs/Sia/pull/339#discussion_r24842307"},"pull_request":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/339"}}},"pull_request":{"url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/339","id":29417350,"html_url":"https://github.com/NebulousLabs/Sia/pull/339","diff_url":"https://github.com/NebulousLabs/Sia/pull/339.diff","patch_url":"https://github.com/NebulousLabs/Sia/pull/339.patch","issue_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/339","number":339,"state":"open","locked":false,"title":"Consensus Review","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":"whew. This was fun. I was especially nitpicky here so I'm willing to tone it down in places where you think my changes are unnecessary.\r\n\r\nRemaining issues:\r\n- SigHash behaves a bit differently now; instead of manually marshaling and appending the fields, it instead removes all the irrelevant information from the transaction and then marshals the transaction as a whole. I think this should be fine as long as the behavior is well-defined and nothing unexpected winds up being included. Worst case, you marshal a few empty length prefixes.\r\n- StorageProofOutputID hashes a bool. Bools are currently marshaled as a single byte, either `1` or `0`. Again, this is fine as long as the behavior is well defined. That is, people need to know to include a `1` or `0` in the hash, not something like `\"true\"` or `\"false\"`.\r\n- It took me a while to understand the SurpassThreshold equation. I think I understand it now, but the math is a bit awkward. There might be a better way to do things.\r\n- There are a few places where code could be organized better. Specifically, I'm thinking of the Target/Big conversion functions, and info.go which is currently a huge mix of exported and unexported functions. It also makes me uneasy having all of the methods of a type defined across 4 separate files. What we have now isn't bad though.\r\n- The flow of the code was pretty opaque at times. Like, what's the difference between `ValidTransaction` and `ValidTransactionComponents`? Who calls which one, and why? Do they overlap? etc.\r\n- Diffs. Are they really necessary? I think they're helpful going backwards, but how frequently is a diff going to be cached when we're going forward? Seems like something that would only happen if you're switching back and forth between two competing chains. Even still, diffs feel more like an optimization than crucial functionality. I think diff/forking code could be a lot cleaner if we only used diffs going backwards. I might be missing something here though.","created_at":"2015-02-17T04:24:54Z","updated_at":"2015-02-17T18:55:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18cfeae68d4b21973fcfef14f59e3012ea6ed474","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/339/commits","review_comments_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/339/comments","review_comment_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments/{number}","comments_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/339/comments","statuses_url":"https://api.github.com/repos/NebulousLabs/Sia/statuses/f5539f92abece5bccb542005a5ce05419eb4b464","head":{"label":"NebulousLabs:consensus-review","ref":"consensus-review","sha":"f5539f92abece5bccb542005a5ce05419eb4b464","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-02-17T02:55:27Z","pushed_at":"2015-02-17T04:55:51Z","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":7460,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":46,"forks":1,"open_issues":46,"watchers":7,"default_branch":"master"}},"base":{"label":"NebulousLabs:master","ref":"master","sha":"04e46fb2315115ce311a41dd17a6d0b81ac174f5","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-02-17T02:55:27Z","pushed_at":"2015-02-17T04:55:51Z","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":7460,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":46,"forks":1,"open_issues":46,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/339"},"html":{"href":"https://github.com/NebulousLabs/Sia/pull/339"},"issue":{"href":"https://api.github.com/repos/NebulousLabs/Sia/issues/339"},"comments":{"href":"https://api.github.com/repos/NebulousLabs/Sia/issues/339/comments"},"review_comments":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/339/comments"},"review_comment":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/339/commits"},"statuses":{"href":"https://api.github.com/repos/NebulousLabs/Sia/statuses/f5539f92abece5bccb542005a5ce05419eb4b464"}}}}