{"action":"created","comment":{"url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/comments/228105027","pull_request_review_id":168290676,"id":228105027,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODEwNTAyNw==","diff_hunk":"@@ -0,0 +1,121 @@\n+/*\n+ * Copyright 2018 The Exonum Team\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ *\n+ */\n+\n+package com.exonum.binding.common.message;\n+\n+import static com.exonum.binding.common.message.TransactionMessage.MIN_MESSAGE_SIZE;\n+import static org.hamcrest.MatcherAssert.assertThat;\n+import static org.hamcrest.Matchers.is;\n+import static org.hamcrest.Matchers.not;\n+import static org.junit.jupiter.api.Assertions.assertThrows;\n+\n+import com.exonum.binding.common.crypto.CryptoFunction;\n+import com.exonum.binding.common.crypto.CryptoFunctions;\n+import com.exonum.binding.common.crypto.KeyPair;\n+import com.exonum.binding.test.Bytes;\n+import com.google.common.collect.ImmutableList;\n+import java.util.List;\n+import nl.jqno.equalsverifier.EqualsVerifier;\n+import org.junit.jupiter.api.Test;\n+import org.junit.jupiter.params.ParameterizedTest;\n+import org.junit.jupiter.params.provider.MethodSource;\n+\n+class BinaryTransactionMessageTest {\n+\n+  private static final CryptoFunction CRYPTO = CryptoFunctions.ed25519();\n+  private static final KeyPair KEYS = CRYPTO.generateKeyPair();\n+\n+  @Test\n+  void equalsTest() {\n+    EqualsVerifier\n+        .forClass(BinaryTransactionMessage.class)\n+        .verify();\n+  }\n+\n+  @Test\n+  void immutabilityTest() {\n+    byte[] mutableIn = Bytes.bytes(0x00, 0x01, 0x02);\n+    TransactionMessage message = TransactionMessage.builder()\n+        .serviceId((short) 100)\n+        .transactionId((short) 200)\n+        .payload(mutableIn)\n+        .sign(KEYS, CRYPTO);\n+\n+    // mutate input parameter\n+    mutate(mutableIn);\n+    assertThat(message.getPayload(), not(mutableIn));\n+\n+    // mutate output parameters\n+    byte[] mutablePayload = message.getPayload();\n+    mutate(mutablePayload);\n+    assertThat(message.getPayload(), not(mutablePayload));\n+\n+    byte[] mutableAuthor = message.getAuthor().toBytes();\n+    mutate(mutableAuthor);\n+    assertThat(message.getAuthor().toBytes(), not(mutableAuthor));\n+\n+    byte[] mutableSignature = message.getSignature();\n+    mutate(mutableSignature);\n+    assertThat(message.getSignature(), not(mutableSignature));\n+\n+    byte[] mutableHash = message.hash().asBytes();","path":"exonum-java-binding-common/src/test/java/com/exonum/binding/common/message/BinaryTransactionMessageTest.java","position":75,"original_position":75,"commit_id":"b697f17a1fd84658ed2a06a4eab8f7c1f3f5c984","original_commit_id":"b697f17a1fd84658ed2a06a4eab8f7c1f3f5c984","user":{"login":"dmitry-timofeev","id":7531824,"node_id":"MDQ6VXNlcjc1MzE4MjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/7531824?v=4","gravatar_id":"","url":"https://api.github.com/users/dmitry-timofeev","html_url":"https://github.com/dmitry-timofeev","followers_url":"https://api.github.com/users/dmitry-timofeev/followers","following_url":"https://api.github.com/users/dmitry-timofeev/following{/other_user}","gists_url":"https://api.github.com/users/dmitry-timofeev/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitry-timofeev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitry-timofeev/subscriptions","organizations_url":"https://api.github.com/users/dmitry-timofeev/orgs","repos_url":"https://api.github.com/users/dmitry-timofeev/repos","events_url":"https://api.github.com/users/dmitry-timofeev/events{/privacy}","received_events_url":"https://api.github.com/users/dmitry-timofeev/received_events","type":"User","site_admin":false},"body":"HashCode is not mutable","created_at":"2018-10-25T09:44:42Z","updated_at":"2018-10-25T09:47:16Z","html_url":"https://github.com/exonum/exonum-java-binding/pull/534#discussion_r228105027","pull_request_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/534","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/comments/228105027"},"html":{"href":"https://github.com/exonum/exonum-java-binding/pull/534#discussion_r228105027"},"pull_request":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/534"}}},"pull_request":{"url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/534","id":223588923,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzNTg4OTIz","html_url":"https://github.com/exonum/exonum-java-binding/pull/534","diff_url":"https://github.com/exonum/exonum-java-binding/pull/534.diff","patch_url":"https://github.com/exonum/exonum-java-binding/pull/534.patch","issue_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues/534","number":534,"state":"open","locked":false,"title":"Implemented Transaction Message. [ECR-2377]","user":{"login":"bullet-tooth","id":5055052,"node_id":"MDQ6VXNlcjUwNTUwNTI=","avatar_url":"https://avatars1.githubusercontent.com/u/5055052?v=4","gravatar_id":"","url":"https://api.github.com/users/bullet-tooth","html_url":"https://github.com/bullet-tooth","followers_url":"https://api.github.com/users/bullet-tooth/followers","following_url":"https://api.github.com/users/bullet-tooth/following{/other_user}","gists_url":"https://api.github.com/users/bullet-tooth/gists{/gist_id}","starred_url":"https://api.github.com/users/bullet-tooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bullet-tooth/subscriptions","organizations_url":"https://api.github.com/users/bullet-tooth/orgs","repos_url":"https://api.github.com/users/bullet-tooth/repos","events_url":"https://api.github.com/users/bullet-tooth/events{/privacy}","received_events_url":"https://api.github.com/users/bullet-tooth/received_events","type":"User","site_admin":false},"body":"## Overview\r\nTransaction Message builder implementation\r\n\r\n---\r\nSee: https://jira.bf.local/browse/ECR-2377\r\n\r\n### Definition of Done\r\n\r\n- [x] There is no TODOs left in the code\r\n- [x] Change is covered by automated [tests](https://github.com/exonum/exonum-java-binding/blob/master/CONTRIBUTING.md#tests)\r\n- [x] The [coding guidelines](https://github.com/exonum/exonum-java-binding/blob/master/CONTRIBUTING.md#the-code-style) are followed\r\n- [x] Public API has Javadoc\r\n- [x] Method preconditions are checked and documented in the Javadoc of the method\r\n- [x] Changelog is updated if needed (in case of notable or breaking changes)\r\n- [x] The continuous integration build passes\r\n","created_at":"2018-10-17T12:46:07Z","updated_at":"2018-10-25T09:47:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d2677dda8c3b07b1f8e6b52232372d2879df7c4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/534/commits","review_comments_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/534/comments","review_comment_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/comments{/number}","comments_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues/534/comments","statuses_url":"https://api.github.com/repos/exonum/exonum-java-binding/statuses/b697f17a1fd84658ed2a06a4eab8f7c1f3f5c984","head":{"label":"exonum:ecr-2377","ref":"ecr-2377","sha":"b697f17a1fd84658ed2a06a4eab8f7c1f3f5c984","user":{"login":"exonum","id":23138442,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTM4NDQy","avatar_url":"https://avatars1.githubusercontent.com/u/23138442?v=4","gravatar_id":"","url":"https://api.github.com/users/exonum","html_url":"https://github.com/exonum","followers_url":"https://api.github.com/users/exonum/followers","following_url":"https://api.github.com/users/exonum/following{/other_user}","gists_url":"https://api.github.com/users/exonum/gists{/gist_id}","starred_url":"https://api.github.com/users/exonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exonum/subscriptions","organizations_url":"https://api.github.com/users/exonum/orgs","repos_url":"https://api.github.com/users/exonum/repos","events_url":"https://api.github.com/users/exonum/events{/privacy}","received_events_url":"https://api.github.com/users/exonum/received_events","type":"Organization","site_admin":false},"repo":{"id":92375988,"node_id":"MDEwOlJlcG9zaXRvcnk5MjM3NTk4OA==","name":"exonum-java-binding","full_name":"exonum/exonum-java-binding","private":false,"owner":{"login":"exonum","id":23138442,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTM4NDQy","avatar_url":"https://avatars1.githubusercontent.com/u/23138442?v=4","gravatar_id":"","url":"https://api.github.com/users/exonum","html_url":"https://github.com/exonum","followers_url":"https://api.github.com/users/exonum/followers","following_url":"https://api.github.com/users/exonum/following{/other_user}","gists_url":"https://api.github.com/users/exonum/gists{/gist_id}","starred_url":"https://api.github.com/users/exonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exonum/subscriptions","organizations_url":"https://api.github.com/users/exonum/orgs","repos_url":"https://api.github.com/users/exonum/repos","events_url":"https://api.github.com/users/exonum/events{/privacy}","received_events_url":"https://api.github.com/users/exonum/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/exonum/exonum-java-binding","description":"Java Binding for the Exonum blockchain framework","fork":false,"url":"https://api.github.com/repos/exonum/exonum-java-binding","forks_url":"https://api.github.com/repos/exonum/exonum-java-binding/forks","keys_url":"https://api.github.com/repos/exonum/exonum-java-binding/keys{/key_id}","collaborators_url":"https://api.github.com/repos/exonum/exonum-java-binding/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/exonum/exonum-java-binding/teams","hooks_url":"https://api.github.com/repos/exonum/exonum-java-binding/hooks","issue_events_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues/events{/number}","events_url":"https://api.github.com/repos/exonum/exonum-java-binding/events","assignees_url":"https://api.github.com/repos/exonum/exonum-java-binding/assignees{/user}","branches_url":"https://api.github.com/repos/exonum/exonum-java-binding/branches{/branch}","tags_url":"https://api.github.com/repos/exonum/exonum-java-binding/tags","blobs_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/refs{/sha}","trees_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/trees{/sha}","statuses_url":"https://api.github.com/repos/exonum/exonum-java-binding/statuses/{sha}","languages_url":"https://api.github.com/repos/exonum/exonum-java-binding/languages","stargazers_url":"https://api.github.com/repos/exonum/exonum-java-binding/stargazers","contributors_url":"https://api.github.com/repos/exonum/exonum-java-binding/contributors","subscribers_url":"https://api.github.com/repos/exonum/exonum-java-binding/subscribers","subscription_url":"https://api.github.com/repos/exonum/exonum-java-binding/subscription","commits_url":"https://api.github.com/repos/exonum/exonum-java-binding/commits{/sha}","git_commits_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/commits{/sha}","comments_url":"https://api.github.com/repos/exonum/exonum-java-binding/comments{/number}","issue_comment_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues/comments{/number}","contents_url":"https://api.github.com/repos/exonum/exonum-java-binding/contents/{+path}","compare_url":"https://api.github.com/repos/exonum/exonum-java-binding/compare/{base}...{head}","merges_url":"https://api.github.com/repos/exonum/exonum-java-binding/merges","archive_url":"https://api.github.com/repos/exonum/exonum-java-binding/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/exonum/exonum-java-binding/downloads","issues_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues{/number}","pulls_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls{/number}","milestones_url":"https://api.github.com/repos/exonum/exonum-java-binding/milestones{/number}","notifications_url":"https://api.github.com/repos/exonum/exonum-java-binding/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/exonum/exonum-java-binding/labels{/name}","releases_url":"https://api.github.com/repos/exonum/exonum-java-binding/releases{/id}","deployments_url":"https://api.github.com/repos/exonum/exonum-java-binding/deployments","created_at":"2017-05-25T07:12:56Z","updated_at":"2018-10-24T19:50:16Z","pushed_at":"2018-10-25T08:30:13Z","git_url":"git://github.com/exonum/exonum-java-binding.git","ssh_url":"git@github.com:exonum/exonum-java-binding.git","clone_url":"https://github.com/exonum/exonum-java-binding.git","svn_url":"https://github.com/exonum/exonum-java-binding","homepage":"http://exonum.com","size":2548,"stargazers_count":44,"watchers_count":44,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":14,"open_issues":15,"watchers":44,"default_branch":"master"}},"base":{"label":"exonum:master","ref":"master","sha":"cffdc1ebd55150af3af296f6ffe34265ba1974cb","user":{"login":"exonum","id":23138442,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTM4NDQy","avatar_url":"https://avatars1.githubusercontent.com/u/23138442?v=4","gravatar_id":"","url":"https://api.github.com/users/exonum","html_url":"https://github.com/exonum","followers_url":"https://api.github.com/users/exonum/followers","following_url":"https://api.github.com/users/exonum/following{/other_user}","gists_url":"https://api.github.com/users/exonum/gists{/gist_id}","starred_url":"https://api.github.com/users/exonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exonum/subscriptions","organizations_url":"https://api.github.com/users/exonum/orgs","repos_url":"https://api.github.com/users/exonum/repos","events_url":"https://api.github.com/users/exonum/events{/privacy}","received_events_url":"https://api.github.com/users/exonum/received_events","type":"Organization","site_admin":false},"repo":{"id":92375988,"node_id":"MDEwOlJlcG9zaXRvcnk5MjM3NTk4OA==","name":"exonum-java-binding","full_name":"exonum/exonum-java-binding","private":false,"owner":{"login":"exonum","id":23138442,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTM4NDQy","avatar_url":"https://avatars1.githubusercontent.com/u/23138442?v=4","gravatar_id":"","url":"https://api.github.com/users/exonum","html_url":"https://github.com/exonum","followers_url":"https://api.github.com/users/exonum/followers","following_url":"https://api.github.com/users/exonum/following{/other_user}","gists_url":"https://api.github.com/users/exonum/gists{/gist_id}","starred_url":"https://api.github.com/users/exonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exonum/subscriptions","organizations_url":"https://api.github.com/users/exonum/orgs","repos_url":"https://api.github.com/users/exonum/repos","events_url":"https://api.github.com/users/exonum/events{/privacy}","received_events_url":"https://api.github.com/users/exonum/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/exonum/exonum-java-binding","description":"Java Binding for the Exonum blockchain framework","fork":false,"url":"https://api.github.com/repos/exonum/exonum-java-binding","forks_url":"https://api.github.com/repos/exonum/exonum-java-binding/forks","keys_url":"https://api.github.com/repos/exonum/exonum-java-binding/keys{/key_id}","collaborators_url":"https://api.github.com/repos/exonum/exonum-java-binding/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/exonum/exonum-java-binding/teams","hooks_url":"https://api.github.com/repos/exonum/exonum-java-binding/hooks","issue_events_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues/events{/number}","events_url":"https://api.github.com/repos/exonum/exonum-java-binding/events","assignees_url":"https://api.github.com/repos/exonum/exonum-java-binding/assignees{/user}","branches_url":"https://api.github.com/repos/exonum/exonum-java-binding/branches{/branch}","tags_url":"https://api.github.com/repos/exonum/exonum-java-binding/tags","blobs_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/refs{/sha}","trees_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/trees{/sha}","statuses_url":"https://api.github.com/repos/exonum/exonum-java-binding/statuses/{sha}","languages_url":"https://api.github.com/repos/exonum/exonum-java-binding/languages","stargazers_url":"https://api.github.com/repos/exonum/exonum-java-binding/stargazers","contributors_url":"https://api.github.com/repos/exonum/exonum-java-binding/contributors","subscribers_url":"https://api.github.com/repos/exonum/exonum-java-binding/subscribers","subscription_url":"https://api.github.com/repos/exonum/exonum-java-binding/subscription","commits_url":"https://api.github.com/repos/exonum/exonum-java-binding/commits{/sha}","git_commits_url":"https://api.github.com/repos/exonum/exonum-java-binding/git/commits{/sha}","comments_url":"https://api.github.com/repos/exonum/exonum-java-binding/comments{/number}","issue_comment_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues/comments{/number}","contents_url":"https://api.github.com/repos/exonum/exonum-java-binding/contents/{+path}","compare_url":"https://api.github.com/repos/exonum/exonum-java-binding/compare/{base}...{head}","merges_url":"https://api.github.com/repos/exonum/exonum-java-binding/merges","archive_url":"https://api.github.com/repos/exonum/exonum-java-binding/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/exonum/exonum-java-binding/downloads","issues_url":"https://api.github.com/repos/exonum/exonum-java-binding/issues{/number}","pulls_url":"https://api.github.com/repos/exonum/exonum-java-binding/pulls{/number}","milestones_url":"https://api.github.com/repos/exonum/exonum-java-binding/milestones{/number}","notifications_url":"https://api.github.com/repos/exonum/exonum-java-binding/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/exonum/exonum-java-binding/labels{/name}","releases_url":"https://api.github.com/repos/exonum/exonum-java-binding/releases{/id}","deployments_url":"https://api.github.com/repos/exonum/exonum-java-binding/deployments","created_at":"2017-05-25T07:12:56Z","updated_at":"2018-10-24T19:50:16Z","pushed_at":"2018-10-25T08:30:13Z","git_url":"git://github.com/exonum/exonum-java-binding.git","ssh_url":"git@github.com:exonum/exonum-java-binding.git","clone_url":"https://github.com/exonum/exonum-java-binding.git","svn_url":"https://github.com/exonum/exonum-java-binding","homepage":"http://exonum.com","size":2548,"stargazers_count":44,"watchers_count":44,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":14,"open_issues":15,"watchers":44,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/534"},"html":{"href":"https://github.com/exonum/exonum-java-binding/pull/534"},"issue":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/issues/534"},"comments":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/issues/534/comments"},"review_comments":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/534/comments"},"review_comment":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/pulls/534/commits"},"statuses":{"href":"https://api.github.com/repos/exonum/exonum-java-binding/statuses/b697f17a1fd84658ed2a06a4eab8f7c1f3f5c984"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"dmitry-timofeev"}}