{"action":"created","comment":{"url":"https://api.github.com/repos/LockChainLtd/Centralized-App/pulls/comments/178466523","pull_request_review_id":108526412,"id":178466523,"diff_hunk":"@@ -47,125 +39,99 @@ export class HotelReservation {\n \t\thotelId,\n \t\troomId,\n \t\tnumberOfTravelers) {\n-\t\tconst userKeys = jsonFileToKeys(jsonObj, password);\n-\t\tconst callOptions = {\n-\t\t\tfrom: userKeys.address,\n-\t\t\tgas: gasConfig.hotelReservation.create\n-\t\t};\n \n \t\tconst reservationStartDateFormatted = formatStartDateTimestamp(reservationStartDate);\n \t\tconst reservationEndDateFormatted = formatEndDateTimestamp(reservationEndDate);\n-\t\tconst hotelReservationIdHex = web3.utils.utf8ToHex(hotelReservationId);\n-\t\tconst hotelIdHex = web3.utils.utf8ToHex(hotelId);\n-\t\tconst roomIdHex = web3.utils.utf8ToHex(roomId);\n+\t\tconst hotelReservationIdBytes = ethers.utils.toUtf8Bytes(hotelReservationId);\n+\t\tconst hotelIdBytes = ethers.utils.toUtf8Bytes(hotelId);\n+\t\tconst roomIdBytes = ethers.utils.toUtf8Bytes(roomId);\n+\t\tlet wallet = await ethers.Wallet.fromEncryptedWallet(jsonObj, password);\n+\t\tconst gasPrice = await getGasPrice();\n \n \t\tawait validateReservationParams(jsonObj,\n \t\t\tpassword,\n-\t\t\thotelReservationIdHex,\n+\t\t\thotelReservationIdBytes,\n \t\t\treservationCostLOC,\n \t\t\treservationStartDateFormatted,\n \t\t\treservationEndDateFormatted,\n \t\t\tdaysBeforeStartForRefund,\n \t\t\trefundPercentage,\n-\t\t\thotelIdHex,\n-\t\t\troomIdHex,\n-\t\t\tnumberOfTravelers,\n-\t\t\tcallOptions);\n+\t\t\thotelIdBytes,\n+\t\t\troomIdBytes,\n+\t\t\tnumberOfTravelers);\n \n-\t\tawait validateLocBalance(userKeys.address, reservationCostLOC, gasConfig.hotelReservation.create);\n+\t\tawait validateLocBalance(wallet.address, reservationCostLOC, wallet, gasConfig.hotelReservation.create);\n \n \t\tawait fundTransactionAmountIfNeeded(\n-\t\t\tuserKeys.address,\n-\t\t\tuserKeys.privateKey,\n+\t\t\twallet.address,\n+\t\t\twallet.privateKey,\n \t\t\tgasConfig.hotelReservation.create\n \t\t);\n \n \n-\t\tawait approveContract(userKeys.address, userKeys.privateKey, reservationCostLOC, HotelReservationFactoryContract._address);\n+\t\tawait approveContract(wallet, reservationCostLOC, HotelReservationFactoryContract.address, gasPrice);\n+\n+\t\tlet HotelReservationFactoryContractWithWalletInstance = await HotelReservationFactoryContractWithWallet(wallet);","path":"src/services/blockchain/hotelReservation.js","position":93,"original_position":93,"commit_id":"77638a53ccc78172ed6846a9b7371dfdb6df3266","original_commit_id":"77638a53ccc78172ed6846a9b7371dfdb6df3266","user":{"login":"Perseverance","id":5130509,"avatar_url":"https://avatars0.githubusercontent.com/u/5130509?v=4","gravatar_id":"","url":"https://api.github.com/users/Perseverance","html_url":"https://github.com/Perseverance","followers_url":"https://api.github.com/users/Perseverance/followers","following_url":"https://api.github.com/users/Perseverance/following{/other_user}","gists_url":"https://api.github.com/users/Perseverance/gists{/gist_id}","starred_url":"https://api.github.com/users/Perseverance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Perseverance/subscriptions","organizations_url":"https://api.github.com/users/Perseverance/orgs","repos_url":"https://api.github.com/users/Perseverance/repos","events_url":"https://api.github.com/users/Perseverance/events{/privacy}","received_events_url":"https://api.github.com/users/Perseverance/received_events","type":"User","site_admin":false},"body":"Creating contract is not async - you dont need await","created_at":"2018-04-01T19:10:18Z","updated_at":"2018-04-01T19:12:33Z","html_url":"https://github.com/LockChainLtd/Centralized-App/pull/48#discussion_r178466523","pull_request_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/pulls/48","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/LockChainLtd/Centralized-App/pulls/comments/178466523"},"html":{"href":"https://github.com/LockChainLtd/Centralized-App/pull/48#discussion_r178466523"},"pull_request":{"href":"https://api.github.com/repos/LockChainLtd/Centralized-App/pulls/48"}}},"pull_request":{"url":"https://api.github.com/repos/LockChainLtd/Centralized-App/pulls/48","id":178537298,"html_url":"https://github.com/LockChainLtd/Centralized-App/pull/48","diff_url":"https://github.com/LockChainLtd/Centralized-App/pull/48.diff","patch_url":"https://github.com/LockChainLtd/Centralized-App/pull/48.patch","issue_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/issues/48","number":48,"state":"open","locked":false,"title":"Migrate from web3js to ethersjs library","user":{"login":"maptuhec","id":33101661,"avatar_url":"https://avatars2.githubusercontent.com/u/33101661?v=4","gravatar_id":"","url":"https://api.github.com/users/maptuhec","html_url":"https://github.com/maptuhec","followers_url":"https://api.github.com/users/maptuhec/followers","following_url":"https://api.github.com/users/maptuhec/following{/other_user}","gists_url":"https://api.github.com/users/maptuhec/gists{/gist_id}","starred_url":"https://api.github.com/users/maptuhec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maptuhec/subscriptions","organizations_url":"https://api.github.com/users/maptuhec/orgs","repos_url":"https://api.github.com/users/maptuhec/repos","events_url":"https://api.github.com/users/maptuhec/events{/privacy}","received_events_url":"https://api.github.com/users/maptuhec/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-30T10:38:40Z","updated_at":"2018-04-01T19:12:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10aed29698ac6b0c3d5b30a3c8ab82f4c5dd76a8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/pulls/48/commits","review_comments_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/pulls/48/comments","review_comment_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/issues/48/comments","statuses_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/statuses/77638a53ccc78172ed6846a9b7371dfdb6df3266","head":{"label":"LockChainLtd:migrate-to-etherjs","ref":"migrate-to-etherjs","sha":"77638a53ccc78172ed6846a9b7371dfdb6df3266","user":{"login":"LockChainLtd","id":32219879,"avatar_url":"https://avatars2.githubusercontent.com/u/32219879?v=4","gravatar_id":"","url":"https://api.github.com/users/LockChainLtd","html_url":"https://github.com/LockChainLtd","followers_url":"https://api.github.com/users/LockChainLtd/followers","following_url":"https://api.github.com/users/LockChainLtd/following{/other_user}","gists_url":"https://api.github.com/users/LockChainLtd/gists{/gist_id}","starred_url":"https://api.github.com/users/LockChainLtd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LockChainLtd/subscriptions","organizations_url":"https://api.github.com/users/LockChainLtd/orgs","repos_url":"https://api.github.com/users/LockChainLtd/repos","events_url":"https://api.github.com/users/LockChainLtd/events{/privacy}","received_events_url":"https://api.github.com/users/LockChainLtd/received_events","type":"Organization","site_admin":false},"repo":{"id":110853416,"name":"Centralized-App","full_name":"LockChainLtd/Centralized-App","owner":{"login":"LockChainLtd","id":32219879,"avatar_url":"https://avatars2.githubusercontent.com/u/32219879?v=4","gravatar_id":"","url":"https://api.github.com/users/LockChainLtd","html_url":"https://github.com/LockChainLtd","followers_url":"https://api.github.com/users/LockChainLtd/followers","following_url":"https://api.github.com/users/LockChainLtd/following{/other_user}","gists_url":"https://api.github.com/users/LockChainLtd/gists{/gist_id}","starred_url":"https://api.github.com/users/LockChainLtd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LockChainLtd/subscriptions","organizations_url":"https://api.github.com/users/LockChainLtd/orgs","repos_url":"https://api.github.com/users/LockChainLtd/repos","events_url":"https://api.github.com/users/LockChainLtd/events{/privacy}","received_events_url":"https://api.github.com/users/LockChainLtd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LockChainLtd/Centralized-App","description":"Web design of lockchain.co market","fork":false,"url":"https://api.github.com/repos/LockChainLtd/Centralized-App","forks_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/forks","keys_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/teams","hooks_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/hooks","issue_events_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/issues/events{/number}","events_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/events","assignees_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/assignees{/user}","branches_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/branches{/branch}","tags_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/tags","blobs_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/git/refs{/sha}","trees_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/statuses/{sha}","languages_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/languages","stargazers_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/stargazers","contributors_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/contributors","subscribers_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/subscribers","subscription_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/subscription","commits_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/commits{/sha}","git_commits_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/git/commits{/sha}","comments_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/comments{/number}","issue_comment_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/issues/comments{/number}","contents_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/contents/{+path}","compare_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/merges","archive_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/downloads","issues_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/issues{/number}","pulls_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/pulls{/number}","milestones_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/milestones{/number}","notifications_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/labels{/name}","releases_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/releases{/id}","deployments_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/deployments","created_at":"2017-11-15T15:47:07Z","updated_at":"2018-03-27T08:22:24Z","pushed_at":"2018-04-01T18:05:31Z","git_url":"git://github.com/LockChainLtd/Centralized-App.git","ssh_url":"git@github.com:LockChainLtd/Centralized-App.git","clone_url":"https://github.com/LockChainLtd/Centralized-App.git","svn_url":"https://github.com/LockChainLtd/Centralized-App","homepage":null,"size":18953,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":4,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"LockChainLtd:blockchain-stable","ref":"blockchain-stable","sha":"0eb995d2ad605655d17d03b32512ca2bb71180b8","user":{"login":"LockChainLtd","id":32219879,"avatar_url":"https://avatars2.githubusercontent.com/u/32219879?v=4","gravatar_id":"","url":"https://api.github.com/users/LockChainLtd","html_url":"https://github.com/LockChainLtd","followers_url":"https://api.github.com/users/LockChainLtd/followers","following_url":"https://api.github.com/users/LockChainLtd/following{/other_user}","gists_url":"https://api.github.com/users/LockChainLtd/gists{/gist_id}","starred_url":"https://api.github.com/users/LockChainLtd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LockChainLtd/subscriptions","organizations_url":"https://api.github.com/users/LockChainLtd/orgs","repos_url":"https://api.github.com/users/LockChainLtd/repos","events_url":"https://api.github.com/users/LockChainLtd/events{/privacy}","received_events_url":"https://api.github.com/users/LockChainLtd/received_events","type":"Organization","site_admin":false},"repo":{"id":110853416,"name":"Centralized-App","full_name":"LockChainLtd/Centralized-App","owner":{"login":"LockChainLtd","id":32219879,"avatar_url":"https://avatars2.githubusercontent.com/u/32219879?v=4","gravatar_id":"","url":"https://api.github.com/users/LockChainLtd","html_url":"https://github.com/LockChainLtd","followers_url":"https://api.github.com/users/LockChainLtd/followers","following_url":"https://api.github.com/users/LockChainLtd/following{/other_user}","gists_url":"https://api.github.com/users/LockChainLtd/gists{/gist_id}","starred_url":"https://api.github.com/users/LockChainLtd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LockChainLtd/subscriptions","organizations_url":"https://api.github.com/users/LockChainLtd/orgs","repos_url":"https://api.github.com/users/LockChainLtd/repos","events_url":"https://api.github.com/users/LockChainLtd/events{/privacy}","received_events_url":"https://api.github.com/users/LockChainLtd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LockChainLtd/Centralized-App","description":"Web design of lockchain.co market","fork":false,"url":"https://api.github.com/repos/LockChainLtd/Centralized-App","forks_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/forks","keys_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/teams","hooks_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/hooks","issue_events_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/issues/events{/number}","events_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/events","assignees_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/assignees{/user}","branches_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/branches{/branch}","tags_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/tags","blobs_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/git/refs{/sha}","trees_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/statuses/{sha}","languages_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/languages","stargazers_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/stargazers","contributors_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/contributors","subscribers_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/subscribers","subscription_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/subscription","commits_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/commits{/sha}","git_commits_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/git/commits{/sha}","comments_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/comments{/number}","issue_comment_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/issues/comments{/number}","contents_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/contents/{+path}","compare_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/merges","archive_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/downloads","issues_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/issues{/number}","pulls_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/pulls{/number}","milestones_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/milestones{/number}","notifications_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/labels{/name}","releases_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/releases{/id}","deployments_url":"https://api.github.com/repos/LockChainLtd/Centralized-App/deployments","created_at":"2017-11-15T15:47:07Z","updated_at":"2018-03-27T08:22:24Z","pushed_at":"2018-04-01T18:05:31Z","git_url":"git://github.com/LockChainLtd/Centralized-App.git","ssh_url":"git@github.com:LockChainLtd/Centralized-App.git","clone_url":"https://github.com/LockChainLtd/Centralized-App.git","svn_url":"https://github.com/LockChainLtd/Centralized-App","homepage":null,"size":18953,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":4,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/LockChainLtd/Centralized-App/pulls/48"},"html":{"href":"https://github.com/LockChainLtd/Centralized-App/pull/48"},"issue":{"href":"https://api.github.com/repos/LockChainLtd/Centralized-App/issues/48"},"comments":{"href":"https://api.github.com/repos/LockChainLtd/Centralized-App/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/LockChainLtd/Centralized-App/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/LockChainLtd/Centralized-App/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LockChainLtd/Centralized-App/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/LockChainLtd/Centralized-App/statuses/77638a53ccc78172ed6846a9b7371dfdb6df3266"}},"author_association":"NONE"}}
{"actor":{"display_login":"Perseverance"}}