{"action":"created","comment":{"url":"https://api.github.com/repos/rchain/rchain/pulls/comments/165784208","pull_request_review_id":93770661,"id":165784208,"diff_hunk":"@@ -777,30 +787,30 @@ object VirtualMachine {\n     obOpt.map(ob => newState.set(_ >> 'ctxt >> 'rslt)(ob)).getOrElse(newState)\n   }\n \n-  def execute(op: OpXferRsltToDest, state: VMState): VMState =\n-    state\n-    //.set(_ >> 'loc)(LocationAtom(state.code.lit(op.lit))) //TODO probably we should change `atom` field only\n-      .updateSelf(\n-        state => {\n-          import Location._\n-\n-          Location.store(state.loc,\n-                         state.ctxt,\n-                         state.globalEnv,\n-                         state.ctxt.rslt) match {\n-            case StoreFail => state.set(_ >> 'vmErrorFlag)(true)\n+  def execute(op: OpXferRsltToDest, state: VMState): VMState = {\n+    val location = state.code.lit(op.lit).asInstanceOf[Location]\n \n-            case StoreCtxt(ctxt) => state.set(_ >> 'ctxt)(ctxt)\n+    val newState = for {\n+      _ <- State.modify[VMState](_.copy(loc = location))\n+      rslt <- State.inspect[VMState, Ob](_.ctxt.rslt)\n+      ctxt0 <- State.inspect[VMState, Ctxt](_.ctxt)\n+      (ctxt1, storeRes) = Location.store(location, rslt).run(ctxt0).value\n+      _ <- storeRes match {\n+        case Success => State.modify[VMState](_.copy(ctxt = ctxt1))\n+        case Failure =>\n+          State.modify[VMState](_.copy(ctxt = ctxt1, vmErrorFlag = true))","path":"roscala/src/main/scala/coop/rchain/rosette/VirtualMachine.scala","position":221,"original_position":221,"commit_id":"0d4aa23768d4006fc563b630b5efce0674cf6a97","original_commit_id":"0d4aa23768d4006fc563b630b5efce0674cf6a97","user":{"login":"DoSOfRedRiver","id":2995220,"avatar_url":"https://avatars1.githubusercontent.com/u/2995220?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSOfRedRiver","html_url":"https://github.com/DoSOfRedRiver","followers_url":"https://api.github.com/users/DoSOfRedRiver/followers","following_url":"https://api.github.com/users/DoSOfRedRiver/following{/other_user}","gists_url":"https://api.github.com/users/DoSOfRedRiver/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSOfRedRiver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSOfRedRiver/subscriptions","organizations_url":"https://api.github.com/users/DoSOfRedRiver/orgs","repos_url":"https://api.github.com/users/DoSOfRedRiver/repos","events_url":"https://api.github.com/users/DoSOfRedRiver/events{/privacy}","received_events_url":"https://api.github.com/users/DoSOfRedRiver/received_events","type":"User","site_admin":false},"body":"You can use `State.transform` instead.","created_at":"2018-02-02T23:09:56Z","updated_at":"2018-02-02T23:13:50Z","html_url":"https://github.com/rchain/rchain/pull/213#discussion_r165784208","pull_request_url":"https://api.github.com/repos/rchain/rchain/pulls/213","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/rchain/rchain/pulls/comments/165784208"},"html":{"href":"https://github.com/rchain/rchain/pull/213#discussion_r165784208"},"pull_request":{"href":"https://api.github.com/repos/rchain/rchain/pulls/213"}}},"pull_request":{"url":"https://api.github.com/repos/rchain/rchain/pulls/213","id":166444035,"html_url":"https://github.com/rchain/rchain/pull/213","diff_url":"https://github.com/rchain/rchain/pull/213.diff","patch_url":"https://github.com/rchain/rchain/pull/213.patch","issue_url":"https://api.github.com/repos/rchain/rchain/issues/213","number":213,"state":"open","locked":false,"title":"Rewrite location class","user":{"login":"tymm","id":28924,"avatar_url":"https://avatars1.githubusercontent.com/u/28924?v=4","gravatar_id":"","url":"https://api.github.com/users/tymm","html_url":"https://github.com/tymm","followers_url":"https://api.github.com/users/tymm/followers","following_url":"https://api.github.com/users/tymm/following{/other_user}","gists_url":"https://api.github.com/users/tymm/gists{/gist_id}","starred_url":"https://api.github.com/users/tymm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tymm/subscriptions","organizations_url":"https://api.github.com/users/tymm/orgs","repos_url":"https://api.github.com/users/tymm/repos","events_url":"https://api.github.com/users/tymm/events{/privacy}","received_events_url":"https://api.github.com/users/tymm/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-01T04:58:19Z","updated_at":"2018-02-02T23:13:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dc0bdc957314fb4dd31af6f8bc32ed39b6a19977","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/rchain/rchain/pulls/213/commits","review_comments_url":"https://api.github.com/repos/rchain/rchain/pulls/213/comments","review_comment_url":"https://api.github.com/repos/rchain/rchain/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rchain/rchain/issues/213/comments","statuses_url":"https://api.github.com/repos/rchain/rchain/statuses/0d4aa23768d4006fc563b630b5efce0674cf6a97","head":{"label":"tymm:rewrite-location","ref":"rewrite-location","sha":"0d4aa23768d4006fc563b630b5efce0674cf6a97","user":{"login":"tymm","id":28924,"avatar_url":"https://avatars1.githubusercontent.com/u/28924?v=4","gravatar_id":"","url":"https://api.github.com/users/tymm","html_url":"https://github.com/tymm","followers_url":"https://api.github.com/users/tymm/followers","following_url":"https://api.github.com/users/tymm/following{/other_user}","gists_url":"https://api.github.com/users/tymm/gists{/gist_id}","starred_url":"https://api.github.com/users/tymm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tymm/subscriptions","organizations_url":"https://api.github.com/users/tymm/orgs","repos_url":"https://api.github.com/users/tymm/repos","events_url":"https://api.github.com/users/tymm/events{/privacy}","received_events_url":"https://api.github.com/users/tymm/received_events","type":"User","site_admin":false},"repo":{"id":110008283,"name":"rchain","full_name":"tymm/rchain","owner":{"login":"tymm","id":28924,"avatar_url":"https://avatars1.githubusercontent.com/u/28924?v=4","gravatar_id":"","url":"https://api.github.com/users/tymm","html_url":"https://github.com/tymm","followers_url":"https://api.github.com/users/tymm/followers","following_url":"https://api.github.com/users/tymm/following{/other_user}","gists_url":"https://api.github.com/users/tymm/gists{/gist_id}","starred_url":"https://api.github.com/users/tymm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tymm/subscriptions","organizations_url":"https://api.github.com/users/tymm/orgs","repos_url":"https://api.github.com/users/tymm/repos","events_url":"https://api.github.com/users/tymm/events{/privacy}","received_events_url":"https://api.github.com/users/tymm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tymm/rchain","description":null,"fork":true,"url":"https://api.github.com/repos/tymm/rchain","forks_url":"https://api.github.com/repos/tymm/rchain/forks","keys_url":"https://api.github.com/repos/tymm/rchain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tymm/rchain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tymm/rchain/teams","hooks_url":"https://api.github.com/repos/tymm/rchain/hooks","issue_events_url":"https://api.github.com/repos/tymm/rchain/issues/events{/number}","events_url":"https://api.github.com/repos/tymm/rchain/events","assignees_url":"https://api.github.com/repos/tymm/rchain/assignees{/user}","branches_url":"https://api.github.com/repos/tymm/rchain/branches{/branch}","tags_url":"https://api.github.com/repos/tymm/rchain/tags","blobs_url":"https://api.github.com/repos/tymm/rchain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tymm/rchain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tymm/rchain/git/refs{/sha}","trees_url":"https://api.github.com/repos/tymm/rchain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tymm/rchain/statuses/{sha}","languages_url":"https://api.github.com/repos/tymm/rchain/languages","stargazers_url":"https://api.github.com/repos/tymm/rchain/stargazers","contributors_url":"https://api.github.com/repos/tymm/rchain/contributors","subscribers_url":"https://api.github.com/repos/tymm/rchain/subscribers","subscription_url":"https://api.github.com/repos/tymm/rchain/subscription","commits_url":"https://api.github.com/repos/tymm/rchain/commits{/sha}","git_commits_url":"https://api.github.com/repos/tymm/rchain/git/commits{/sha}","comments_url":"https://api.github.com/repos/tymm/rchain/comments{/number}","issue_comment_url":"https://api.github.com/repos/tymm/rchain/issues/comments{/number}","contents_url":"https://api.github.com/repos/tymm/rchain/contents/{+path}","compare_url":"https://api.github.com/repos/tymm/rchain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tymm/rchain/merges","archive_url":"https://api.github.com/repos/tymm/rchain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tymm/rchain/downloads","issues_url":"https://api.github.com/repos/tymm/rchain/issues{/number}","pulls_url":"https://api.github.com/repos/tymm/rchain/pulls{/number}","milestones_url":"https://api.github.com/repos/tymm/rchain/milestones{/number}","notifications_url":"https://api.github.com/repos/tymm/rchain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tymm/rchain/labels{/name}","releases_url":"https://api.github.com/repos/tymm/rchain/releases{/id}","deployments_url":"https://api.github.com/repos/tymm/rchain/deployments","created_at":"2017-11-08T17:30:54Z","updated_at":"2017-11-08T17:30:57Z","pushed_at":"2018-02-02T07:07:57Z","git_url":"git://github.com/tymm/rchain.git","ssh_url":"git@github.com:tymm/rchain.git","clone_url":"https://github.com/tymm/rchain.git","svn_url":"https://github.com/tymm/rchain","homepage":null,"size":6063,"stargazers_count":0,"watchers_count":0,"language":"Java","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rchain:dev","ref":"dev","sha":"f7a0d8110007f9daa5a4fbaedd95cccd88500767","user":{"login":"rchain","id":20671765,"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,"name":"rchain","full_name":"rchain/rchain","owner":{"login":"rchain","id":20671765,"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-02-01T03:56:45Z","pushed_at":"2018-02-02T20:43:57Z","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":6161,"stargazers_count":133,"watchers_count":133,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":38,"open_issues":12,"watchers":133,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rchain/rchain/pulls/213"},"html":{"href":"https://github.com/rchain/rchain/pull/213"},"issue":{"href":"https://api.github.com/repos/rchain/rchain/issues/213"},"comments":{"href":"https://api.github.com/repos/rchain/rchain/issues/213/comments"},"review_comments":{"href":"https://api.github.com/repos/rchain/rchain/pulls/213/comments"},"review_comment":{"href":"https://api.github.com/repos/rchain/rchain/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rchain/rchain/pulls/213/commits"},"statuses":{"href":"https://api.github.com/repos/rchain/rchain/statuses/0d4aa23768d4006fc563b630b5efce0674cf6a97"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"DoSOfRedRiver"}}