{"action":"created","comment":{"url":"https://api.github.com/repos/rchain/rchain/pulls/comments/206930370","pull_request_review_id":142429908,"id":206930370,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjkzMDM3MA==","diff_hunk":"@@ -250,9 +251,71 @@ class InterpreterUtilTest\n     b3PostState.contains(\"@{6}!(6)\") should be(true)\n   }\n \n+  \"computeDeploysCheckpoint\" should \"aggregate cost of deploying rholang programs within the block\" in {\n+    //reference costs\n+    //deploy each Rholang program separately and record its cost\n+    val deploy1 = ProtoUtil.termDeploy(mkTerm(\"@1!(Nil)\").toOption.get)\n+    val deploy2 = ProtoUtil.termDeploy(mkTerm(\"@3!([1,2,3,4])\").toOption.get)\n+    val deploy3 = ProtoUtil.termDeploy(mkTerm(\"for(@x <- @0) { @4!(x.toByteArray()) }\").toOption.get)\n+\n+    def computeSingleDeployCost(deploy: Deploy*): Vector[DeployCost] = {\n+      val (_, _, cost) = computeDeploysCheckpoint(Seq.empty,\n+        deploy,\n+        BlockMessage(),\n+        initState,\n+        BlockStore[Id].asMap(),\n+        emptyStateHash,\n+        knownStateHashes,\n+        runtimeManager.computeState)\n+      cost\n+    }\n+\n+    val cost1 = computeSingleDeployCost(deploy1)\n+    val cost2 = computeSingleDeployCost(deploy2)\n+    val cost3 = computeSingleDeployCost(deploy3)\n+\n+    val accCostsSep = cost1 ++ cost2 ++ cost3\n+\n+    //cost within the block should be the same as sum of deploying all programs separately\n+    val singleDeploy = Seq(deploy1, deploy2, deploy3)\n+    val accCostBatch = computeSingleDeployCost(singleDeploy:_*)\n+\n+    accCostBatch should contain theSameElementsAs (accCostsSep)\n+  }\n+\n+  it should \"return cost of deploying even if one of the programs withing the deployment throws an error\" in {\n+    //reference costs\n+    //deploy each Rholang program separately and record its cost\n+    val deploy1 = ProtoUtil.termDeploy(mkTerm(\"@1!(Nil)\").toOption.get)\n+    val deploy2 = ProtoUtil.termDeploy(mkTerm(\"@2!([1,2,3,4])\").toOption.get)\n+\n+    def computeSingleDeployCost(deploy: Deploy*): Vector[DeployCost] = {","path":"casper/src/test/scala/coop/rchain/casper/util/rholang/InterpreterUtilTest.scala","position":null,"original_position":137,"commit_id":"98a1148454c00962900e11a3f11492f3844f98a5","original_commit_id":"8d15f6752aff2b466f6df92971a1d3654e2798dd","user":{"login":"birchmd","id":13788876,"node_id":"MDQ6VXNlcjEzNzg4ODc2","avatar_url":"https://avatars1.githubusercontent.com/u/13788876?v=4","gravatar_id":"","url":"https://api.github.com/users/birchmd","html_url":"https://github.com/birchmd","followers_url":"https://api.github.com/users/birchmd/followers","following_url":"https://api.github.com/users/birchmd/following{/other_user}","gists_url":"https://api.github.com/users/birchmd/gists{/gist_id}","starred_url":"https://api.github.com/users/birchmd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/birchmd/subscriptions","organizations_url":"https://api.github.com/users/birchmd/orgs","repos_url":"https://api.github.com/users/birchmd/repos","events_url":"https://api.github.com/users/birchmd/events{/privacy}","received_events_url":"https://api.github.com/users/birchmd/received_events","type":"User","site_admin":false},"body":"This appears to be the same function you defined on L261. Maybe factor out into a function you can call in both places?","created_at":"2018-08-01T15:38:34Z","updated_at":"2018-08-01T15:55:17Z","html_url":"https://github.com/rchain/rchain/pull/1218#discussion_r206930370","pull_request_url":"https://api.github.com/repos/rchain/rchain/pulls/1218","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/rchain/rchain/pulls/comments/206930370"},"html":{"href":"https://github.com/rchain/rchain/pull/1218#discussion_r206930370"},"pull_request":{"href":"https://api.github.com/repos/rchain/rchain/pulls/1218"}}},"pull_request":{"url":"https://api.github.com/repos/rchain/rchain/pulls/1218","id":205074611,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1MDc0NjEx","html_url":"https://github.com/rchain/rchain/pull/1218","diff_url":"https://github.com/rchain/rchain/pull/1218.diff","patch_url":"https://github.com/rchain/rchain/pull/1218.patch","issue_url":"https://api.github.com/repos/rchain/rchain/issues/1218","number":1218,"state":"open","locked":false,"title":"RHOL-463: Aggregate transaction fees of the deploy.","user":{"login":"goral09","id":5120801,"node_id":"MDQ6VXNlcjUxMjA4MDE=","avatar_url":"https://avatars2.githubusercontent.com/u/5120801?v=4","gravatar_id":"","url":"https://api.github.com/users/goral09","html_url":"https://github.com/goral09","followers_url":"https://api.github.com/users/goral09/followers","following_url":"https://api.github.com/users/goral09/following{/other_user}","gists_url":"https://api.github.com/users/goral09/gists{/gist_id}","starred_url":"https://api.github.com/users/goral09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goral09/subscriptions","organizations_url":"https://api.github.com/users/goral09/orgs","repos_url":"https://api.github.com/users/goral09/repos","events_url":"https://api.github.com/users/goral09/events{/privacy}","received_events_url":"https://api.github.com/users/goral09/received_events","type":"User","site_admin":false},"body":"## Overview\r\nAccumulates cost of Rholang programs within single deploy.\r\n\r\n### Which JIRA issue does this PR relate to? If there is not a JIRA issue addressing this work, please create one now and add the link here.\r\nhttps://rchain.atlassian.net/browse/RHOL-463\r\n\r\n### Complete this checklist before you submit the PR\r\n- [ ] This PR contains no more than 200 lines of code, excluding test code.\r\n- [ ] This PR meets [RChain development coding standards](https://rchain.atlassian.net/wiki/spaces/DOC/pages/28082177/Coding+Standards).\r\n- [ ] You have someone in mind to assign for review. Make this assignment after submitting the PR.\r\n\r\n### Notes\r\nOptional. Add any notes on caveats, approaches you tried that didn't work, or anything else.\r\n","created_at":"2018-07-31T11:02:35Z","updated_at":"2018-08-01T15:55:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34860e09c43a89466172caf73bea5f3890344f95","assignee":null,"assignees":[],"requested_reviewers":[{"login":"KentShikama","id":6329898,"node_id":"MDQ6VXNlcjYzMjk4OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6329898?v=4","gravatar_id":"","url":"https://api.github.com/users/KentShikama","html_url":"https://github.com/KentShikama","followers_url":"https://api.github.com/users/KentShikama/followers","following_url":"https://api.github.com/users/KentShikama/following{/other_user}","gists_url":"https://api.github.com/users/KentShikama/gists{/gist_id}","starred_url":"https://api.github.com/users/KentShikama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KentShikama/subscriptions","organizations_url":"https://api.github.com/users/KentShikama/orgs","repos_url":"https://api.github.com/users/KentShikama/repos","events_url":"https://api.github.com/users/KentShikama/events{/privacy}","received_events_url":"https://api.github.com/users/KentShikama/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rchain/rchain/pulls/1218/commits","review_comments_url":"https://api.github.com/repos/rchain/rchain/pulls/1218/comments","review_comment_url":"https://api.github.com/repos/rchain/rchain/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rchain/rchain/issues/1218/comments","statuses_url":"https://api.github.com/repos/rchain/rchain/statuses/98a1148454c00962900e11a3f11492f3844f98a5","head":{"label":"goral09:RHOL-463_Aggregate-transaction-fees","ref":"RHOL-463_Aggregate-transaction-fees","sha":"98a1148454c00962900e11a3f11492f3844f98a5","user":{"login":"goral09","id":5120801,"node_id":"MDQ6VXNlcjUxMjA4MDE=","avatar_url":"https://avatars2.githubusercontent.com/u/5120801?v=4","gravatar_id":"","url":"https://api.github.com/users/goral09","html_url":"https://github.com/goral09","followers_url":"https://api.github.com/users/goral09/followers","following_url":"https://api.github.com/users/goral09/following{/other_user}","gists_url":"https://api.github.com/users/goral09/gists{/gist_id}","starred_url":"https://api.github.com/users/goral09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goral09/subscriptions","organizations_url":"https://api.github.com/users/goral09/orgs","repos_url":"https://api.github.com/users/goral09/repos","events_url":"https://api.github.com/users/goral09/events{/privacy}","received_events_url":"https://api.github.com/users/goral09/received_events","type":"User","site_admin":false},"repo":{"id":129659641,"node_id":"MDEwOlJlcG9zaXRvcnkxMjk2NTk2NDE=","name":"rchain","full_name":"goral09/rchain","owner":{"login":"goral09","id":5120801,"node_id":"MDQ6VXNlcjUxMjA4MDE=","avatar_url":"https://avatars2.githubusercontent.com/u/5120801?v=4","gravatar_id":"","url":"https://api.github.com/users/goral09","html_url":"https://github.com/goral09","followers_url":"https://api.github.com/users/goral09/followers","following_url":"https://api.github.com/users/goral09/following{/other_user}","gists_url":"https://api.github.com/users/goral09/gists{/gist_id}","starred_url":"https://api.github.com/users/goral09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goral09/subscriptions","organizations_url":"https://api.github.com/users/goral09/orgs","repos_url":"https://api.github.com/users/goral09/repos","events_url":"https://api.github.com/users/goral09/events{/privacy}","received_events_url":"https://api.github.com/users/goral09/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/goral09/rchain","description":null,"fork":true,"url":"https://api.github.com/repos/goral09/rchain","forks_url":"https://api.github.com/repos/goral09/rchain/forks","keys_url":"https://api.github.com/repos/goral09/rchain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/goral09/rchain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/goral09/rchain/teams","hooks_url":"https://api.github.com/repos/goral09/rchain/hooks","issue_events_url":"https://api.github.com/repos/goral09/rchain/issues/events{/number}","events_url":"https://api.github.com/repos/goral09/rchain/events","assignees_url":"https://api.github.com/repos/goral09/rchain/assignees{/user}","branches_url":"https://api.github.com/repos/goral09/rchain/branches{/branch}","tags_url":"https://api.github.com/repos/goral09/rchain/tags","blobs_url":"https://api.github.com/repos/goral09/rchain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/goral09/rchain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/goral09/rchain/git/refs{/sha}","trees_url":"https://api.github.com/repos/goral09/rchain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/goral09/rchain/statuses/{sha}","languages_url":"https://api.github.com/repos/goral09/rchain/languages","stargazers_url":"https://api.github.com/repos/goral09/rchain/stargazers","contributors_url":"https://api.github.com/repos/goral09/rchain/contributors","subscribers_url":"https://api.github.com/repos/goral09/rchain/subscribers","subscription_url":"https://api.github.com/repos/goral09/rchain/subscription","commits_url":"https://api.github.com/repos/goral09/rchain/commits{/sha}","git_commits_url":"https://api.github.com/repos/goral09/rchain/git/commits{/sha}","comments_url":"https://api.github.com/repos/goral09/rchain/comments{/number}","issue_comment_url":"https://api.github.com/repos/goral09/rchain/issues/comments{/number}","contents_url":"https://api.github.com/repos/goral09/rchain/contents/{+path}","compare_url":"https://api.github.com/repos/goral09/rchain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/goral09/rchain/merges","archive_url":"https://api.github.com/repos/goral09/rchain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/goral09/rchain/downloads","issues_url":"https://api.github.com/repos/goral09/rchain/issues{/number}","pulls_url":"https://api.github.com/repos/goral09/rchain/pulls{/number}","milestones_url":"https://api.github.com/repos/goral09/rchain/milestones{/number}","notifications_url":"https://api.github.com/repos/goral09/rchain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/goral09/rchain/labels{/name}","releases_url":"https://api.github.com/repos/goral09/rchain/releases{/id}","deployments_url":"https://api.github.com/repos/goral09/rchain/deployments","created_at":"2018-04-15T23:24:40Z","updated_at":"2018-04-25T19:11:17Z","pushed_at":"2018-08-01T15:44:22Z","git_url":"git://github.com/goral09/rchain.git","ssh_url":"git@github.com:goral09/rchain.git","clone_url":"https://github.com/goral09/rchain.git","svn_url":"https://github.com/goral09/rchain","homepage":null,"size":13960,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":1,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"rchain:dev","ref":"dev","sha":"6d39e440bea62206b1924c12b74f3cbfd2ce2a9c","user":{"login":"rchain","id":20671765,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNjcxNzY1","avatar_url":"https://avatars0.githubusercontent.com/u/20671765?v=4","gravatar_id":"","url":"https://api.github.com/users/rchain","html_url":"https://github.com/rchain","followers_url":"https://api.github.com/users/rchain/followers","following_url":"https://api.github.com/users/rchain/following{/other_user}","gists_url":"https://api.github.com/users/rchain/gists{/gist_id}","starred_url":"https://api.github.com/users/rchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rchain/subscriptions","organizations_url":"https://api.github.com/users/rchain/orgs","repos_url":"https://api.github.com/users/rchain/repos","events_url":"https://api.github.com/users/rchain/events{/privacy}","received_events_url":"https://api.github.com/users/rchain/received_events","type":"Organization","site_admin":false},"repo":{"id":84493691,"node_id":"MDEwOlJlcG9zaXRvcnk4NDQ5MzY5MQ==","name":"rchain","full_name":"rchain/rchain","owner":{"login":"rchain","id":20671765,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNjcxNzY1","avatar_url":"https://avatars0.githubusercontent.com/u/20671765?v=4","gravatar_id":"","url":"https://api.github.com/users/rchain","html_url":"https://github.com/rchain","followers_url":"https://api.github.com/users/rchain/followers","following_url":"https://api.github.com/users/rchain/following{/other_user}","gists_url":"https://api.github.com/users/rchain/gists{/gist_id}","starred_url":"https://api.github.com/users/rchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rchain/subscriptions","organizations_url":"https://api.github.com/users/rchain/orgs","repos_url":"https://api.github.com/users/rchain/repos","events_url":"https://api.github.com/users/rchain/events{/privacy}","received_events_url":"https://api.github.com/users/rchain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rchain/rchain","description":null,"fork":false,"url":"https://api.github.com/repos/rchain/rchain","forks_url":"https://api.github.com/repos/rchain/rchain/forks","keys_url":"https://api.github.com/repos/rchain/rchain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rchain/rchain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rchain/rchain/teams","hooks_url":"https://api.github.com/repos/rchain/rchain/hooks","issue_events_url":"https://api.github.com/repos/rchain/rchain/issues/events{/number}","events_url":"https://api.github.com/repos/rchain/rchain/events","assignees_url":"https://api.github.com/repos/rchain/rchain/assignees{/user}","branches_url":"https://api.github.com/repos/rchain/rchain/branches{/branch}","tags_url":"https://api.github.com/repos/rchain/rchain/tags","blobs_url":"https://api.github.com/repos/rchain/rchain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rchain/rchain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rchain/rchain/git/refs{/sha}","trees_url":"https://api.github.com/repos/rchain/rchain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rchain/rchain/statuses/{sha}","languages_url":"https://api.github.com/repos/rchain/rchain/languages","stargazers_url":"https://api.github.com/repos/rchain/rchain/stargazers","contributors_url":"https://api.github.com/repos/rchain/rchain/contributors","subscribers_url":"https://api.github.com/repos/rchain/rchain/subscribers","subscription_url":"https://api.github.com/repos/rchain/rchain/subscription","commits_url":"https://api.github.com/repos/rchain/rchain/commits{/sha}","git_commits_url":"https://api.github.com/repos/rchain/rchain/git/commits{/sha}","comments_url":"https://api.github.com/repos/rchain/rchain/comments{/number}","issue_comment_url":"https://api.github.com/repos/rchain/rchain/issues/comments{/number}","contents_url":"https://api.github.com/repos/rchain/rchain/contents/{+path}","compare_url":"https://api.github.com/repos/rchain/rchain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rchain/rchain/merges","archive_url":"https://api.github.com/repos/rchain/rchain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rchain/rchain/downloads","issues_url":"https://api.github.com/repos/rchain/rchain/issues{/number}","pulls_url":"https://api.github.com/repos/rchain/rchain/pulls{/number}","milestones_url":"https://api.github.com/repos/rchain/rchain/milestones{/number}","notifications_url":"https://api.github.com/repos/rchain/rchain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rchain/rchain/labels{/name}","releases_url":"https://api.github.com/repos/rchain/rchain/releases{/id}","deployments_url":"https://api.github.com/repos/rchain/rchain/deployments","created_at":"2017-03-09T22:15:35Z","updated_at":"2018-08-01T15:38:49Z","pushed_at":"2018-08-01T15:44:24Z","git_url":"git://github.com/rchain/rchain.git","ssh_url":"git@github.com:rchain/rchain.git","clone_url":"https://github.com/rchain/rchain.git","svn_url":"https://github.com/rchain/rchain","homepage":null,"size":13778,"stargazers_count":384,"watchers_count":384,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":109,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":109,"open_issues":12,"watchers":384,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/rchain/rchain/pulls/1218"},"html":{"href":"https://github.com/rchain/rchain/pull/1218"},"issue":{"href":"https://api.github.com/repos/rchain/rchain/issues/1218"},"comments":{"href":"https://api.github.com/repos/rchain/rchain/issues/1218/comments"},"review_comments":{"href":"https://api.github.com/repos/rchain/rchain/pulls/1218/comments"},"review_comment":{"href":"https://api.github.com/repos/rchain/rchain/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rchain/rchain/pulls/1218/commits"},"statuses":{"href":"https://api.github.com/repos/rchain/rchain/statuses/98a1148454c00962900e11a3f11492f3844f98a5"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"birchmd"}}