{"action":"created","comment":{"url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/pulls/comments/92929469","pull_request_review_id":13453370,"id":92929469,"diff_hunk":"@@ -0,0 +1,73 @@\n+var Promise = require('bluebird');\n+var co = require(\"co\").wrap;\n+contract('ROSCA startRound Unit Test', function(accounts) {\n+    const MIN_START_DELAY = 86400 + 60;\n+    const ROUND_PERIOD_DELAY = 86400 * 3;\n+    const MEMBER_COUNT = 4;\n+    const CONTRIBUTION_SIZE = 1e16;\n+    const DEFAULT_POT = CONTRIBUTION_SIZE * MEMBER_COUNT;\n+\n+    const ROUND_PERIOD_IN_DAYS = 3;\n+    const MEMBER_LIST = [accounts[1],accounts[2],accounts[3]];\n+    const SERVICE_FEE = 2;\n+\n+    it(\"watches for LogstartOfRound event\", co(function *() {\n+        var latestBlock = web3.eth.getBlock(\"latest\");\n+        var simulatedTimeNow = latestBlock.timestamp;\n+        var DayFromNow = simulatedTimeNow + 86400 + 10;\n+\n+        var rosca = yield ROSCATest.new(ROUND_PERIOD_IN_DAYS, CONTRIBUTION_SIZE, DayFromNow, MEMBER_LIST, SERVICE_FEE);\n+\n+        var eventFired = false;\n+        var startOfRoundEvent = rosca.LogStartOfRound();\n+\n+        startOfRoundEvent.watch(function(error,log){\n+            startOfRoundEvent.stopWatching();\n+            eventFired = true;\n+            assert.equal(log.args.currentRound, 1, \"Log didnt show currentRound properly\");\n+        });\n+        web3.currentProvider.send({\n+            jsonrpc: \"2.0\",\n+            method: \"evm_increaseTime\",\n+            params: [ROUND_PERIOD_DELAY],\n+            id: new Date().getTime()\n+        });\n+\n+        yield rosca.startRound();\n+        yield Promise.delay(300);\n+\n+        assert.isOk(eventFired, \"startOfRound event didn't fire\");\n+    }));\n+\n+    it(\"Throws when calling startRound before roundStartTime (including round = 0)\", co(function *() {\n+        var latestBlock = web3.eth.getBlock(\"latest\");\n+        var simulatedTimeNow = latestBlock.timestamp;\n+        var DayFromNow = simulatedTimeNow + 86400 + 10;\n+\n+        var rosca = yield ROSCATest.new(ROUND_PERIOD_IN_DAYS, CONTRIBUTION_SIZE, DayFromNow, MEMBER_LIST, SERVICE_FEE);\n+\n+        for (var i = 0 ; i < MEMBER_COUNT + 1; i++) {\n+            yield rosca.startRound().then(function () {\n+                assert.isNotOk(true, \"expected calling startRound before roundStartTime to throw\");\n+            }).catch(function (e) {","path":"test/startRoundUnitTest.js","position":52,"original_position":52,"commit_id":"c72ffcc48805be847feb7920d4505098db7e15dd","original_commit_id":"c72ffcc48805be847feb7920d4505098db7e15dd","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Don't make functions within a loop.","created_at":"2016-12-17T21:30:35Z","updated_at":"2016-12-17T21:30:35Z","html_url":"https://github.com/WeTrustPlatform/rosca-contracts/pull/19#discussion_r92929469","pull_request_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/pulls/comments/92929469"},"html":{"href":"https://github.com/WeTrustPlatform/rosca-contracts/pull/19#discussion_r92929469"},"pull_request":{"href":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/pulls/19","id":98036117,"html_url":"https://github.com/WeTrustPlatform/rosca-contracts/pull/19","diff_url":"https://github.com/WeTrustPlatform/rosca-contracts/pull/19.diff","patch_url":"https://github.com/WeTrustPlatform/rosca-contracts/pull/19.patch","issue_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/issues/19","number":19,"state":"open","locked":false,"title":"Added cleanUpPreviousRoundUnitTest.js and startRoundUnitTest.js","user":{"login":"shine2lay","id":5243508,"avatar_url":"https://avatars.githubusercontent.com/u/5243508?v=3","gravatar_id":"","url":"https://api.github.com/users/shine2lay","html_url":"https://github.com/shine2lay","followers_url":"https://api.github.com/users/shine2lay/followers","following_url":"https://api.github.com/users/shine2lay/following{/other_user}","gists_url":"https://api.github.com/users/shine2lay/gists{/gist_id}","starred_url":"https://api.github.com/users/shine2lay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shine2lay/subscriptions","organizations_url":"https://api.github.com/users/shine2lay/orgs","repos_url":"https://api.github.com/users/shine2lay/repos","events_url":"https://api.github.com/users/shine2lay/events{/privacy}","received_events_url":"https://api.github.com/users/shine2lay/received_events","type":"User","site_admin":false},"body":"also a couple of minor fixes to migration script\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/wetrustplatform/rosca-contracts/19)\n<!-- Reviewable:end -->\n","created_at":"2016-12-14T21:09:40Z","updated_at":"2016-12-17T21:30:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a68689bc66c96d8957047a64fe3b9a26f3971b8","assignee":{"login":"rmerom","id":650968,"avatar_url":"https://avatars.githubusercontent.com/u/650968?v=3","gravatar_id":"","url":"https://api.github.com/users/rmerom","html_url":"https://github.com/rmerom","followers_url":"https://api.github.com/users/rmerom/followers","following_url":"https://api.github.com/users/rmerom/following{/other_user}","gists_url":"https://api.github.com/users/rmerom/gists{/gist_id}","starred_url":"https://api.github.com/users/rmerom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmerom/subscriptions","organizations_url":"https://api.github.com/users/rmerom/orgs","repos_url":"https://api.github.com/users/rmerom/repos","events_url":"https://api.github.com/users/rmerom/events{/privacy}","received_events_url":"https://api.github.com/users/rmerom/received_events","type":"User","site_admin":false},"assignees":[{"login":"rmerom","id":650968,"avatar_url":"https://avatars.githubusercontent.com/u/650968?v=3","gravatar_id":"","url":"https://api.github.com/users/rmerom","html_url":"https://github.com/rmerom","followers_url":"https://api.github.com/users/rmerom/followers","following_url":"https://api.github.com/users/rmerom/following{/other_user}","gists_url":"https://api.github.com/users/rmerom/gists{/gist_id}","starred_url":"https://api.github.com/users/rmerom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmerom/subscriptions","organizations_url":"https://api.github.com/users/rmerom/orgs","repos_url":"https://api.github.com/users/rmerom/repos","events_url":"https://api.github.com/users/rmerom/events{/privacy}","received_events_url":"https://api.github.com/users/rmerom/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/pulls/19/commits","review_comments_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/pulls/19/comments","review_comment_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/issues/19/comments","statuses_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/statuses/c72ffcc48805be847feb7920d4505098db7e15dd","head":{"label":"shine2lay:PR_ready","ref":"PR_ready","sha":"c72ffcc48805be847feb7920d4505098db7e15dd","user":{"login":"shine2lay","id":5243508,"avatar_url":"https://avatars.githubusercontent.com/u/5243508?v=3","gravatar_id":"","url":"https://api.github.com/users/shine2lay","html_url":"https://github.com/shine2lay","followers_url":"https://api.github.com/users/shine2lay/followers","following_url":"https://api.github.com/users/shine2lay/following{/other_user}","gists_url":"https://api.github.com/users/shine2lay/gists{/gist_id}","starred_url":"https://api.github.com/users/shine2lay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shine2lay/subscriptions","organizations_url":"https://api.github.com/users/shine2lay/orgs","repos_url":"https://api.github.com/users/shine2lay/repos","events_url":"https://api.github.com/users/shine2lay/events{/privacy}","received_events_url":"https://api.github.com/users/shine2lay/received_events","type":"User","site_admin":false},"repo":{"id":73576739,"name":"rosca-contracts","full_name":"shine2lay/rosca-contracts","owner":{"login":"shine2lay","id":5243508,"avatar_url":"https://avatars.githubusercontent.com/u/5243508?v=3","gravatar_id":"","url":"https://api.github.com/users/shine2lay","html_url":"https://github.com/shine2lay","followers_url":"https://api.github.com/users/shine2lay/followers","following_url":"https://api.github.com/users/shine2lay/following{/other_user}","gists_url":"https://api.github.com/users/shine2lay/gists{/gist_id}","starred_url":"https://api.github.com/users/shine2lay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shine2lay/subscriptions","organizations_url":"https://api.github.com/users/shine2lay/orgs","repos_url":"https://api.github.com/users/shine2lay/repos","events_url":"https://api.github.com/users/shine2lay/events{/privacy}","received_events_url":"https://api.github.com/users/shine2lay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shine2lay/rosca-contracts","description":"Ethereum Contracts for WeTrust ROSCA","fork":true,"url":"https://api.github.com/repos/shine2lay/rosca-contracts","forks_url":"https://api.github.com/repos/shine2lay/rosca-contracts/forks","keys_url":"https://api.github.com/repos/shine2lay/rosca-contracts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shine2lay/rosca-contracts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shine2lay/rosca-contracts/teams","hooks_url":"https://api.github.com/repos/shine2lay/rosca-contracts/hooks","issue_events_url":"https://api.github.com/repos/shine2lay/rosca-contracts/issues/events{/number}","events_url":"https://api.github.com/repos/shine2lay/rosca-contracts/events","assignees_url":"https://api.github.com/repos/shine2lay/rosca-contracts/assignees{/user}","branches_url":"https://api.github.com/repos/shine2lay/rosca-contracts/branches{/branch}","tags_url":"https://api.github.com/repos/shine2lay/rosca-contracts/tags","blobs_url":"https://api.github.com/repos/shine2lay/rosca-contracts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shine2lay/rosca-contracts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shine2lay/rosca-contracts/git/refs{/sha}","trees_url":"https://api.github.com/repos/shine2lay/rosca-contracts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shine2lay/rosca-contracts/statuses/{sha}","languages_url":"https://api.github.com/repos/shine2lay/rosca-contracts/languages","stargazers_url":"https://api.github.com/repos/shine2lay/rosca-contracts/stargazers","contributors_url":"https://api.github.com/repos/shine2lay/rosca-contracts/contributors","subscribers_url":"https://api.github.com/repos/shine2lay/rosca-contracts/subscribers","subscription_url":"https://api.github.com/repos/shine2lay/rosca-contracts/subscription","commits_url":"https://api.github.com/repos/shine2lay/rosca-contracts/commits{/sha}","git_commits_url":"https://api.github.com/repos/shine2lay/rosca-contracts/git/commits{/sha}","comments_url":"https://api.github.com/repos/shine2lay/rosca-contracts/comments{/number}","issue_comment_url":"https://api.github.com/repos/shine2lay/rosca-contracts/issues/comments{/number}","contents_url":"https://api.github.com/repos/shine2lay/rosca-contracts/contents/{+path}","compare_url":"https://api.github.com/repos/shine2lay/rosca-contracts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shine2lay/rosca-contracts/merges","archive_url":"https://api.github.com/repos/shine2lay/rosca-contracts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shine2lay/rosca-contracts/downloads","issues_url":"https://api.github.com/repos/shine2lay/rosca-contracts/issues{/number}","pulls_url":"https://api.github.com/repos/shine2lay/rosca-contracts/pulls{/number}","milestones_url":"https://api.github.com/repos/shine2lay/rosca-contracts/milestones{/number}","notifications_url":"https://api.github.com/repos/shine2lay/rosca-contracts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shine2lay/rosca-contracts/labels{/name}","releases_url":"https://api.github.com/repos/shine2lay/rosca-contracts/releases{/id}","deployments_url":"https://api.github.com/repos/shine2lay/rosca-contracts/deployments","created_at":"2016-11-12T20:29:28Z","updated_at":"2016-11-12T20:29:30Z","pushed_at":"2016-12-17T21:30:27Z","git_url":"git://github.com/shine2lay/rosca-contracts.git","ssh_url":"git@github.com:shine2lay/rosca-contracts.git","clone_url":"https://github.com/shine2lay/rosca-contracts.git","svn_url":"https://github.com/shine2lay/rosca-contracts","homepage":null,"size":890,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"WeTrustPlatform:develop","ref":"develop","sha":"369f50aa1f2e1c7a6b68025578823e5147aeee7c","user":{"login":"WeTrustPlatform","id":22733080,"avatar_url":"https://avatars.githubusercontent.com/u/22733080?v=3","gravatar_id":"","url":"https://api.github.com/users/WeTrustPlatform","html_url":"https://github.com/WeTrustPlatform","followers_url":"https://api.github.com/users/WeTrustPlatform/followers","following_url":"https://api.github.com/users/WeTrustPlatform/following{/other_user}","gists_url":"https://api.github.com/users/WeTrustPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/WeTrustPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeTrustPlatform/subscriptions","organizations_url":"https://api.github.com/users/WeTrustPlatform/orgs","repos_url":"https://api.github.com/users/WeTrustPlatform/repos","events_url":"https://api.github.com/users/WeTrustPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/WeTrustPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":73515004,"name":"rosca-contracts","full_name":"WeTrustPlatform/rosca-contracts","owner":{"login":"WeTrustPlatform","id":22733080,"avatar_url":"https://avatars.githubusercontent.com/u/22733080?v=3","gravatar_id":"","url":"https://api.github.com/users/WeTrustPlatform","html_url":"https://github.com/WeTrustPlatform","followers_url":"https://api.github.com/users/WeTrustPlatform/followers","following_url":"https://api.github.com/users/WeTrustPlatform/following{/other_user}","gists_url":"https://api.github.com/users/WeTrustPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/WeTrustPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeTrustPlatform/subscriptions","organizations_url":"https://api.github.com/users/WeTrustPlatform/orgs","repos_url":"https://api.github.com/users/WeTrustPlatform/repos","events_url":"https://api.github.com/users/WeTrustPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/WeTrustPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WeTrustPlatform/rosca-contracts","description":"Ethereum Contracts for WeTrust ROSCA","fork":false,"url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts","forks_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/forks","keys_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/teams","hooks_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/hooks","issue_events_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/issues/events{/number}","events_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/events","assignees_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/assignees{/user}","branches_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/branches{/branch}","tags_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/tags","blobs_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/git/refs{/sha}","trees_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/statuses/{sha}","languages_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/languages","stargazers_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/stargazers","contributors_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/contributors","subscribers_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/subscribers","subscription_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/subscription","commits_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/commits{/sha}","git_commits_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/git/commits{/sha}","comments_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/comments{/number}","issue_comment_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/issues/comments{/number}","contents_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/contents/{+path}","compare_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/merges","archive_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/downloads","issues_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/issues{/number}","pulls_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/pulls{/number}","milestones_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/milestones{/number}","notifications_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/labels{/name}","releases_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/releases{/id}","deployments_url":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/deployments","created_at":"2016-11-11T22:05:15Z","updated_at":"2016-12-14T21:08:10Z","pushed_at":"2016-12-17T21:30:31Z","git_url":"git://github.com/WeTrustPlatform/rosca-contracts.git","ssh_url":"git@github.com:WeTrustPlatform/rosca-contracts.git","clone_url":"https://github.com/WeTrustPlatform/rosca-contracts.git","svn_url":"https://github.com/WeTrustPlatform/rosca-contracts","homepage":null,"size":869,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/pulls/19"},"html":{"href":"https://github.com/WeTrustPlatform/rosca-contracts/pull/19"},"issue":{"href":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/issues/19"},"comments":{"href":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/WeTrustPlatform/rosca-contracts/statuses/c72ffcc48805be847feb7920d4505098db7e15dd"}}}}
{"actor":{"display_login":"houndci-bot"}}