{"action":"created","comment":{"url":"https://api.github.com/repos/blockmason/lndr/pulls/comments/190569903","pull_request_review_id":122972149,"id":190569903,"diff_hunk":"@@ -228,19 +230,28 @@ verifySettlementsWithTxHash :: LndrHandler ()\n verifySettlementsWithTxHash = do\n     (ServerState pool configTVar _) <- ask\n     config <- liftIO $ readTVarIO configTVar\n-    creditHashes <- liftIO $ withResource pool Db.settlementCreditsToVerify\n-    mapM_ verifyIndividualRecord creditHashes\n+    txHashes <- liftIO $ withResource pool Db.txHashesToVerify\n+    creditsToVerify <- mapM (\\txHash -> liftIO $ withResource pool $ Db.lookupCreditsByTxHash txHash) txHashes\n+    mapM_ verifyRecords creditsToVerify\n \n \n-verifyIndividualRecord :: TransactionHash -> LndrHandler ()\n-verifyIndividualRecord creditHash = do\n+verifyRecords :: [BilateralCreditRecord] -> LndrHandler ()\n+verifyRecords records = do\n     (ServerState pool configTVar loggerSet) <- ask\n-    recordM <- liftIO $ withResource pool $ Db.lookupCreditByHash creditHash\n-    let recordNotFound = throwError $\n-            err404 { errBody = \"Credit hash does not refer to pending bilateral settlement record\" }\n-    bilateralCreditRecord <- maybe recordNotFound pure recordM\n-    verifySettlementPayment bilateralCreditRecord\n-    liftIO $ withResource pool $ Db.verifyCreditByHash creditHash\n-    web3Result <- finalizeTransaction configTVar bilateralCreditRecord\n-                        `catchError` (pure . T.pack . show)\n+    \n+    initialTxHash <- maybe (throwError (err500 {errBody = \"Bilateral Settlement Record does not have txHash.\"})) \n+                     pure . txHash $ head records","path":"lndr-backend/src/Lndr/Server.hs","position":42,"original_position":42,"commit_id":"e362af3e30654fd647bddd1d1dd4929afa2e215f","original_commit_id":"e362af3e30654fd647bddd1d1dd4929afa2e215f","user":{"login":"aupiff","id":804266,"avatar_url":"https://avatars1.githubusercontent.com/u/804266?v=4","gravatar_id":"","url":"https://api.github.com/users/aupiff","html_url":"https://github.com/aupiff","followers_url":"https://api.github.com/users/aupiff/followers","following_url":"https://api.github.com/users/aupiff/following{/other_user}","gists_url":"https://api.github.com/users/aupiff/gists{/gist_id}","starred_url":"https://api.github.com/users/aupiff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aupiff/subscriptions","organizations_url":"https://api.github.com/users/aupiff/orgs","repos_url":"https://api.github.com/users/aupiff/repos","events_url":"https://api.github.com/users/aupiff/events{/privacy}","received_events_url":"https://api.github.com/users/aupiff/received_events","type":"User","site_admin":false},"body":"Instead of calling `head records` many times, just assign it to a variable in a let statement for the sake of brevity and readability.","created_at":"2018-05-24T12:39:25Z","updated_at":"2018-05-24T12:39:25Z","html_url":"https://github.com/blockmason/lndr/pull/182#discussion_r190569903","pull_request_url":"https://api.github.com/repos/blockmason/lndr/pulls/182","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/blockmason/lndr/pulls/comments/190569903"},"html":{"href":"https://github.com/blockmason/lndr/pull/182#discussion_r190569903"},"pull_request":{"href":"https://api.github.com/repos/blockmason/lndr/pulls/182"}}},"pull_request":{"url":"https://api.github.com/repos/blockmason/lndr/pulls/182","id":187163948,"html_url":"https://github.com/blockmason/lndr/pull/182","diff_url":"https://github.com/blockmason/lndr/pull/182.diff","patch_url":"https://github.com/blockmason/lndr/pull/182.patch","issue_url":"https://api.github.com/repos/blockmason/lndr/issues/182","number":182,"state":"open","locked":false,"title":"Added /multi_settlement endpoint and tests, and updated heartbeat to use composite amount","user":{"login":"willbach","id":7759384,"avatar_url":"https://avatars1.githubusercontent.com/u/7759384?v=4","gravatar_id":"","url":"https://api.github.com/users/willbach","html_url":"https://github.com/willbach","followers_url":"https://api.github.com/users/willbach/followers","following_url":"https://api.github.com/users/willbach/following{/other_user}","gists_url":"https://api.github.com/users/willbach/gists{/gist_id}","starred_url":"https://api.github.com/users/willbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willbach/subscriptions","organizations_url":"https://api.github.com/users/willbach/orgs","repos_url":"https://api.github.com/users/willbach/repos","events_url":"https://api.github.com/users/willbach/events{/privacy}","received_events_url":"https://api.github.com/users/willbach/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-10T11:06:03Z","updated_at":"2018-05-24T12:39:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1a79f6324f3809b8a2c2c5c51baebe1391933fee","assignee":null,"assignees":[],"requested_reviewers":[{"login":"canterberry","id":4053794,"avatar_url":"https://avatars3.githubusercontent.com/u/4053794?v=4","gravatar_id":"","url":"https://api.github.com/users/canterberry","html_url":"https://github.com/canterberry","followers_url":"https://api.github.com/users/canterberry/followers","following_url":"https://api.github.com/users/canterberry/following{/other_user}","gists_url":"https://api.github.com/users/canterberry/gists{/gist_id}","starred_url":"https://api.github.com/users/canterberry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/canterberry/subscriptions","organizations_url":"https://api.github.com/users/canterberry/orgs","repos_url":"https://api.github.com/users/canterberry/repos","events_url":"https://api.github.com/users/canterberry/events{/privacy}","received_events_url":"https://api.github.com/users/canterberry/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/blockmason/lndr/pulls/182/commits","review_comments_url":"https://api.github.com/repos/blockmason/lndr/pulls/182/comments","review_comment_url":"https://api.github.com/repos/blockmason/lndr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/blockmason/lndr/issues/182/comments","statuses_url":"https://api.github.com/repos/blockmason/lndr/statuses/e362af3e30654fd647bddd1d1dd4929afa2e215f","head":{"label":"willbach:multi-settlement","ref":"multi-settlement","sha":"e362af3e30654fd647bddd1d1dd4929afa2e215f","user":{"login":"willbach","id":7759384,"avatar_url":"https://avatars1.githubusercontent.com/u/7759384?v=4","gravatar_id":"","url":"https://api.github.com/users/willbach","html_url":"https://github.com/willbach","followers_url":"https://api.github.com/users/willbach/followers","following_url":"https://api.github.com/users/willbach/following{/other_user}","gists_url":"https://api.github.com/users/willbach/gists{/gist_id}","starred_url":"https://api.github.com/users/willbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willbach/subscriptions","organizations_url":"https://api.github.com/users/willbach/orgs","repos_url":"https://api.github.com/users/willbach/repos","events_url":"https://api.github.com/users/willbach/events{/privacy}","received_events_url":"https://api.github.com/users/willbach/received_events","type":"User","site_admin":false},"repo":{"id":126042639,"name":"lndr","full_name":"willbach/lndr","owner":{"login":"willbach","id":7759384,"avatar_url":"https://avatars1.githubusercontent.com/u/7759384?v=4","gravatar_id":"","url":"https://api.github.com/users/willbach","html_url":"https://github.com/willbach","followers_url":"https://api.github.com/users/willbach/followers","following_url":"https://api.github.com/users/willbach/following{/other_user}","gists_url":"https://api.github.com/users/willbach/gists{/gist_id}","starred_url":"https://api.github.com/users/willbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willbach/subscriptions","organizations_url":"https://api.github.com/users/willbach/orgs","repos_url":"https://api.github.com/users/willbach/repos","events_url":"https://api.github.com/users/willbach/events{/privacy}","received_events_url":"https://api.github.com/users/willbach/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/willbach/lndr","description":"Lending on the Blockchain","fork":true,"url":"https://api.github.com/repos/willbach/lndr","forks_url":"https://api.github.com/repos/willbach/lndr/forks","keys_url":"https://api.github.com/repos/willbach/lndr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/willbach/lndr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/willbach/lndr/teams","hooks_url":"https://api.github.com/repos/willbach/lndr/hooks","issue_events_url":"https://api.github.com/repos/willbach/lndr/issues/events{/number}","events_url":"https://api.github.com/repos/willbach/lndr/events","assignees_url":"https://api.github.com/repos/willbach/lndr/assignees{/user}","branches_url":"https://api.github.com/repos/willbach/lndr/branches{/branch}","tags_url":"https://api.github.com/repos/willbach/lndr/tags","blobs_url":"https://api.github.com/repos/willbach/lndr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/willbach/lndr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/willbach/lndr/git/refs{/sha}","trees_url":"https://api.github.com/repos/willbach/lndr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/willbach/lndr/statuses/{sha}","languages_url":"https://api.github.com/repos/willbach/lndr/languages","stargazers_url":"https://api.github.com/repos/willbach/lndr/stargazers","contributors_url":"https://api.github.com/repos/willbach/lndr/contributors","subscribers_url":"https://api.github.com/repos/willbach/lndr/subscribers","subscription_url":"https://api.github.com/repos/willbach/lndr/subscription","commits_url":"https://api.github.com/repos/willbach/lndr/commits{/sha}","git_commits_url":"https://api.github.com/repos/willbach/lndr/git/commits{/sha}","comments_url":"https://api.github.com/repos/willbach/lndr/comments{/number}","issue_comment_url":"https://api.github.com/repos/willbach/lndr/issues/comments{/number}","contents_url":"https://api.github.com/repos/willbach/lndr/contents/{+path}","compare_url":"https://api.github.com/repos/willbach/lndr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/willbach/lndr/merges","archive_url":"https://api.github.com/repos/willbach/lndr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/willbach/lndr/downloads","issues_url":"https://api.github.com/repos/willbach/lndr/issues{/number}","pulls_url":"https://api.github.com/repos/willbach/lndr/pulls{/number}","milestones_url":"https://api.github.com/repos/willbach/lndr/milestones{/number}","notifications_url":"https://api.github.com/repos/willbach/lndr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/willbach/lndr/labels{/name}","releases_url":"https://api.github.com/repos/willbach/lndr/releases{/id}","deployments_url":"https://api.github.com/repos/willbach/lndr/deployments","created_at":"2018-03-20T15:46:12Z","updated_at":"2018-05-02T19:27:55Z","pushed_at":"2018-05-23T21:35:02Z","git_url":"git://github.com/willbach/lndr.git","ssh_url":"git@github.com:willbach/lndr.git","clone_url":"https://github.com/willbach/lndr.git","svn_url":"https://github.com/willbach/lndr","homepage":"https://lndr.io/","size":830,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"blockmason:master","ref":"master","sha":"7827e7aa5e579590badaedc68bc1d65b5f8658e5","user":{"login":"blockmason","id":29842805,"avatar_url":"https://avatars0.githubusercontent.com/u/29842805?v=4","gravatar_id":"","url":"https://api.github.com/users/blockmason","html_url":"https://github.com/blockmason","followers_url":"https://api.github.com/users/blockmason/followers","following_url":"https://api.github.com/users/blockmason/following{/other_user}","gists_url":"https://api.github.com/users/blockmason/gists{/gist_id}","starred_url":"https://api.github.com/users/blockmason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blockmason/subscriptions","organizations_url":"https://api.github.com/users/blockmason/orgs","repos_url":"https://api.github.com/users/blockmason/repos","events_url":"https://api.github.com/users/blockmason/events{/privacy}","received_events_url":"https://api.github.com/users/blockmason/received_events","type":"Organization","site_admin":false},"repo":{"id":107488794,"name":"lndr","full_name":"blockmason/lndr","owner":{"login":"blockmason","id":29842805,"avatar_url":"https://avatars0.githubusercontent.com/u/29842805?v=4","gravatar_id":"","url":"https://api.github.com/users/blockmason","html_url":"https://github.com/blockmason","followers_url":"https://api.github.com/users/blockmason/followers","following_url":"https://api.github.com/users/blockmason/following{/other_user}","gists_url":"https://api.github.com/users/blockmason/gists{/gist_id}","starred_url":"https://api.github.com/users/blockmason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blockmason/subscriptions","organizations_url":"https://api.github.com/users/blockmason/orgs","repos_url":"https://api.github.com/users/blockmason/repos","events_url":"https://api.github.com/users/blockmason/events{/privacy}","received_events_url":"https://api.github.com/users/blockmason/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/blockmason/lndr","description":"Lending on the Blockchain","fork":false,"url":"https://api.github.com/repos/blockmason/lndr","forks_url":"https://api.github.com/repos/blockmason/lndr/forks","keys_url":"https://api.github.com/repos/blockmason/lndr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blockmason/lndr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blockmason/lndr/teams","hooks_url":"https://api.github.com/repos/blockmason/lndr/hooks","issue_events_url":"https://api.github.com/repos/blockmason/lndr/issues/events{/number}","events_url":"https://api.github.com/repos/blockmason/lndr/events","assignees_url":"https://api.github.com/repos/blockmason/lndr/assignees{/user}","branches_url":"https://api.github.com/repos/blockmason/lndr/branches{/branch}","tags_url":"https://api.github.com/repos/blockmason/lndr/tags","blobs_url":"https://api.github.com/repos/blockmason/lndr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blockmason/lndr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blockmason/lndr/git/refs{/sha}","trees_url":"https://api.github.com/repos/blockmason/lndr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blockmason/lndr/statuses/{sha}","languages_url":"https://api.github.com/repos/blockmason/lndr/languages","stargazers_url":"https://api.github.com/repos/blockmason/lndr/stargazers","contributors_url":"https://api.github.com/repos/blockmason/lndr/contributors","subscribers_url":"https://api.github.com/repos/blockmason/lndr/subscribers","subscription_url":"https://api.github.com/repos/blockmason/lndr/subscription","commits_url":"https://api.github.com/repos/blockmason/lndr/commits{/sha}","git_commits_url":"https://api.github.com/repos/blockmason/lndr/git/commits{/sha}","comments_url":"https://api.github.com/repos/blockmason/lndr/comments{/number}","issue_comment_url":"https://api.github.com/repos/blockmason/lndr/issues/comments{/number}","contents_url":"https://api.github.com/repos/blockmason/lndr/contents/{+path}","compare_url":"https://api.github.com/repos/blockmason/lndr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blockmason/lndr/merges","archive_url":"https://api.github.com/repos/blockmason/lndr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blockmason/lndr/downloads","issues_url":"https://api.github.com/repos/blockmason/lndr/issues{/number}","pulls_url":"https://api.github.com/repos/blockmason/lndr/pulls{/number}","milestones_url":"https://api.github.com/repos/blockmason/lndr/milestones{/number}","notifications_url":"https://api.github.com/repos/blockmason/lndr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blockmason/lndr/labels{/name}","releases_url":"https://api.github.com/repos/blockmason/lndr/releases{/id}","deployments_url":"https://api.github.com/repos/blockmason/lndr/deployments","created_at":"2017-10-19T02:34:55Z","updated_at":"2018-05-22T19:16:47Z","pushed_at":"2018-05-23T21:35:04Z","git_url":"git://github.com/blockmason/lndr.git","ssh_url":"git@github.com:blockmason/lndr.git","clone_url":"https://github.com/blockmason/lndr.git","svn_url":"https://github.com/blockmason/lndr","homepage":"https://lndr.io/","size":812,"stargazers_count":12,"watchers_count":12,"language":"Haskell","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":18,"license":null,"forks":3,"open_issues":18,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/blockmason/lndr/pulls/182"},"html":{"href":"https://github.com/blockmason/lndr/pull/182"},"issue":{"href":"https://api.github.com/repos/blockmason/lndr/issues/182"},"comments":{"href":"https://api.github.com/repos/blockmason/lndr/issues/182/comments"},"review_comments":{"href":"https://api.github.com/repos/blockmason/lndr/pulls/182/comments"},"review_comment":{"href":"https://api.github.com/repos/blockmason/lndr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/blockmason/lndr/pulls/182/commits"},"statuses":{"href":"https://api.github.com/repos/blockmason/lndr/statuses/e362af3e30654fd647bddd1d1dd4929afa2e215f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"aupiff"}}