{"action":"created","comment":{"url":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/comments/312853193","pull_request_review_id":273601714,"id":312853193,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxMjg1MzE5Mw==","diff_hunk":"@@ -8,6 +8,133 @@ import (\n \t\"github.com/stretchr/testify/assert\"\n )\n \n+func TestXswapOp(t *testing.T) {\n+\n+\tv := VM{}\n+\n+\ta, err := stack.NewInt(big.NewInt(3))\n+\tassert.Nil(t, err)\n+\n+\tb, err := stack.NewInt(big.NewInt(6))\n+\tassert.Nil(t, err)\n+\n+\tc, err := stack.NewInt(big.NewInt(9))\n+\tassert.Nil(t, err)\n+\n+\td, err := stack.NewInt(big.NewInt(2))\n+\tassert.Nil(t, err)\n+\n+\tctx := stack.NewContext([]byte{})\n+\tctx.Estack.Push(a).Push(b).Push(c).Push(d)\n+\n+\t// pop n (= d = 2) from the stack.\n+\t// we will swap the n-item which\n+\t// is located in position len(stack)-n-1 (= 3-2-1= 0)\n+\t// with the top stack item.\n+\t// The final stack will be [c,b,a]\n+\tv.executeOp(stack.XSWAP, ctx)\n+\n+\t// Stack should have three items\n+\tassert.Equal(t, 3, ctx.Estack.Len())\n+\n+\titemA, err := ctx.Estack.PopInt()\n+\tassert.Nil(t, err)\n+\n+\titemB, err := ctx.Estack.PopInt()\n+\tassert.Nil(t, err)\n+\n+\titemC, err := ctx.Estack.PopInt()\n+\tassert.Nil(t, err)\n+\n+\tassert.Equal(t, int64(3), itemA.Value().Int64())\n+\tassert.Equal(t, int64(6), itemB.Value().Int64())\n+\tassert.Equal(t, int64(9), itemC.Value().Int64())\n+\n+}\n+\n+func TestXTuckOp(t *testing.T) {\n+\n+\tv := VM{}\n+\n+\ta, err := stack.NewInt(big.NewInt(3))\n+\tassert.Nil(t, err)\n+\n+\tb, err := stack.NewInt(big.NewInt(6))\n+\tassert.Nil(t, err)\n+\n+\tc, err := stack.NewInt(big.NewInt(9))\n+\tassert.Nil(t, err)\n+\n+\td, err := stack.NewInt(big.NewInt(2))\n+\tassert.Nil(t, err)\n+\n+\tctx := stack.NewContext([]byte{})\n+\tctx.Estack.Push(a).Push(b).Push(c).Push(d)\n+\n+\t// pop n (= d = 2) from the stack\n+\t// and insert the top stack item c\n+\t// to the position len(stack)-n (= 3-2 = 1)\n+\t// of the stack.The final stack will be [a,c,b,c]\n+\tv.executeOp(stack.XTUCK, ctx)","path":"pkg/vm/vm_ops_stackmani_test.go","position":71,"original_position":71,"commit_id":"5167c37255f92bca68218b7e301b060376e0c335","original_commit_id":"5167c37255f92bca68218b7e301b060376e0c335","user":{"login":"golangcibot","id":42910462,"node_id":"MDQ6VXNlcjQyOTEwNDYy","avatar_url":"https://avatars1.githubusercontent.com/u/42910462?v=4","gravatar_id":"","url":"https://api.github.com/users/golangcibot","html_url":"https://github.com/golangcibot","followers_url":"https://api.github.com/users/golangcibot/followers","following_url":"https://api.github.com/users/golangcibot/following{/other_user}","gists_url":"https://api.github.com/users/golangcibot/gists{/gist_id}","starred_url":"https://api.github.com/users/golangcibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/golangcibot/subscriptions","organizations_url":"https://api.github.com/users/golangcibot/orgs","repos_url":"https://api.github.com/users/golangcibot/repos","events_url":"https://api.github.com/users/golangcibot/events{/privacy}","received_events_url":"https://api.github.com/users/golangcibot/received_events","type":"User","site_admin":false},"body":"Error return value of `v.executeOp` is not checked (from `errcheck`)","created_at":"2019-08-12T10:03:36Z","updated_at":"2019-08-12T10:03:36Z","html_url":"https://github.com/nspcc-dev/neo-go/pull/275#discussion_r312853193","pull_request_url":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/275","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/comments/312853193"},"html":{"href":"https://github.com/nspcc-dev/neo-go/pull/275#discussion_r312853193"},"pull_request":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/275"}}},"pull_request":{"url":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/275","id":269805655,"node_id":"MDExOlB1bGxSZXF1ZXN0MjY5ODA1NjU1","html_url":"https://github.com/nspcc-dev/neo-go/pull/275","diff_url":"https://github.com/nspcc-dev/neo-go/pull/275.diff","patch_url":"https://github.com/nspcc-dev/neo-go/pull/275.patch","issue_url":"https://api.github.com/repos/nspcc-dev/neo-go/issues/275","number":275,"state":"open","locked":false,"title":"VM: Implement XSWAP, XTUCK, DEPTH, DROP opcode","user":{"login":"dauTT","id":30392990,"node_id":"MDQ6VXNlcjMwMzkyOTkw","avatar_url":"https://avatars2.githubusercontent.com/u/30392990?v=4","gravatar_id":"","url":"https://api.github.com/users/dauTT","html_url":"https://github.com/dauTT","followers_url":"https://api.github.com/users/dauTT/followers","following_url":"https://api.github.com/users/dauTT/following{/other_user}","gists_url":"https://api.github.com/users/dauTT/gists{/gist_id}","starred_url":"https://api.github.com/users/dauTT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dauTT/subscriptions","organizations_url":"https://api.github.com/users/dauTT/orgs","repos_url":"https://api.github.com/users/dauTT/repos","events_url":"https://api.github.com/users/dauTT/events{/privacy}","received_events_url":"https://api.github.com/users/dauTT/received_events","type":"User","site_admin":false},"body":"Closes #274.\r\n\r\n\r\n","created_at":"2019-04-11T22:42:58Z","updated_at":"2019-08-12T10:03:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"65b89d1da31fa68f53ce14c43d8263a5197e92eb","assignee":{"login":"roman-khimov","id":22092804,"node_id":"MDQ6VXNlcjIyMDkyODA0","avatar_url":"https://avatars3.githubusercontent.com/u/22092804?v=4","gravatar_id":"","url":"https://api.github.com/users/roman-khimov","html_url":"https://github.com/roman-khimov","followers_url":"https://api.github.com/users/roman-khimov/followers","following_url":"https://api.github.com/users/roman-khimov/following{/other_user}","gists_url":"https://api.github.com/users/roman-khimov/gists{/gist_id}","starred_url":"https://api.github.com/users/roman-khimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roman-khimov/subscriptions","organizations_url":"https://api.github.com/users/roman-khimov/orgs","repos_url":"https://api.github.com/users/roman-khimov/repos","events_url":"https://api.github.com/users/roman-khimov/events{/privacy}","received_events_url":"https://api.github.com/users/roman-khimov/received_events","type":"User","site_admin":false},"assignees":[{"login":"roman-khimov","id":22092804,"node_id":"MDQ6VXNlcjIyMDkyODA0","avatar_url":"https://avatars3.githubusercontent.com/u/22092804?v=4","gravatar_id":"","url":"https://api.github.com/users/roman-khimov","html_url":"https://github.com/roman-khimov","followers_url":"https://api.github.com/users/roman-khimov/followers","following_url":"https://api.github.com/users/roman-khimov/following{/other_user}","gists_url":"https://api.github.com/users/roman-khimov/gists{/gist_id}","starred_url":"https://api.github.com/users/roman-khimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roman-khimov/subscriptions","organizations_url":"https://api.github.com/users/roman-khimov/orgs","repos_url":"https://api.github.com/users/roman-khimov/repos","events_url":"https://api.github.com/users/roman-khimov/events{/privacy}","received_events_url":"https://api.github.com/users/roman-khimov/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/275/commits","review_comments_url":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/275/comments","review_comment_url":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nspcc-dev/neo-go/issues/275/comments","statuses_url":"https://api.github.com/repos/nspcc-dev/neo-go/statuses/5167c37255f92bca68218b7e301b060376e0c335","head":{"label":"dauTT:dauTT/vm-XSWAP-XTUCK-DEPTH-DROP-opcode","ref":"dauTT/vm-XSWAP-XTUCK-DEPTH-DROP-opcode","sha":"5167c37255f92bca68218b7e301b060376e0c335","user":{"login":"dauTT","id":30392990,"node_id":"MDQ6VXNlcjMwMzkyOTkw","avatar_url":"https://avatars2.githubusercontent.com/u/30392990?v=4","gravatar_id":"","url":"https://api.github.com/users/dauTT","html_url":"https://github.com/dauTT","followers_url":"https://api.github.com/users/dauTT/followers","following_url":"https://api.github.com/users/dauTT/following{/other_user}","gists_url":"https://api.github.com/users/dauTT/gists{/gist_id}","starred_url":"https://api.github.com/users/dauTT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dauTT/subscriptions","organizations_url":"https://api.github.com/users/dauTT/orgs","repos_url":"https://api.github.com/users/dauTT/repos","events_url":"https://api.github.com/users/dauTT/events{/privacy}","received_events_url":"https://api.github.com/users/dauTT/received_events","type":"User","site_admin":false},"repo":{"id":157017688,"node_id":"MDEwOlJlcG9zaXRvcnkxNTcwMTc2ODg=","name":"neo-go","full_name":"dauTT/neo-go","private":false,"owner":{"login":"dauTT","id":30392990,"node_id":"MDQ6VXNlcjMwMzkyOTkw","avatar_url":"https://avatars2.githubusercontent.com/u/30392990?v=4","gravatar_id":"","url":"https://api.github.com/users/dauTT","html_url":"https://github.com/dauTT","followers_url":"https://api.github.com/users/dauTT/followers","following_url":"https://api.github.com/users/dauTT/following{/other_user}","gists_url":"https://api.github.com/users/dauTT/gists{/gist_id}","starred_url":"https://api.github.com/users/dauTT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dauTT/subscriptions","organizations_url":"https://api.github.com/users/dauTT/orgs","repos_url":"https://api.github.com/users/dauTT/repos","events_url":"https://api.github.com/users/dauTT/events{/privacy}","received_events_url":"https://api.github.com/users/dauTT/received_events","type":"User","site_admin":false},"html_url":"https://github.com/dauTT/neo-go","description":"Go Node and SDK for the NEO blockchain","fork":true,"url":"https://api.github.com/repos/dauTT/neo-go","forks_url":"https://api.github.com/repos/dauTT/neo-go/forks","keys_url":"https://api.github.com/repos/dauTT/neo-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dauTT/neo-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dauTT/neo-go/teams","hooks_url":"https://api.github.com/repos/dauTT/neo-go/hooks","issue_events_url":"https://api.github.com/repos/dauTT/neo-go/issues/events{/number}","events_url":"https://api.github.com/repos/dauTT/neo-go/events","assignees_url":"https://api.github.com/repos/dauTT/neo-go/assignees{/user}","branches_url":"https://api.github.com/repos/dauTT/neo-go/branches{/branch}","tags_url":"https://api.github.com/repos/dauTT/neo-go/tags","blobs_url":"https://api.github.com/repos/dauTT/neo-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dauTT/neo-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dauTT/neo-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/dauTT/neo-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dauTT/neo-go/statuses/{sha}","languages_url":"https://api.github.com/repos/dauTT/neo-go/languages","stargazers_url":"https://api.github.com/repos/dauTT/neo-go/stargazers","contributors_url":"https://api.github.com/repos/dauTT/neo-go/contributors","subscribers_url":"https://api.github.com/repos/dauTT/neo-go/subscribers","subscription_url":"https://api.github.com/repos/dauTT/neo-go/subscription","commits_url":"https://api.github.com/repos/dauTT/neo-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/dauTT/neo-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/dauTT/neo-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/dauTT/neo-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/dauTT/neo-go/contents/{+path}","compare_url":"https://api.github.com/repos/dauTT/neo-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dauTT/neo-go/merges","archive_url":"https://api.github.com/repos/dauTT/neo-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dauTT/neo-go/downloads","issues_url":"https://api.github.com/repos/dauTT/neo-go/issues{/number}","pulls_url":"https://api.github.com/repos/dauTT/neo-go/pulls{/number}","milestones_url":"https://api.github.com/repos/dauTT/neo-go/milestones{/number}","notifications_url":"https://api.github.com/repos/dauTT/neo-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dauTT/neo-go/labels{/name}","releases_url":"https://api.github.com/repos/dauTT/neo-go/releases{/id}","deployments_url":"https://api.github.com/repos/dauTT/neo-go/deployments","created_at":"2018-11-10T20:13:53Z","updated_at":"2019-08-06T11:42:26Z","pushed_at":"2019-08-12T10:02:25Z","git_url":"git://github.com/dauTT/neo-go.git","ssh_url":"git@github.com:dauTT/neo-go.git","clone_url":"https://github.com/dauTT/neo-go.git","svn_url":"https://github.com/dauTT/neo-go","homepage":"","size":11260,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nspcc-dev:vm","ref":"vm","sha":"6c3634cdb89b6ab65da4b6dc0adf5177740a0325","user":{"login":"nspcc-dev","id":45291212,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MjkxMjEy","avatar_url":"https://avatars1.githubusercontent.com/u/45291212?v=4","gravatar_id":"","url":"https://api.github.com/users/nspcc-dev","html_url":"https://github.com/nspcc-dev","followers_url":"https://api.github.com/users/nspcc-dev/followers","following_url":"https://api.github.com/users/nspcc-dev/following{/other_user}","gists_url":"https://api.github.com/users/nspcc-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/nspcc-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nspcc-dev/subscriptions","organizations_url":"https://api.github.com/users/nspcc-dev/orgs","repos_url":"https://api.github.com/users/nspcc-dev/repos","events_url":"https://api.github.com/users/nspcc-dev/events{/privacy}","received_events_url":"https://api.github.com/users/nspcc-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":119681680,"node_id":"MDEwOlJlcG9zaXRvcnkxMTk2ODE2ODA=","name":"neo-go","full_name":"nspcc-dev/neo-go","private":false,"owner":{"login":"nspcc-dev","id":45291212,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MjkxMjEy","avatar_url":"https://avatars1.githubusercontent.com/u/45291212?v=4","gravatar_id":"","url":"https://api.github.com/users/nspcc-dev","html_url":"https://github.com/nspcc-dev","followers_url":"https://api.github.com/users/nspcc-dev/followers","following_url":"https://api.github.com/users/nspcc-dev/following{/other_user}","gists_url":"https://api.github.com/users/nspcc-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/nspcc-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nspcc-dev/subscriptions","organizations_url":"https://api.github.com/users/nspcc-dev/orgs","repos_url":"https://api.github.com/users/nspcc-dev/repos","events_url":"https://api.github.com/users/nspcc-dev/events{/privacy}","received_events_url":"https://api.github.com/users/nspcc-dev/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/nspcc-dev/neo-go","description":"Go Node and SDK for the NEO blockchain","fork":false,"url":"https://api.github.com/repos/nspcc-dev/neo-go","forks_url":"https://api.github.com/repos/nspcc-dev/neo-go/forks","keys_url":"https://api.github.com/repos/nspcc-dev/neo-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nspcc-dev/neo-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nspcc-dev/neo-go/teams","hooks_url":"https://api.github.com/repos/nspcc-dev/neo-go/hooks","issue_events_url":"https://api.github.com/repos/nspcc-dev/neo-go/issues/events{/number}","events_url":"https://api.github.com/repos/nspcc-dev/neo-go/events","assignees_url":"https://api.github.com/repos/nspcc-dev/neo-go/assignees{/user}","branches_url":"https://api.github.com/repos/nspcc-dev/neo-go/branches{/branch}","tags_url":"https://api.github.com/repos/nspcc-dev/neo-go/tags","blobs_url":"https://api.github.com/repos/nspcc-dev/neo-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nspcc-dev/neo-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nspcc-dev/neo-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/nspcc-dev/neo-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nspcc-dev/neo-go/statuses/{sha}","languages_url":"https://api.github.com/repos/nspcc-dev/neo-go/languages","stargazers_url":"https://api.github.com/repos/nspcc-dev/neo-go/stargazers","contributors_url":"https://api.github.com/repos/nspcc-dev/neo-go/contributors","subscribers_url":"https://api.github.com/repos/nspcc-dev/neo-go/subscribers","subscription_url":"https://api.github.com/repos/nspcc-dev/neo-go/subscription","commits_url":"https://api.github.com/repos/nspcc-dev/neo-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/nspcc-dev/neo-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/nspcc-dev/neo-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/nspcc-dev/neo-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/nspcc-dev/neo-go/contents/{+path}","compare_url":"https://api.github.com/repos/nspcc-dev/neo-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nspcc-dev/neo-go/merges","archive_url":"https://api.github.com/repos/nspcc-dev/neo-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nspcc-dev/neo-go/downloads","issues_url":"https://api.github.com/repos/nspcc-dev/neo-go/issues{/number}","pulls_url":"https://api.github.com/repos/nspcc-dev/neo-go/pulls{/number}","milestones_url":"https://api.github.com/repos/nspcc-dev/neo-go/milestones{/number}","notifications_url":"https://api.github.com/repos/nspcc-dev/neo-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nspcc-dev/neo-go/labels{/name}","releases_url":"https://api.github.com/repos/nspcc-dev/neo-go/releases{/id}","deployments_url":"https://api.github.com/repos/nspcc-dev/neo-go/deployments","created_at":"2018-01-31T12:02:17Z","updated_at":"2019-08-12T09:02:13Z","pushed_at":"2019-08-12T10:02:27Z","git_url":"git://github.com/nspcc-dev/neo-go.git","ssh_url":"git@github.com:nspcc-dev/neo-go.git","clone_url":"https://github.com/nspcc-dev/neo-go.git","svn_url":"https://github.com/nspcc-dev/neo-go","homepage":"","size":8737,"stargazers_count":32,"watchers_count":32,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":28,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":55,"license":null,"forks":28,"open_issues":55,"watchers":32,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/275"},"html":{"href":"https://github.com/nspcc-dev/neo-go/pull/275"},"issue":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/issues/275"},"comments":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/issues/275/comments"},"review_comments":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/275/comments"},"review_comment":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/pulls/275/commits"},"statuses":{"href":"https://api.github.com/repos/nspcc-dev/neo-go/statuses/5167c37255f92bca68218b7e301b060376e0c335"}},"author_association":"NONE"}}
{"actor":{"display_login":"golangcibot"}}