{"action":"created","comment":{"url":"https://api.github.com/repos/CodeChain-io/codechain/pulls/comments/310436362","pull_request_review_id":270555033,"id":310436362,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxMDQzNjM2Mg==","diff_hunk":"@@ -138,7 +139,95 @@ async function afterBanCheck(sdk: SDK, bestBlockNumber: number) {\n \n describe(\"Report Double Vote\", function() {\n     const promiseExpect = new PromiseExpect();\n-    const termSeconds = 20;\n+\n+    async function getPossibleAuthorsByString(\n+        sdk: SDK,\n+        blockNumber: number\n+    ): Promise<string[]> {\n+        return (await stake.getPossibleAuthors(sdk, blockNumber))!.map(\n+            platfromAddr => platfromAddr.toString()\n+        );\n+    }\n+\n+    describe(\"Ban from the validator state\", async function() {\n+        const nodes = withNodes(this, {\n+            promiseExpect,\n+            validators: allDynValidators.map((signer, index) => ({\n+                signer,\n+                delegation: 5_000,\n+                deposit: 10_000_000 - index // tie-breaker\n+            }))\n+        });\n+\n+        it(\"alice should be banned from the validators\", async function() {\n+            const secsPerblock = 3;\n+            this.slow(secsPerblock * 7 * 1000);\n+            this.timeout(secsPerblock * 14 * 1000);\n+\n+            const checkingNode = nodes[1];\n+            const blockNumber = await checkingNode.sdk.rpc.chain.getBestBlockNumber();\n+            const termMedata = await stake.getTermMetadata(\n+                checkingNode.sdk,\n+                blockNumber\n+            );\n+            const currentTermInitialBlockNumber =\n+                termMedata!.lastTermFinishedBlockNumber + 1;\n+            expect(termMedata!.currentTermId).to.be.equals(1);\n+            await beforeBanCheck(\n+                checkingNode.sdk,\n+                currentTermInitialBlockNumber\n+            );\n+            await checkingNode.waitBlockNumber(\n+                currentTermInitialBlockNumber + 2\n+            );\n+            const aliceAddr = alice.platformAddress.toString();\n+\n+            const aliceIdxInBestBlock = (await getPossibleAuthorsByString(\n+                checkingNode.sdk,\n+                currentTermInitialBlockNumber\n+            )).indexOf(aliceAddr);\n+\n+            const alicePrivkey = alice.privateKey;\n+            const consensusMessage1 = encodableMessage({\n+                height: currentTermInitialBlockNumber,\n+                view: 0,\n+                step: \"precommit\",\n+                blockHash: new H256(\n+                    \"730f75dafd73e047b86acb2dbd74e75dcb93272fa084a9082848f2341aa1abb6\"","path":"test/src/e2e.dynval/dv.double-vote.test.ts","position":194,"original_position":80,"commit_id":"77f0cd2560007255eb708fa4c649d91ad5454af8","original_commit_id":"85d11c192792abc2b9d193e3fcb7a883fd255a94","user":{"login":"Remagpie","id":8017201,"node_id":"MDQ6VXNlcjgwMTcyMDE=","avatar_url":"https://avatars1.githubusercontent.com/u/8017201?v=4","gravatar_id":"","url":"https://api.github.com/users/Remagpie","html_url":"https://github.com/Remagpie","followers_url":"https://api.github.com/users/Remagpie/followers","following_url":"https://api.github.com/users/Remagpie/following{/other_user}","gists_url":"https://api.github.com/users/Remagpie/gists{/gist_id}","starred_url":"https://api.github.com/users/Remagpie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Remagpie/subscriptions","organizations_url":"https://api.github.com/users/Remagpie/orgs","repos_url":"https://api.github.com/users/Remagpie/repos","events_url":"https://api.github.com/users/Remagpie/events{/privacy}","received_events_url":"https://api.github.com/users/Remagpie/received_events","type":"User","site_admin":false},"body":"Is this just a random string?","created_at":"2019-08-05T04:40:37Z","updated_at":"2019-08-05T04:45:08Z","html_url":"https://github.com/CodeChain-io/codechain/pull/1712#discussion_r310436362","pull_request_url":"https://api.github.com/repos/CodeChain-io/codechain/pulls/1712","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/CodeChain-io/codechain/pulls/comments/310436362"},"html":{"href":"https://github.com/CodeChain-io/codechain/pull/1712#discussion_r310436362"},"pull_request":{"href":"https://api.github.com/repos/CodeChain-io/codechain/pulls/1712"}}},"pull_request":{"url":"https://api.github.com/repos/CodeChain-io/codechain/pulls/1712","id":299860791,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjk5ODYwNzkx","html_url":"https://github.com/CodeChain-io/codechain/pull/1712","diff_url":"https://github.com/CodeChain-io/codechain/pull/1712.diff","patch_url":"https://github.com/CodeChain-io/codechain/pull/1712.patch","issue_url":"https://api.github.com/repos/CodeChain-io/codechain/issues/1712","number":1712,"state":"open","locked":false,"title":"Add test cases to the test suite \"Double vote\"","user":{"login":"HoOngEe","id":20704471,"node_id":"MDQ6VXNlcjIwNzA0NDcx","avatar_url":"https://avatars3.githubusercontent.com/u/20704471?v=4","gravatar_id":"","url":"https://api.github.com/users/HoOngEe","html_url":"https://github.com/HoOngEe","followers_url":"https://api.github.com/users/HoOngEe/followers","following_url":"https://api.github.com/users/HoOngEe/following{/other_user}","gists_url":"https://api.github.com/users/HoOngEe/gists{/gist_id}","starred_url":"https://api.github.com/users/HoOngEe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HoOngEe/subscriptions","organizations_url":"https://api.github.com/users/HoOngEe/orgs","repos_url":"https://api.github.com/users/HoOngEe/repos","events_url":"https://api.github.com/users/HoOngEe/events{/privacy}","received_events_url":"https://api.github.com/users/HoOngEe/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-07-22T12:41:44Z","updated_at":"2019-08-05T04:45:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1fbae0776e9c75995b139c5cd7cd8dbf28174c06","assignee":null,"assignees":[],"requested_reviewers":[{"login":"foriequal0","id":5465658,"node_id":"MDQ6VXNlcjU0NjU2NTg=","avatar_url":"https://avatars1.githubusercontent.com/u/5465658?v=4","gravatar_id":"","url":"https://api.github.com/users/foriequal0","html_url":"https://github.com/foriequal0","followers_url":"https://api.github.com/users/foriequal0/followers","following_url":"https://api.github.com/users/foriequal0/following{/other_user}","gists_url":"https://api.github.com/users/foriequal0/gists{/gist_id}","starred_url":"https://api.github.com/users/foriequal0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foriequal0/subscriptions","organizations_url":"https://api.github.com/users/foriequal0/orgs","repos_url":"https://api.github.com/users/foriequal0/repos","events_url":"https://api.github.com/users/foriequal0/events{/privacy}","received_events_url":"https://api.github.com/users/foriequal0/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/CodeChain-io/codechain/pulls/1712/commits","review_comments_url":"https://api.github.com/repos/CodeChain-io/codechain/pulls/1712/comments","review_comment_url":"https://api.github.com/repos/CodeChain-io/codechain/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CodeChain-io/codechain/issues/1712/comments","statuses_url":"https://api.github.com/repos/CodeChain-io/codechain/statuses/77f0cd2560007255eb708fa4c649d91ad5454af8","head":{"label":"HoOngEe:test/double-vote","ref":"test/double-vote","sha":"77f0cd2560007255eb708fa4c649d91ad5454af8","user":{"login":"HoOngEe","id":20704471,"node_id":"MDQ6VXNlcjIwNzA0NDcx","avatar_url":"https://avatars3.githubusercontent.com/u/20704471?v=4","gravatar_id":"","url":"https://api.github.com/users/HoOngEe","html_url":"https://github.com/HoOngEe","followers_url":"https://api.github.com/users/HoOngEe/followers","following_url":"https://api.github.com/users/HoOngEe/following{/other_user}","gists_url":"https://api.github.com/users/HoOngEe/gists{/gist_id}","starred_url":"https://api.github.com/users/HoOngEe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HoOngEe/subscriptions","organizations_url":"https://api.github.com/users/HoOngEe/orgs","repos_url":"https://api.github.com/users/HoOngEe/repos","events_url":"https://api.github.com/users/HoOngEe/events{/privacy}","received_events_url":"https://api.github.com/users/HoOngEe/received_events","type":"User","site_admin":false},"repo":{"id":163825572,"node_id":"MDEwOlJlcG9zaXRvcnkxNjM4MjU1NzI=","name":"codechain","full_name":"HoOngEe/codechain","private":false,"owner":{"login":"HoOngEe","id":20704471,"node_id":"MDQ6VXNlcjIwNzA0NDcx","avatar_url":"https://avatars3.githubusercontent.com/u/20704471?v=4","gravatar_id":"","url":"https://api.github.com/users/HoOngEe","html_url":"https://github.com/HoOngEe","followers_url":"https://api.github.com/users/HoOngEe/followers","following_url":"https://api.github.com/users/HoOngEe/following{/other_user}","gists_url":"https://api.github.com/users/HoOngEe/gists{/gist_id}","starred_url":"https://api.github.com/users/HoOngEe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HoOngEe/subscriptions","organizations_url":"https://api.github.com/users/HoOngEe/orgs","repos_url":"https://api.github.com/users/HoOngEe/repos","events_url":"https://api.github.com/users/HoOngEe/events{/privacy}","received_events_url":"https://api.github.com/users/HoOngEe/received_events","type":"User","site_admin":false},"html_url":"https://github.com/HoOngEe/codechain","description":"Programmable multi-asset chain","fork":true,"url":"https://api.github.com/repos/HoOngEe/codechain","forks_url":"https://api.github.com/repos/HoOngEe/codechain/forks","keys_url":"https://api.github.com/repos/HoOngEe/codechain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HoOngEe/codechain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HoOngEe/codechain/teams","hooks_url":"https://api.github.com/repos/HoOngEe/codechain/hooks","issue_events_url":"https://api.github.com/repos/HoOngEe/codechain/issues/events{/number}","events_url":"https://api.github.com/repos/HoOngEe/codechain/events","assignees_url":"https://api.github.com/repos/HoOngEe/codechain/assignees{/user}","branches_url":"https://api.github.com/repos/HoOngEe/codechain/branches{/branch}","tags_url":"https://api.github.com/repos/HoOngEe/codechain/tags","blobs_url":"https://api.github.com/repos/HoOngEe/codechain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HoOngEe/codechain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HoOngEe/codechain/git/refs{/sha}","trees_url":"https://api.github.com/repos/HoOngEe/codechain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HoOngEe/codechain/statuses/{sha}","languages_url":"https://api.github.com/repos/HoOngEe/codechain/languages","stargazers_url":"https://api.github.com/repos/HoOngEe/codechain/stargazers","contributors_url":"https://api.github.com/repos/HoOngEe/codechain/contributors","subscribers_url":"https://api.github.com/repos/HoOngEe/codechain/subscribers","subscription_url":"https://api.github.com/repos/HoOngEe/codechain/subscription","commits_url":"https://api.github.com/repos/HoOngEe/codechain/commits{/sha}","git_commits_url":"https://api.github.com/repos/HoOngEe/codechain/git/commits{/sha}","comments_url":"https://api.github.com/repos/HoOngEe/codechain/comments{/number}","issue_comment_url":"https://api.github.com/repos/HoOngEe/codechain/issues/comments{/number}","contents_url":"https://api.github.com/repos/HoOngEe/codechain/contents/{+path}","compare_url":"https://api.github.com/repos/HoOngEe/codechain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HoOngEe/codechain/merges","archive_url":"https://api.github.com/repos/HoOngEe/codechain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HoOngEe/codechain/downloads","issues_url":"https://api.github.com/repos/HoOngEe/codechain/issues{/number}","pulls_url":"https://api.github.com/repos/HoOngEe/codechain/pulls{/number}","milestones_url":"https://api.github.com/repos/HoOngEe/codechain/milestones{/number}","notifications_url":"https://api.github.com/repos/HoOngEe/codechain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HoOngEe/codechain/labels{/name}","releases_url":"https://api.github.com/repos/HoOngEe/codechain/releases{/id}","deployments_url":"https://api.github.com/repos/HoOngEe/codechain/deployments","created_at":"2019-01-02T10:15:04Z","updated_at":"2019-08-02T06:39:52Z","pushed_at":"2019-08-02T06:39:48Z","git_url":"git://github.com/HoOngEe/codechain.git","ssh_url":"git@github.com:HoOngEe/codechain.git","clone_url":"https://github.com/HoOngEe/codechain.git","svn_url":"https://github.com/HoOngEe/codechain","homepage":"https://codechain.io/","size":11669,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"CodeChain-io:master","ref":"master","sha":"9a8854141b0723c87100a71147d29e761b66c8ba","user":{"login":"CodeChain-io","id":32665109,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNjY1MTA5","avatar_url":"https://avatars1.githubusercontent.com/u/32665109?v=4","gravatar_id":"","url":"https://api.github.com/users/CodeChain-io","html_url":"https://github.com/CodeChain-io","followers_url":"https://api.github.com/users/CodeChain-io/followers","following_url":"https://api.github.com/users/CodeChain-io/following{/other_user}","gists_url":"https://api.github.com/users/CodeChain-io/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeChain-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeChain-io/subscriptions","organizations_url":"https://api.github.com/users/CodeChain-io/orgs","repos_url":"https://api.github.com/users/CodeChain-io/repos","events_url":"https://api.github.com/users/CodeChain-io/events{/privacy}","received_events_url":"https://api.github.com/users/CodeChain-io/received_events","type":"Organization","site_admin":false},"repo":{"id":118557921,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg1NTc5MjE=","name":"codechain","full_name":"CodeChain-io/codechain","private":false,"owner":{"login":"CodeChain-io","id":32665109,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNjY1MTA5","avatar_url":"https://avatars1.githubusercontent.com/u/32665109?v=4","gravatar_id":"","url":"https://api.github.com/users/CodeChain-io","html_url":"https://github.com/CodeChain-io","followers_url":"https://api.github.com/users/CodeChain-io/followers","following_url":"https://api.github.com/users/CodeChain-io/following{/other_user}","gists_url":"https://api.github.com/users/CodeChain-io/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeChain-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeChain-io/subscriptions","organizations_url":"https://api.github.com/users/CodeChain-io/orgs","repos_url":"https://api.github.com/users/CodeChain-io/repos","events_url":"https://api.github.com/users/CodeChain-io/events{/privacy}","received_events_url":"https://api.github.com/users/CodeChain-io/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/CodeChain-io/codechain","description":"Programmable multi-asset chain","fork":false,"url":"https://api.github.com/repos/CodeChain-io/codechain","forks_url":"https://api.github.com/repos/CodeChain-io/codechain/forks","keys_url":"https://api.github.com/repos/CodeChain-io/codechain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CodeChain-io/codechain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CodeChain-io/codechain/teams","hooks_url":"https://api.github.com/repos/CodeChain-io/codechain/hooks","issue_events_url":"https://api.github.com/repos/CodeChain-io/codechain/issues/events{/number}","events_url":"https://api.github.com/repos/CodeChain-io/codechain/events","assignees_url":"https://api.github.com/repos/CodeChain-io/codechain/assignees{/user}","branches_url":"https://api.github.com/repos/CodeChain-io/codechain/branches{/branch}","tags_url":"https://api.github.com/repos/CodeChain-io/codechain/tags","blobs_url":"https://api.github.com/repos/CodeChain-io/codechain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CodeChain-io/codechain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CodeChain-io/codechain/git/refs{/sha}","trees_url":"https://api.github.com/repos/CodeChain-io/codechain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CodeChain-io/codechain/statuses/{sha}","languages_url":"https://api.github.com/repos/CodeChain-io/codechain/languages","stargazers_url":"https://api.github.com/repos/CodeChain-io/codechain/stargazers","contributors_url":"https://api.github.com/repos/CodeChain-io/codechain/contributors","subscribers_url":"https://api.github.com/repos/CodeChain-io/codechain/subscribers","subscription_url":"https://api.github.com/repos/CodeChain-io/codechain/subscription","commits_url":"https://api.github.com/repos/CodeChain-io/codechain/commits{/sha}","git_commits_url":"https://api.github.com/repos/CodeChain-io/codechain/git/commits{/sha}","comments_url":"https://api.github.com/repos/CodeChain-io/codechain/comments{/number}","issue_comment_url":"https://api.github.com/repos/CodeChain-io/codechain/issues/comments{/number}","contents_url":"https://api.github.com/repos/CodeChain-io/codechain/contents/{+path}","compare_url":"https://api.github.com/repos/CodeChain-io/codechain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CodeChain-io/codechain/merges","archive_url":"https://api.github.com/repos/CodeChain-io/codechain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CodeChain-io/codechain/downloads","issues_url":"https://api.github.com/repos/CodeChain-io/codechain/issues{/number}","pulls_url":"https://api.github.com/repos/CodeChain-io/codechain/pulls{/number}","milestones_url":"https://api.github.com/repos/CodeChain-io/codechain/milestones{/number}","notifications_url":"https://api.github.com/repos/CodeChain-io/codechain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CodeChain-io/codechain/labels{/name}","releases_url":"https://api.github.com/repos/CodeChain-io/codechain/releases{/id}","deployments_url":"https://api.github.com/repos/CodeChain-io/codechain/deployments","created_at":"2018-01-23T04:31:56Z","updated_at":"2019-07-31T14:43:08Z","pushed_at":"2019-08-05T03:27:17Z","git_url":"git://github.com/CodeChain-io/codechain.git","ssh_url":"git@github.com:CodeChain-io/codechain.git","clone_url":"https://github.com/CodeChain-io/codechain.git","svn_url":"https://github.com/CodeChain-io/codechain","homepage":"https://codechain.io/","size":11628,"stargazers_count":215,"watchers_count":215,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":84,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":47,"open_issues":84,"watchers":215,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CodeChain-io/codechain/pulls/1712"},"html":{"href":"https://github.com/CodeChain-io/codechain/pull/1712"},"issue":{"href":"https://api.github.com/repos/CodeChain-io/codechain/issues/1712"},"comments":{"href":"https://api.github.com/repos/CodeChain-io/codechain/issues/1712/comments"},"review_comments":{"href":"https://api.github.com/repos/CodeChain-io/codechain/pulls/1712/comments"},"review_comment":{"href":"https://api.github.com/repos/CodeChain-io/codechain/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CodeChain-io/codechain/pulls/1712/commits"},"statuses":{"href":"https://api.github.com/repos/CodeChain-io/codechain/statuses/77f0cd2560007255eb708fa4c649d91ad5454af8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Remagpie"}}