{"action":"created","comment":{"url":"https://api.github.com/repos/raiden-network/raiden-contracts/pulls/comments/183888187","pull_request_review_id":114974968,"id":183888187,"diff_hunk":"@@ -61,26 +61,29 @@ def test_open_channel_state(token_network, get_accounts):\n     (A, B) = get_accounts(2)\n     settle_timeout = SETTLE_TIMEOUT_MIN + 10\n \n+    channel = token_network.call().getChannelInfo(1)\n+    assert channel[0] == 0  # settle_block_number\n+    assert channel[1] == 0  # state\n+\n     token_network.transact().openChannel(A, B, settle_timeout)\n \n     channel = token_network.call().getChannelInfo(1)\n-    assert channel[0] == settle_timeout\n-    assert channel[1] == empty_address\n-    assert channel[2] == 0\n-\n-    A_state = token_network.call().getChannelParticipantInfo(1, A)\n-    assert A_state[0] is True\n-    assert A_state[1] == 0\n-    assert A_state[2] == 0\n-    assert A_state[3] == 0\n-    assert A_state[4] == fake_bytes(32)\n-\n-    B_state = token_network.call().getChannelParticipantInfo(1, B)\n-    assert B_state[0] is True\n-    assert B_state[1] == 0\n-    assert B_state[2] == 0\n-    assert B_state[3] == 0\n-    assert B_state[4] == fake_bytes(32)\n+    assert channel[0] == settle_timeout  # settle_block_number\n+    assert channel[1] == 1  # state","path":"raiden_contracts/tests/test_channel_open.py","position":null,"original_position":38,"commit_id":"a6fd4b5c11e52a1328331474fcc9a4c01cde13dc","original_commit_id":"8bf702a991cf5ffb5eb8edc0a13155f5ed0b7c7f","user":{"login":"loredanacirstea","id":4785356,"avatar_url":"https://avatars2.githubusercontent.com/u/4785356?v=4","gravatar_id":"","url":"https://api.github.com/users/loredanacirstea","html_url":"https://github.com/loredanacirstea","followers_url":"https://api.github.com/users/loredanacirstea/followers","following_url":"https://api.github.com/users/loredanacirstea/following{/other_user}","gists_url":"https://api.github.com/users/loredanacirstea/gists{/gist_id}","starred_url":"https://api.github.com/users/loredanacirstea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loredanacirstea/subscriptions","organizations_url":"https://api.github.com/users/loredanacirstea/orgs","repos_url":"https://api.github.com/users/loredanacirstea/repos","events_url":"https://api.github.com/users/loredanacirstea/events{/privacy}","received_events_url":"https://api.github.com/users/loredanacirstea/received_events","type":"User","site_admin":false},"body":"done in https://github.com/raiden-network/raiden-contracts/pull/39/commits/a6fd4b5c11e52a1328331474fcc9a4c01cde13dc","created_at":"2018-04-24T21:37:12Z","updated_at":"2018-04-24T21:37:12Z","html_url":"https://github.com/raiden-network/raiden-contracts/pull/39#discussion_r183888187","pull_request_url":"https://api.github.com/repos/raiden-network/raiden-contracts/pulls/39","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/raiden-network/raiden-contracts/pulls/comments/183888187"},"html":{"href":"https://github.com/raiden-network/raiden-contracts/pull/39#discussion_r183888187"},"pull_request":{"href":"https://api.github.com/repos/raiden-network/raiden-contracts/pulls/39"}},"in_reply_to_id":183766129},"pull_request":{"url":"https://api.github.com/repos/raiden-network/raiden-contracts/pulls/39","id":181123864,"html_url":"https://github.com/raiden-network/raiden-contracts/pull/39","diff_url":"https://github.com/raiden-network/raiden-contracts/pull/39.diff","patch_url":"https://github.com/raiden-network/raiden-contracts/pull/39.patch","issue_url":"https://api.github.com/repos/raiden-network/raiden-contracts/issues/39","number":39,"state":"open","locked":false,"title":"Refactor SC - balance_hash, batch unlock","user":{"login":"loredanacirstea","id":4785356,"avatar_url":"https://avatars2.githubusercontent.com/u/4785356?v=4","gravatar_id":"","url":"https://api.github.com/users/loredanacirstea","html_url":"https://github.com/loredanacirstea","followers_url":"https://api.github.com/users/loredanacirstea/followers","following_url":"https://api.github.com/users/loredanacirstea/following{/other_user}","gists_url":"https://api.github.com/users/loredanacirstea/gists{/gist_id}","starred_url":"https://api.github.com/users/loredanacirstea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loredanacirstea/subscriptions","organizations_url":"https://api.github.com/users/loredanacirstea/orgs","repos_url":"https://api.github.com/users/loredanacirstea/repos","events_url":"https://api.github.com/users/loredanacirstea/events{/privacy}","received_events_url":"https://api.github.com/users/loredanacirstea/received_events","type":"User","site_admin":false},"body":"fixes https://github.com/raiden-network/spec/issues/35\r\nfixes https://github.com/raiden-network/spec/issues/31\r\n\r\nfixes https://github.com/raiden-network/raiden-contracts/issues/28\r\nfixes https://github.com/raiden-network/raiden-contracts/issues/27\r\nfixes https://github.com/raiden-network/raiden-contracts/issues/26\r\n\r\n## Summary\r\n\r\n- implements https://github.com/raiden-network/spec/pull/54\r\n  - using the balance hash in the balance proof\r\n- batch `unlock` happens after `settleChannel` because it needs to compare `locksroot` (only available in `settleChannel`) with the computer `merkle_root`\r\n- refactored `settleChannel` logic\r\n- refactored data structures\r\n\r\n(most tests are happy cases, more will be added in a separate PR)\r\n\r\n## Gas costs\r\n\r\n### Gas costs now\r\n\r\n```\r\nTokenNetworksRegistry DEPLOYMENT 3872498\r\nTokenNetworksRegistry.createERC20TokenNetwork 2576500\r\nTokenNetwork DEPLOYMENT 3355362\r\nTokenNetworksRegistry createERC20TokenNetwork 2576500\r\n\r\nTokenNetwork.openChannel 115230\r\nTokenNetwork.setDeposit 53475\r\nTokenNetwork.closeChannel 93951\r\nTokenNetwork.updateNonClosingBalanceProof 88168\r\nTokenNetwork.settleChannel 83636  # 2 token transfers\r\nTokenNetwork.unlock 1 locks 30716\r\nTokenNetwork.unlock 6 locks 64605\r\nSecretRegistry.registerSecret 45414\r\n```\r\n\r\n### Initial gas costs (current master branch)\r\n\r\n```\r\nTokenNetwork.openChannel 110826\r\nTokenNetwork.setDeposit 70862\r\nTokenNetwork.closeChannel 106721\r\nTokenNetwork.updateTransfer 67077   # updateNonClosingBalanceProof\r\nTokenNetwork.settleChannel 63701  # 2 token transfers\r\n\r\nTokenNetworkRegistry DEPLOYMENT 3224456\r\nTokenNetwork DEPLOYMENT 2734177\r\nTokenNetworkRegistry.createERC20TokenNetwork 2100525\r\nSecretRegistry.registerSecret 45508\r\n```","created_at":"2018-04-12T08:20:22Z","updated_at":"2018-04-24T21:37:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a391f40c309da25de6a1656a31e55ceb43d5880d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":868728837,"url":"https://api.github.com/repos/raiden-network/raiden-contracts/labels/dev:%20Please%20Review","name":"dev: Please Review","color":"006b75","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/raiden-network/raiden-contracts/pulls/39/commits","review_comments_url":"https://api.github.com/repos/raiden-network/raiden-contracts/pulls/39/comments","review_comment_url":"https://api.github.com/repos/raiden-network/raiden-contracts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/raiden-network/raiden-contracts/issues/39/comments","statuses_url":"https://api.github.com/repos/raiden-network/raiden-contracts/statuses/a6fd4b5c11e52a1328331474fcc9a4c01cde13dc","head":{"label":"loredanacirstea:update-privacy","ref":"update-privacy","sha":"a6fd4b5c11e52a1328331474fcc9a4c01cde13dc","user":{"login":"loredanacirstea","id":4785356,"avatar_url":"https://avatars2.githubusercontent.com/u/4785356?v=4","gravatar_id":"","url":"https://api.github.com/users/loredanacirstea","html_url":"https://github.com/loredanacirstea","followers_url":"https://api.github.com/users/loredanacirstea/followers","following_url":"https://api.github.com/users/loredanacirstea/following{/other_user}","gists_url":"https://api.github.com/users/loredanacirstea/gists{/gist_id}","starred_url":"https://api.github.com/users/loredanacirstea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loredanacirstea/subscriptions","organizations_url":"https://api.github.com/users/loredanacirstea/orgs","repos_url":"https://api.github.com/users/loredanacirstea/repos","events_url":"https://api.github.com/users/loredanacirstea/events{/privacy}","received_events_url":"https://api.github.com/users/loredanacirstea/received_events","type":"User","site_admin":false},"repo":{"id":126197199,"name":"raiden-contracts","full_name":"loredanacirstea/raiden-contracts","owner":{"login":"loredanacirstea","id":4785356,"avatar_url":"https://avatars2.githubusercontent.com/u/4785356?v=4","gravatar_id":"","url":"https://api.github.com/users/loredanacirstea","html_url":"https://github.com/loredanacirstea","followers_url":"https://api.github.com/users/loredanacirstea/followers","following_url":"https://api.github.com/users/loredanacirstea/following{/other_user}","gists_url":"https://api.github.com/users/loredanacirstea/gists{/gist_id}","starred_url":"https://api.github.com/users/loredanacirstea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loredanacirstea/subscriptions","organizations_url":"https://api.github.com/users/loredanacirstea/orgs","repos_url":"https://api.github.com/users/loredanacirstea/repos","events_url":"https://api.github.com/users/loredanacirstea/events{/privacy}","received_events_url":"https://api.github.com/users/loredanacirstea/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/loredanacirstea/raiden-contracts","description":"Raiden Network Smart Contracts","fork":true,"url":"https://api.github.com/repos/loredanacirstea/raiden-contracts","forks_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/forks","keys_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/teams","hooks_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/hooks","issue_events_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/issues/events{/number}","events_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/events","assignees_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/assignees{/user}","branches_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/branches{/branch}","tags_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/tags","blobs_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/git/refs{/sha}","trees_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/statuses/{sha}","languages_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/languages","stargazers_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/stargazers","contributors_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/contributors","subscribers_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/subscribers","subscription_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/subscription","commits_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/commits{/sha}","git_commits_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/git/commits{/sha}","comments_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/comments{/number}","issue_comment_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/issues/comments{/number}","contents_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/contents/{+path}","compare_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/merges","archive_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/downloads","issues_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/issues{/number}","pulls_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/pulls{/number}","milestones_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/milestones{/number}","notifications_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/labels{/name}","releases_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/releases{/id}","deployments_url":"https://api.github.com/repos/loredanacirstea/raiden-contracts/deployments","created_at":"2018-03-21T15:07:34Z","updated_at":"2018-04-12T08:17:00Z","pushed_at":"2018-04-24T21:21:21Z","git_url":"git://github.com/loredanacirstea/raiden-contracts.git","ssh_url":"git@github.com:loredanacirstea/raiden-contracts.git","clone_url":"https://github.com/loredanacirstea/raiden-contracts.git","svn_url":"https://github.com/loredanacirstea/raiden-contracts","homepage":"","size":136,"stargazers_count":0,"watchers_count":0,"language":"Python","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":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"raiden-network:master","ref":"master","sha":"861dd94d2d7d776c827383ee44e6a6e521f39989","user":{"login":"raiden-network","id":19666847,"avatar_url":"https://avatars1.githubusercontent.com/u/19666847?v=4","gravatar_id":"","url":"https://api.github.com/users/raiden-network","html_url":"https://github.com/raiden-network","followers_url":"https://api.github.com/users/raiden-network/followers","following_url":"https://api.github.com/users/raiden-network/following{/other_user}","gists_url":"https://api.github.com/users/raiden-network/gists{/gist_id}","starred_url":"https://api.github.com/users/raiden-network/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raiden-network/subscriptions","organizations_url":"https://api.github.com/users/raiden-network/orgs","repos_url":"https://api.github.com/users/raiden-network/repos","events_url":"https://api.github.com/users/raiden-network/events{/privacy}","received_events_url":"https://api.github.com/users/raiden-network/received_events","type":"Organization","site_admin":false},"repo":{"id":123951681,"name":"raiden-contracts","full_name":"raiden-network/raiden-contracts","owner":{"login":"raiden-network","id":19666847,"avatar_url":"https://avatars1.githubusercontent.com/u/19666847?v=4","gravatar_id":"","url":"https://api.github.com/users/raiden-network","html_url":"https://github.com/raiden-network","followers_url":"https://api.github.com/users/raiden-network/followers","following_url":"https://api.github.com/users/raiden-network/following{/other_user}","gists_url":"https://api.github.com/users/raiden-network/gists{/gist_id}","starred_url":"https://api.github.com/users/raiden-network/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raiden-network/subscriptions","organizations_url":"https://api.github.com/users/raiden-network/orgs","repos_url":"https://api.github.com/users/raiden-network/repos","events_url":"https://api.github.com/users/raiden-network/events{/privacy}","received_events_url":"https://api.github.com/users/raiden-network/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/raiden-network/raiden-contracts","description":"Raiden Network Smart Contracts","fork":false,"url":"https://api.github.com/repos/raiden-network/raiden-contracts","forks_url":"https://api.github.com/repos/raiden-network/raiden-contracts/forks","keys_url":"https://api.github.com/repos/raiden-network/raiden-contracts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/raiden-network/raiden-contracts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/raiden-network/raiden-contracts/teams","hooks_url":"https://api.github.com/repos/raiden-network/raiden-contracts/hooks","issue_events_url":"https://api.github.com/repos/raiden-network/raiden-contracts/issues/events{/number}","events_url":"https://api.github.com/repos/raiden-network/raiden-contracts/events","assignees_url":"https://api.github.com/repos/raiden-network/raiden-contracts/assignees{/user}","branches_url":"https://api.github.com/repos/raiden-network/raiden-contracts/branches{/branch}","tags_url":"https://api.github.com/repos/raiden-network/raiden-contracts/tags","blobs_url":"https://api.github.com/repos/raiden-network/raiden-contracts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/raiden-network/raiden-contracts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/raiden-network/raiden-contracts/git/refs{/sha}","trees_url":"https://api.github.com/repos/raiden-network/raiden-contracts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/raiden-network/raiden-contracts/statuses/{sha}","languages_url":"https://api.github.com/repos/raiden-network/raiden-contracts/languages","stargazers_url":"https://api.github.com/repos/raiden-network/raiden-contracts/stargazers","contributors_url":"https://api.github.com/repos/raiden-network/raiden-contracts/contributors","subscribers_url":"https://api.github.com/repos/raiden-network/raiden-contracts/subscribers","subscription_url":"https://api.github.com/repos/raiden-network/raiden-contracts/subscription","commits_url":"https://api.github.com/repos/raiden-network/raiden-contracts/commits{/sha}","git_commits_url":"https://api.github.com/repos/raiden-network/raiden-contracts/git/commits{/sha}","comments_url":"https://api.github.com/repos/raiden-network/raiden-contracts/comments{/number}","issue_comment_url":"https://api.github.com/repos/raiden-network/raiden-contracts/issues/comments{/number}","contents_url":"https://api.github.com/repos/raiden-network/raiden-contracts/contents/{+path}","compare_url":"https://api.github.com/repos/raiden-network/raiden-contracts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/raiden-network/raiden-contracts/merges","archive_url":"https://api.github.com/repos/raiden-network/raiden-contracts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/raiden-network/raiden-contracts/downloads","issues_url":"https://api.github.com/repos/raiden-network/raiden-contracts/issues{/number}","pulls_url":"https://api.github.com/repos/raiden-network/raiden-contracts/pulls{/number}","milestones_url":"https://api.github.com/repos/raiden-network/raiden-contracts/milestones{/number}","notifications_url":"https://api.github.com/repos/raiden-network/raiden-contracts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/raiden-network/raiden-contracts/labels{/name}","releases_url":"https://api.github.com/repos/raiden-network/raiden-contracts/releases{/id}","deployments_url":"https://api.github.com/repos/raiden-network/raiden-contracts/deployments","created_at":"2018-03-05T17:06:47Z","updated_at":"2018-04-06T22:16:58Z","pushed_at":"2018-04-24T21:21:24Z","git_url":"git://github.com/raiden-network/raiden-contracts.git","ssh_url":"git@github.com:raiden-network/raiden-contracts.git","clone_url":"https://github.com/raiden-network/raiden-contracts.git","svn_url":"https://github.com/raiden-network/raiden-contracts","homepage":"","size":100,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":7,"open_issues":20,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/raiden-network/raiden-contracts/pulls/39"},"html":{"href":"https://github.com/raiden-network/raiden-contracts/pull/39"},"issue":{"href":"https://api.github.com/repos/raiden-network/raiden-contracts/issues/39"},"comments":{"href":"https://api.github.com/repos/raiden-network/raiden-contracts/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/raiden-network/raiden-contracts/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/raiden-network/raiden-contracts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/raiden-network/raiden-contracts/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/raiden-network/raiden-contracts/statuses/a6fd4b5c11e52a1328331474fcc9a4c01cde13dc"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"loredanacirstea"}}