{"action":"created","comment":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/184049058","pull_request_review_id":115058391,"id":184049058,"diff_hunk":"@@ -217,55 +217,56 @@ return tree;\n ...\n ```\n \n-This method is used to compute a Merkle Tree root for the block. The companion project has a Merkle Tree unit test that attempts to add a transaction to a block and verify that the Merkle Roots have changed. Here is the source code for the unit test.\n+此方法用于计算区块的默克尔树根。伴随项目有一个默克尔树单元测试，它试图将事务添加到一个区块中，并验证默克尔根是否已经更改。下面是单元测试的源码。\n \n ```\n ...\n @Test\n public void merkleTreeTest() {\n \n-// create chain, add transaction\n+// 创建链，添加事务\n \n SimpleBlockchain<Transaction> chain1 = new SimpleBlockchain<Transaction>();\n \n chain1.add(new Transaction(\"A\")).add(new Transaction(\"B\")).add(new Transaction(\"C\")).add(new Transaction(\"D\"));\n \n-// get a block in chain\n+// 得到区块链\n Block<Transaction> block = chain1.getHead();\n \n System.out.println(\"Merkle Hash tree :\" + block.merkleTree());\n \n-// get a transaction from block\n+//从区块中获取事务\n Transaction tx = block.getTransactions().get(0);\n \n-// see if block transactions are valid, they should be\n+// 查看区块事务是否有效，它们应该是有效的\n block.transasctionsValid();\n assertTrue(block.transasctionsValid());\n \n-// mutate the data of a transaction\n+// 更改事务数据\n tx.setValue(\"Z\");\n \n-// block should no longer be valid, blocks MerkleRoot does not match computed merkle tree of transactions\n+// 区块失效，区块 Merkle Root 不匹配事务计算的 Merkle 树。\n assertFalse(block.transasctionsValid());\n \n }\n \n ...\n ```\n \n-This unit test emulates validating transactions, then changing a transaction in a block outside of the consensus mechanism, e.g. if someone tries to change transaction data.\n+此单元测试模拟验证事务，然后在协商一致机制之外的块中更改事务，例如，如果有人试图更改事务数据。","path":"TODO1/blockchain-implementation-with-java-code.md","position":271,"original_position":271,"commit_id":"7c2ef86f01cff52c140739a997e5d2c362031ead","original_commit_id":"7c2ef86f01cff52c140739a997e5d2c362031ead","user":{"login":"sisibeloved","id":9612053,"avatar_url":"https://avatars0.githubusercontent.com/u/9612053?v=4","gravatar_id":"","url":"https://api.github.com/users/sisibeloved","html_url":"https://github.com/sisibeloved","followers_url":"https://api.github.com/users/sisibeloved/followers","following_url":"https://api.github.com/users/sisibeloved/following{/other_user}","gists_url":"https://api.github.com/users/sisibeloved/gists{/gist_id}","starred_url":"https://api.github.com/users/sisibeloved/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sisibeloved/subscriptions","organizations_url":"https://api.github.com/users/sisibeloved/orgs","repos_url":"https://api.github.com/users/sisibeloved/repos","events_url":"https://api.github.com/users/sisibeloved/events{/privacy}","received_events_url":"https://api.github.com/users/sisibeloved/received_events","type":"User","site_admin":false},"body":"`事务` => `交易`","created_at":"2018-04-25T13:01:09Z","updated_at":"2018-04-25T13:33:51Z","html_url":"https://github.com/xitu/gold-miner/pull/3701#discussion_r184049058","pull_request_url":"https://api.github.com/repos/xitu/gold-miner/pulls/3701","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/184049058"},"html":{"href":"https://github.com/xitu/gold-miner/pull/3701#discussion_r184049058"},"pull_request":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/3701"}}},"pull_request":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/3701","id":183791857,"html_url":"https://github.com/xitu/gold-miner/pull/3701","diff_url":"https://github.com/xitu/gold-miner/pull/3701.diff","patch_url":"https://github.com/xitu/gold-miner/pull/3701.patch","issue_url":"https://api.github.com/repos/xitu/gold-miner/issues/3701","number":3701,"state":"open","locked":false,"title":"用 Java 代码实现区块链","user":{"login":"Starriers","id":24243206,"avatar_url":"https://avatars2.githubusercontent.com/u/24243206?v=4","gravatar_id":"","url":"https://api.github.com/users/Starriers","html_url":"https://github.com/Starriers","followers_url":"https://api.github.com/users/Starriers/followers","following_url":"https://api.github.com/users/Starriers/following{/other_user}","gists_url":"https://api.github.com/users/Starriers/gists{/gist_id}","starred_url":"https://api.github.com/users/Starriers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Starriers/subscriptions","organizations_url":"https://api.github.com/users/Starriers/orgs","repos_url":"https://api.github.com/users/Starriers/repos","events_url":"https://api.github.com/users/Starriers/events{/privacy}","received_events_url":"https://api.github.com/users/Starriers/received_events","type":"User","site_admin":false},"body":"译文翻译完成，resolve #3693 \r\n","created_at":"2018-04-24T16:18:57Z","updated_at":"2018-04-25T13:33:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"41f8150cda77da43b980a753ee5120192d6ef0e6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":701907988,"url":"https://api.github.com/repos/xitu/gold-miner/labels/%E5%8C%BA%E5%9D%97%E9%93%BE","name":"区块链","color":"0e8a16","default":false},{"id":329563971,"url":"https://api.github.com/repos/xitu/gold-miner/labels/%E6%A0%A1%E5%AF%B9%E8%AE%A4%E9%A2%86","name":"校对认领","color":"ff5722","default":false},{"id":322084033,"url":"https://api.github.com/repos/xitu/gold-miner/labels/%E6%AD%A3%E5%9C%A8%E6%A0%A1%E5%AF%B9","name":"正在校对","color":"c2e0c6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/xitu/gold-miner/pulls/3701/commits","review_comments_url":"https://api.github.com/repos/xitu/gold-miner/pulls/3701/comments","review_comment_url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xitu/gold-miner/issues/3701/comments","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/7c2ef86f01cff52c140739a997e5d2c362031ead","head":{"label":"Starriers:translation/blockchain-implementation-with-java","ref":"translation/blockchain-implementation-with-java","sha":"7c2ef86f01cff52c140739a997e5d2c362031ead","user":{"login":"Starriers","id":24243206,"avatar_url":"https://avatars2.githubusercontent.com/u/24243206?v=4","gravatar_id":"","url":"https://api.github.com/users/Starriers","html_url":"https://github.com/Starriers","followers_url":"https://api.github.com/users/Starriers/followers","following_url":"https://api.github.com/users/Starriers/following{/other_user}","gists_url":"https://api.github.com/users/Starriers/gists{/gist_id}","starred_url":"https://api.github.com/users/Starriers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Starriers/subscriptions","organizations_url":"https://api.github.com/users/Starriers/orgs","repos_url":"https://api.github.com/users/Starriers/repos","events_url":"https://api.github.com/users/Starriers/events{/privacy}","received_events_url":"https://api.github.com/users/Starriers/received_events","type":"User","site_admin":false},"repo":{"id":123270174,"name":"gold-miner","full_name":"Starriers/gold-miner","owner":{"login":"Starriers","id":24243206,"avatar_url":"https://avatars2.githubusercontent.com/u/24243206?v=4","gravatar_id":"","url":"https://api.github.com/users/Starriers","html_url":"https://github.com/Starriers","followers_url":"https://api.github.com/users/Starriers/followers","following_url":"https://api.github.com/users/Starriers/following{/other_user}","gists_url":"https://api.github.com/users/Starriers/gists{/gist_id}","starred_url":"https://api.github.com/users/Starriers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Starriers/subscriptions","organizations_url":"https://api.github.com/users/Starriers/orgs","repos_url":"https://api.github.com/users/Starriers/repos","events_url":"https://api.github.com/users/Starriers/events{/privacy}","received_events_url":"https://api.github.com/users/Starriers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Starriers/gold-miner","description":"🥇掘金翻译计划，可能是世界最大最好的英译中技术社区，最懂读者和译者的翻译平台：","fork":true,"url":"https://api.github.com/repos/Starriers/gold-miner","forks_url":"https://api.github.com/repos/Starriers/gold-miner/forks","keys_url":"https://api.github.com/repos/Starriers/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Starriers/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Starriers/gold-miner/teams","hooks_url":"https://api.github.com/repos/Starriers/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/Starriers/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/Starriers/gold-miner/events","assignees_url":"https://api.github.com/repos/Starriers/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/Starriers/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/Starriers/gold-miner/tags","blobs_url":"https://api.github.com/repos/Starriers/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Starriers/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Starriers/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/Starriers/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Starriers/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/Starriers/gold-miner/languages","stargazers_url":"https://api.github.com/repos/Starriers/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/Starriers/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/Starriers/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/Starriers/gold-miner/subscription","commits_url":"https://api.github.com/repos/Starriers/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/Starriers/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/Starriers/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/Starriers/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/Starriers/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/Starriers/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Starriers/gold-miner/merges","archive_url":"https://api.github.com/repos/Starriers/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Starriers/gold-miner/downloads","issues_url":"https://api.github.com/repos/Starriers/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/Starriers/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/Starriers/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/Starriers/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Starriers/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/Starriers/gold-miner/releases{/id}","deployments_url":"https://api.github.com/repos/Starriers/gold-miner/deployments","created_at":"2018-02-28T10:37:28Z","updated_at":"2018-04-23T07:26:18Z","pushed_at":"2018-04-25T01:29:01Z","git_url":"git://github.com/Starriers/gold-miner.git","ssh_url":"git@github.com:Starriers/gold-miner.git","clone_url":"https://github.com/Starriers/gold-miner.git","svn_url":"https://github.com/Starriers/gold-miner","homepage":"https://juejin.im/tag/掘金翻译计划","size":31848,"stargazers_count":0,"watchers_count":0,"language":null,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xitu:master","ref":"master","sha":"2037b3f40d59a9be46c688be021396b1289a323f","user":{"login":"xitu","id":10482599,"avatar_url":"https://avatars2.githubusercontent.com/u/10482599?v=4","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"repo":{"id":45512989,"name":"gold-miner","full_name":"xitu/gold-miner","owner":{"login":"xitu","id":10482599,"avatar_url":"https://avatars2.githubusercontent.com/u/10482599?v=4","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xitu/gold-miner","description":"🥇掘金翻译计划，可能是世界最大最好的英译中技术社区，最懂读者和译者的翻译平台：","fork":false,"url":"https://api.github.com/repos/xitu/gold-miner","forks_url":"https://api.github.com/repos/xitu/gold-miner/forks","keys_url":"https://api.github.com/repos/xitu/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xitu/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xitu/gold-miner/teams","hooks_url":"https://api.github.com/repos/xitu/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/xitu/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/xitu/gold-miner/events","assignees_url":"https://api.github.com/repos/xitu/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/xitu/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/xitu/gold-miner/tags","blobs_url":"https://api.github.com/repos/xitu/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xitu/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xitu/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/xitu/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/xitu/gold-miner/languages","stargazers_url":"https://api.github.com/repos/xitu/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/xitu/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/xitu/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/xitu/gold-miner/subscription","commits_url":"https://api.github.com/repos/xitu/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/xitu/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/xitu/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/xitu/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/xitu/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/xitu/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xitu/gold-miner/merges","archive_url":"https://api.github.com/repos/xitu/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xitu/gold-miner/downloads","issues_url":"https://api.github.com/repos/xitu/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/xitu/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/xitu/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/xitu/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xitu/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/xitu/gold-miner/releases{/id}","deployments_url":"https://api.github.com/repos/xitu/gold-miner/deployments","created_at":"2015-11-04T03:29:13Z","updated_at":"2018-04-25T13:05:00Z","pushed_at":"2018-04-25T09:24:01Z","git_url":"git://github.com/xitu/gold-miner.git","ssh_url":"git@github.com:xitu/gold-miner.git","clone_url":"https://github.com/xitu/gold-miner.git","svn_url":"https://github.com/xitu/gold-miner","homepage":"https://juejin.im/tag/掘金翻译计划","size":31856,"stargazers_count":13362,"watchers_count":13362,"language":null,"has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2369,"mirror_url":null,"archived":false,"open_issues_count":30,"license":null,"forks":2369,"open_issues":30,"watchers":13362,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/3701"},"html":{"href":"https://github.com/xitu/gold-miner/pull/3701"},"issue":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/3701"},"comments":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/3701/comments"},"review_comments":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/3701/comments"},"review_comment":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/3701/commits"},"statuses":{"href":"https://api.github.com/repos/xitu/gold-miner/statuses/7c2ef86f01cff52c140739a997e5d2c362031ead"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sisibeloved"}}