{"action":"created","comment":{"url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/pulls/comments/98400767","pull_request_review_id":19038690,"id":98400767,"diff_hunk":"@@ -0,0 +1,39 @@\n+var Web3 = require('web3');\n+var contract = require('../models/contract.js');\n+var contractFunction = require('../models/contractFunction.js');\n+var sqsHelper = require('../helpers/aws/sqsHelper.js');\n+var web3 = new Web3();\n+\n+web3.setProvider(new web3.providers.HttpProvider(process.env.ENODE_BASE || 'http://localhost:8545'));\n+\n+function ContractController() {}\n+\n+ContractController.prototype.setContractFunctionData = function(contractId, contractFunctionId, data) {\n+\treturn contract.read(contractId).then(function(contractResult) {\n+\t\tif (contractResult.rowCount > 0) {\n+\t\t\tvar contractABI = JSON.parse(contractResult.rows[0].abi);","path":"controllers/contractController.js","position":14,"original_position":14,"commit_id":"d98e0cdb2a3fa17a9fccf10d2c81e8d040863c75","original_commit_id":"d98e0cdb2a3fa17a9fccf10d2c81e8d040863c75","user":{"login":"YanlongLai","id":5351366,"avatar_url":"https://avatars.githubusercontent.com/u/5351366?v=3","gravatar_id":"","url":"https://api.github.com/users/YanlongLai","html_url":"https://github.com/YanlongLai","followers_url":"https://api.github.com/users/YanlongLai/followers","following_url":"https://api.github.com/users/YanlongLai/following{/other_user}","gists_url":"https://api.github.com/users/YanlongLai/gists{/gist_id}","starred_url":"https://api.github.com/users/YanlongLai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YanlongLai/subscriptions","organizations_url":"https://api.github.com/users/YanlongLai/orgs","repos_url":"https://api.github.com/users/YanlongLai/repos","events_url":"https://api.github.com/users/YanlongLai/events{/privacy}","received_events_url":"https://api.github.com/users/YanlongLai/received_events","type":"User","site_admin":false},"body":"JSON.parse interprets anything you send to it as a string. It does the equivalent of String(input), meaning literal true, false, 25, null will be accepted. undefined won't, because that isn't valid JSON per section 15.12.1.2 in the spec you posted in the other comment.\r\n\r\n#ref http://stackoverflow.com/questions/17648150/how-does-json-parse-manage-undefined","created_at":"2017-01-30T09:18:13Z","updated_at":"2017-01-30T09:24:30Z","html_url":"https://github.com/blockchainbox/blockchainbox-core/pull/10#discussion_r98400767","pull_request_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/blockchainbox/blockchainbox-core/pulls/comments/98400767"},"html":{"href":"https://github.com/blockchainbox/blockchainbox-core/pull/10#discussion_r98400767"},"pull_request":{"href":"https://api.github.com/repos/blockchainbox/blockchainbox-core/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/pulls/10","id":103698548,"html_url":"https://github.com/blockchainbox/blockchainbox-core/pull/10","diff_url":"https://github.com/blockchainbox/blockchainbox-core/pull/10.diff","patch_url":"https://github.com/blockchainbox/blockchainbox-core/pull/10.patch","issue_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/issues/10","number":10,"state":"open","locked":false,"title":"[Transaction Listener] Add sqsTransactionConsumer and handle transaction event","user":{"login":"PhyrexTsai","id":4505863,"avatar_url":"https://avatars.githubusercontent.com/u/4505863?v=3","gravatar_id":"","url":"https://api.github.com/users/PhyrexTsai","html_url":"https://github.com/PhyrexTsai","followers_url":"https://api.github.com/users/PhyrexTsai/followers","following_url":"https://api.github.com/users/PhyrexTsai/following{/other_user}","gists_url":"https://api.github.com/users/PhyrexTsai/gists{/gist_id}","starred_url":"https://api.github.com/users/PhyrexTsai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhyrexTsai/subscriptions","organizations_url":"https://api.github.com/users/PhyrexTsai/orgs","repos_url":"https://api.github.com/users/PhyrexTsai/repos","events_url":"https://api.github.com/users/PhyrexTsai/events{/privacy}","received_events_url":"https://api.github.com/users/PhyrexTsai/received_events","type":"User","site_admin":false},"body":"### Tsak #3, #4 \r\n\r\n#### Resolves\r\n- Add transaction APIs\r\n```\r\nPOST /contract/v1/function\r\n```\r\n- Add transaction consumer\r\n```\r\n/schedulers/aws/sqsTransactionConsumer.js\r\n```\r\n\r\n#### Test cases\r\n- /tests/contollers/contractControllerTest.js\r\n    - Test send contract method","created_at":"2017-01-30T09:08:34Z","updated_at":"2017-01-30T09:24:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"802863471e7f4211ec9ca8be2cd85e4ff6b21c03","assignee":{"login":"PhyrexTsai","id":4505863,"avatar_url":"https://avatars.githubusercontent.com/u/4505863?v=3","gravatar_id":"","url":"https://api.github.com/users/PhyrexTsai","html_url":"https://github.com/PhyrexTsai","followers_url":"https://api.github.com/users/PhyrexTsai/followers","following_url":"https://api.github.com/users/PhyrexTsai/following{/other_user}","gists_url":"https://api.github.com/users/PhyrexTsai/gists{/gist_id}","starred_url":"https://api.github.com/users/PhyrexTsai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhyrexTsai/subscriptions","organizations_url":"https://api.github.com/users/PhyrexTsai/orgs","repos_url":"https://api.github.com/users/PhyrexTsai/repos","events_url":"https://api.github.com/users/PhyrexTsai/events{/privacy}","received_events_url":"https://api.github.com/users/PhyrexTsai/received_events","type":"User","site_admin":false},"assignees":[{"login":"PhyrexTsai","id":4505863,"avatar_url":"https://avatars.githubusercontent.com/u/4505863?v=3","gravatar_id":"","url":"https://api.github.com/users/PhyrexTsai","html_url":"https://github.com/PhyrexTsai","followers_url":"https://api.github.com/users/PhyrexTsai/followers","following_url":"https://api.github.com/users/PhyrexTsai/following{/other_user}","gists_url":"https://api.github.com/users/PhyrexTsai/gists{/gist_id}","starred_url":"https://api.github.com/users/PhyrexTsai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhyrexTsai/subscriptions","organizations_url":"https://api.github.com/users/PhyrexTsai/orgs","repos_url":"https://api.github.com/users/PhyrexTsai/repos","events_url":"https://api.github.com/users/PhyrexTsai/events{/privacy}","received_events_url":"https://api.github.com/users/PhyrexTsai/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/milestones/6","html_url":"https://github.com/blockchainbox/blockchainbox-core/milestone/6","labels_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/milestones/6/labels","id":2282934,"number":6,"title":"Transaction/Function Listener","description":"","creator":{"login":"PhyrexTsai","id":4505863,"avatar_url":"https://avatars.githubusercontent.com/u/4505863?v=3","gravatar_id":"","url":"https://api.github.com/users/PhyrexTsai","html_url":"https://github.com/PhyrexTsai","followers_url":"https://api.github.com/users/PhyrexTsai/followers","following_url":"https://api.github.com/users/PhyrexTsai/following{/other_user}","gists_url":"https://api.github.com/users/PhyrexTsai/gists{/gist_id}","starred_url":"https://api.github.com/users/PhyrexTsai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhyrexTsai/subscriptions","organizations_url":"https://api.github.com/users/PhyrexTsai/orgs","repos_url":"https://api.github.com/users/PhyrexTsai/repos","events_url":"https://api.github.com/users/PhyrexTsai/events{/privacy}","received_events_url":"https://api.github.com/users/PhyrexTsai/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":0,"state":"open","created_at":"2017-01-27T18:00:38Z","updated_at":"2017-01-30T09:23:57Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/pulls/10/commits","review_comments_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/pulls/10/comments","review_comment_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/issues/10/comments","statuses_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/statuses/d98e0cdb2a3fa17a9fccf10d2c81e8d040863c75","head":{"label":"PhyrexTsai:develop","ref":"develop","sha":"d98e0cdb2a3fa17a9fccf10d2c81e8d040863c75","user":{"login":"PhyrexTsai","id":4505863,"avatar_url":"https://avatars.githubusercontent.com/u/4505863?v=3","gravatar_id":"","url":"https://api.github.com/users/PhyrexTsai","html_url":"https://github.com/PhyrexTsai","followers_url":"https://api.github.com/users/PhyrexTsai/followers","following_url":"https://api.github.com/users/PhyrexTsai/following{/other_user}","gists_url":"https://api.github.com/users/PhyrexTsai/gists{/gist_id}","starred_url":"https://api.github.com/users/PhyrexTsai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhyrexTsai/subscriptions","organizations_url":"https://api.github.com/users/PhyrexTsai/orgs","repos_url":"https://api.github.com/users/PhyrexTsai/repos","events_url":"https://api.github.com/users/PhyrexTsai/events{/privacy}","received_events_url":"https://api.github.com/users/PhyrexTsai/received_events","type":"User","site_admin":false},"repo":{"id":80218394,"name":"blockchainbox-core","full_name":"PhyrexTsai/blockchainbox-core","owner":{"login":"PhyrexTsai","id":4505863,"avatar_url":"https://avatars.githubusercontent.com/u/4505863?v=3","gravatar_id":"","url":"https://api.github.com/users/PhyrexTsai","html_url":"https://github.com/PhyrexTsai","followers_url":"https://api.github.com/users/PhyrexTsai/followers","following_url":"https://api.github.com/users/PhyrexTsai/following{/other_user}","gists_url":"https://api.github.com/users/PhyrexTsai/gists{/gist_id}","starred_url":"https://api.github.com/users/PhyrexTsai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhyrexTsai/subscriptions","organizations_url":"https://api.github.com/users/PhyrexTsai/orgs","repos_url":"https://api.github.com/users/PhyrexTsai/repos","events_url":"https://api.github.com/users/PhyrexTsai/events{/privacy}","received_events_url":"https://api.github.com/users/PhyrexTsai/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PhyrexTsai/blockchainbox-core","description":null,"fork":true,"url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core","forks_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/forks","keys_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/teams","hooks_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/hooks","issue_events_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/issues/events{/number}","events_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/events","assignees_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/assignees{/user}","branches_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/branches{/branch}","tags_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/tags","blobs_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/statuses/{sha}","languages_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/languages","stargazers_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/stargazers","contributors_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/contributors","subscribers_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/subscribers","subscription_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/subscription","commits_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/contents/{+path}","compare_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/merges","archive_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/downloads","issues_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/issues{/number}","pulls_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/pulls{/number}","milestones_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/milestones{/number}","notifications_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/labels{/name}","releases_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/releases{/id}","deployments_url":"https://api.github.com/repos/PhyrexTsai/blockchainbox-core/deployments","created_at":"2017-01-27T15:20:50Z","updated_at":"2017-01-27T15:20:23Z","pushed_at":"2017-01-30T09:04:26Z","git_url":"git://github.com/PhyrexTsai/blockchainbox-core.git","ssh_url":"git@github.com:PhyrexTsai/blockchainbox-core.git","clone_url":"https://github.com/PhyrexTsai/blockchainbox-core.git","svn_url":"https://github.com/PhyrexTsai/blockchainbox-core","homepage":null,"size":18,"stargazers_count":0,"watchers_count":0,"language":null,"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":"blockchainbox:develop","ref":"develop","sha":"7d10ab098592bcb345cc1d6cf0d005c3e635bdc8","user":{"login":"blockchainbox","id":25104186,"avatar_url":"https://avatars.githubusercontent.com/u/25104186?v=3","gravatar_id":"","url":"https://api.github.com/users/blockchainbox","html_url":"https://github.com/blockchainbox","followers_url":"https://api.github.com/users/blockchainbox/followers","following_url":"https://api.github.com/users/blockchainbox/following{/other_user}","gists_url":"https://api.github.com/users/blockchainbox/gists{/gist_id}","starred_url":"https://api.github.com/users/blockchainbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blockchainbox/subscriptions","organizations_url":"https://api.github.com/users/blockchainbox/orgs","repos_url":"https://api.github.com/users/blockchainbox/repos","events_url":"https://api.github.com/users/blockchainbox/events{/privacy}","received_events_url":"https://api.github.com/users/blockchainbox/received_events","type":"Organization","site_admin":false},"repo":{"id":80218363,"name":"blockchainbox-core","full_name":"blockchainbox/blockchainbox-core","owner":{"login":"blockchainbox","id":25104186,"avatar_url":"https://avatars.githubusercontent.com/u/25104186?v=3","gravatar_id":"","url":"https://api.github.com/users/blockchainbox","html_url":"https://github.com/blockchainbox","followers_url":"https://api.github.com/users/blockchainbox/followers","following_url":"https://api.github.com/users/blockchainbox/following{/other_user}","gists_url":"https://api.github.com/users/blockchainbox/gists{/gist_id}","starred_url":"https://api.github.com/users/blockchainbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blockchainbox/subscriptions","organizations_url":"https://api.github.com/users/blockchainbox/orgs","repos_url":"https://api.github.com/users/blockchainbox/repos","events_url":"https://api.github.com/users/blockchainbox/events{/privacy}","received_events_url":"https://api.github.com/users/blockchainbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/blockchainbox/blockchainbox-core","description":null,"fork":false,"url":"https://api.github.com/repos/blockchainbox/blockchainbox-core","forks_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/forks","keys_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/teams","hooks_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/hooks","issue_events_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/issues/events{/number}","events_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/events","assignees_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/assignees{/user}","branches_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/branches{/branch}","tags_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/tags","blobs_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/statuses/{sha}","languages_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/languages","stargazers_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/stargazers","contributors_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/contributors","subscribers_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/subscribers","subscription_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/subscription","commits_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/contents/{+path}","compare_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/merges","archive_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/downloads","issues_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/issues{/number}","pulls_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/pulls{/number}","milestones_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/milestones{/number}","notifications_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/labels{/name}","releases_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/releases{/id}","deployments_url":"https://api.github.com/repos/blockchainbox/blockchainbox-core/deployments","created_at":"2017-01-27T15:20:23Z","updated_at":"2017-01-27T15:20:23Z","pushed_at":"2017-01-30T09:08:34Z","git_url":"git://github.com/blockchainbox/blockchainbox-core.git","ssh_url":"git@github.com:blockchainbox/blockchainbox-core.git","clone_url":"https://github.com/blockchainbox/blockchainbox-core.git","svn_url":"https://github.com/blockchainbox/blockchainbox-core","homepage":null,"size":19,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/blockchainbox/blockchainbox-core/pulls/10"},"html":{"href":"https://github.com/blockchainbox/blockchainbox-core/pull/10"},"issue":{"href":"https://api.github.com/repos/blockchainbox/blockchainbox-core/issues/10"},"comments":{"href":"https://api.github.com/repos/blockchainbox/blockchainbox-core/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/blockchainbox/blockchainbox-core/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/blockchainbox/blockchainbox-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/blockchainbox/blockchainbox-core/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/blockchainbox/blockchainbox-core/statuses/d98e0cdb2a3fa17a9fccf10d2c81e8d040863c75"}}}}
{"actor":{"display_login":"YanlongLai"}}