{"action":"created","comment":{"url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/pulls/comments/217893173","pull_request_review_id":155722654,"id":217893173,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzg5MzE3Mw==","diff_hunk":"@@ -84,14 +87,15 @@ class AssetAccountRepository {\n extension AssetAccount {\n \n     static func create(assetType: AssetType, index: Int32, wallet: Wallet) -> AssetAccount? {\n-        guard let address = wallet.getReceiveAddress(forAccount: index, assetType: type.legacy) else {\n+        guard let address = wallet.getReceiveAddress(forAccount: index, assetType: assetType.legacy) else {\n             return nil\n         }\n-        let name = wallet.getLabelForAccount(index, assetType: type.legacy)\n-        let balance = wallet.getBalanceForAccount(index, assetType: type.legacy) as? CLongLong ?? 0\n+        let name = wallet.getLabelForAccount(index, assetType: assetType.legacy)\n+        let balanceLong = wallet.getBalanceForAccount(index, assetType: assetType.legacy) as? CUnsignedLongLong ?? 0\n+        let balance = Decimal(balanceLong)","path":"Blockchain/Accounts/AssetAccountRepository.swift","position":null,"original_position":34,"commit_id":"c335abb45233bc9a66cb8e77ed2e707fb85c76bb","original_commit_id":"05af9520306dcc6f9813b3107908b6fc91b9c58a","user":{"login":"woudini","id":10579422,"node_id":"MDQ6VXNlcjEwNTc5NDIy","avatar_url":"https://avatars1.githubusercontent.com/u/10579422?v=4","gravatar_id":"","url":"https://api.github.com/users/woudini","html_url":"https://github.com/woudini","followers_url":"https://api.github.com/users/woudini/followers","following_url":"https://api.github.com/users/woudini/following{/other_user}","gists_url":"https://api.github.com/users/woudini/gists{/gist_id}","starred_url":"https://api.github.com/users/woudini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woudini/subscriptions","organizations_url":"https://api.github.com/users/woudini/orgs","repos_url":"https://api.github.com/users/woudini/repos","events_url":"https://api.github.com/users/woudini/events{/privacy}","received_events_url":"https://api.github.com/users/woudini/received_events","type":"User","site_admin":false},"body":"I think this would be better in BTC units instead of satoshis (using `NSNumberFormatter+Currencies`'s `+ (NSString *)satoshiToBTC:(uint64_t)value`)\r\n\r\nI can do this in another PR though if going from `uint64_t` to `CUnsignedLongLong` presents issues","created_at":"2018-09-15T19:15:08Z","updated_at":"2018-09-15T19:15:08Z","html_url":"https://github.com/blockchain/My-Wallet-V3-iOS/pull/497#discussion_r217893173","pull_request_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/pulls/497","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/pulls/comments/217893173"},"html":{"href":"https://github.com/blockchain/My-Wallet-V3-iOS/pull/497#discussion_r217893173"},"pull_request":{"href":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/pulls/497"}}},"pull_request":{"url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/pulls/497","id":215735130,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1NzM1MTMw","html_url":"https://github.com/blockchain/My-Wallet-V3-iOS/pull/497","diff_url":"https://github.com/blockchain/My-Wallet-V3-iOS/pull/497.diff","patch_url":"https://github.com/blockchain/My-Wallet-V3-iOS/pull/497.patch","issue_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/issues/497","number":497,"state":"open","locked":false,"title":"feat(Exchange): IOS-1243 Exchange picker screen","user":{"login":"bchrisarriola","id":38220701,"node_id":"MDQ6VXNlcjM4MjIwNzAx","avatar_url":"https://avatars0.githubusercontent.com/u/38220701?v=4","gravatar_id":"","url":"https://api.github.com/users/bchrisarriola","html_url":"https://github.com/bchrisarriola","followers_url":"https://api.github.com/users/bchrisarriola/followers","following_url":"https://api.github.com/users/bchrisarriola/following{/other_user}","gists_url":"https://api.github.com/users/bchrisarriola/gists{/gist_id}","starred_url":"https://api.github.com/users/bchrisarriola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bchrisarriola/subscriptions","organizations_url":"https://api.github.com/users/bchrisarriola/orgs","repos_url":"https://api.github.com/users/bchrisarriola/repos","events_url":"https://api.github.com/users/bchrisarriola/events{/privacy}","received_events_url":"https://api.github.com/users/bchrisarriola/received_events","type":"User","site_admin":false},"body":"## Objective\r\n\r\nAllowing user to select account to exchange into/out from. This action sheet can be triggered by tapping on the \"Exchange\" or \"Receive\" button in the exchange create view.\r\n\r\n## Description\r\n\r\n**Summary:**\r\n* Created a new struct `AssetAccount` which encapsulates a Blockchain account (this way, we no longer need to pass indices around)\r\n* Created `AssetAccountRepository` which is in charge of fetching `AssetAccount` objects.\r\n\r\n**Looking for input:**\r\n* Not sure where the value for \"fix\" should be stored/coming from (see TODO statement). I'm always passing in `.base` when invoking `updateTradingPair`\r\n* The type for `AssetAccount.balance` is CLongLong. However, looks like the ethereum balance is stored in ether(?) and not the smallest unit, wei so CLongLong won't work. I think this value should be converted to wei in `AssetAccount.balance` so that we are always storing the smallest unit for all assets. Wanted to get input first before doing that (at the moment I just set the balance for Eth to 0) \r\n* Need to also get legacy addresses for BTC and BCH\r\n\r\n## How to Test\r\n\r\nGo to exchange view, tap \"Exchange\"/\"Receive\" button and see picker\r\n\r\n## Screenshot/Design assessment\r\n\r\n![img_0045](https://user-images.githubusercontent.com/38220701/45579632-023f8300-b83e-11e8-8565-f043124cb3eb.PNG)\r\n\r\n## Merge Checklist\r\n\r\n- [X] The PR uses a title supported by [.changelogrc](https://github.com/blockchain/My-Wallet-V3-iOS/blob/dev/.changelogrc#L6...L69).\r\n- [ ] Areas of technical debt are marked with a `// TICKET:` comment that includes a ticket number.\r\n- [X] All unit tests pass.\r\n- [ ] You have added unit tests.\r\n- [X] New files added are within the correct directory. (e.g. if a file is required for unit tests to compile, be sure it is added to the tests target.)\r\n","created_at":"2018-09-14T23:48:53Z","updated_at":"2018-09-15T19:15:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bfc53a4ea3b056f3413f0c0787d4a8297999112e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/pulls/497/commits","review_comments_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/pulls/497/comments","review_comment_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/issues/497/comments","statuses_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/statuses/c335abb45233bc9a66cb8e77ed2e707fb85c76bb","head":{"label":"blockchain:chris/ios-1243/exchange_account_picker","ref":"chris/ios-1243/exchange_account_picker","sha":"c335abb45233bc9a66cb8e77ed2e707fb85c76bb","user":{"login":"blockchain","id":1777722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3Nzc3MjI=","avatar_url":"https://avatars3.githubusercontent.com/u/1777722?v=4","gravatar_id":"","url":"https://api.github.com/users/blockchain","html_url":"https://github.com/blockchain","followers_url":"https://api.github.com/users/blockchain/followers","following_url":"https://api.github.com/users/blockchain/following{/other_user}","gists_url":"https://api.github.com/users/blockchain/gists{/gist_id}","starred_url":"https://api.github.com/users/blockchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blockchain/subscriptions","organizations_url":"https://api.github.com/users/blockchain/orgs","repos_url":"https://api.github.com/users/blockchain/repos","events_url":"https://api.github.com/users/blockchain/events{/privacy}","received_events_url":"https://api.github.com/users/blockchain/received_events","type":"Organization","site_admin":false},"repo":{"id":26277947,"node_id":"MDEwOlJlcG9zaXRvcnkyNjI3Nzk0Nw==","name":"My-Wallet-V3-iOS","full_name":"blockchain/My-Wallet-V3-iOS","private":false,"owner":{"login":"blockchain","id":1777722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3Nzc3MjI=","avatar_url":"https://avatars3.githubusercontent.com/u/1777722?v=4","gravatar_id":"","url":"https://api.github.com/users/blockchain","html_url":"https://github.com/blockchain","followers_url":"https://api.github.com/users/blockchain/followers","following_url":"https://api.github.com/users/blockchain/following{/other_user}","gists_url":"https://api.github.com/users/blockchain/gists{/gist_id}","starred_url":"https://api.github.com/users/blockchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blockchain/subscriptions","organizations_url":"https://api.github.com/users/blockchain/orgs","repos_url":"https://api.github.com/users/blockchain/repos","events_url":"https://api.github.com/users/blockchain/events{/privacy}","received_events_url":"https://api.github.com/users/blockchain/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/blockchain/My-Wallet-V3-iOS","description":"Blockchain iOS Wallet","fork":false,"url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS","forks_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/forks","keys_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/teams","hooks_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/hooks","issue_events_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/events","assignees_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/tags","blobs_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/languages","stargazers_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/stargazers","contributors_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/contributors","subscribers_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/subscribers","subscription_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/subscription","commits_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/merges","archive_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/downloads","issues_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/labels{/name}","releases_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/releases{/id}","deployments_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/deployments","created_at":"2014-11-06T16:07:58Z","updated_at":"2018-09-15T17:34:28Z","pushed_at":"2018-09-15T19:13:42Z","git_url":"git://github.com/blockchain/My-Wallet-V3-iOS.git","ssh_url":"git@github.com:blockchain/My-Wallet-V3-iOS.git","clone_url":"https://github.com/blockchain/My-Wallet-V3-iOS.git","svn_url":"https://github.com/blockchain/My-Wallet-V3-iOS","homepage":"https://itunes.apple.com/us/app/blockchain-bitcoin-wallet/id493253309","size":91213,"stargazers_count":100,"watchers_count":100,"language":"Assembly","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":63,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":63,"open_issues":7,"watchers":100,"default_branch":"dev"}},"base":{"label":"blockchain:dev","ref":"dev","sha":"30b885f8018742f86eb5a5c8f05521f62c930ce4","user":{"login":"blockchain","id":1777722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3Nzc3MjI=","avatar_url":"https://avatars3.githubusercontent.com/u/1777722?v=4","gravatar_id":"","url":"https://api.github.com/users/blockchain","html_url":"https://github.com/blockchain","followers_url":"https://api.github.com/users/blockchain/followers","following_url":"https://api.github.com/users/blockchain/following{/other_user}","gists_url":"https://api.github.com/users/blockchain/gists{/gist_id}","starred_url":"https://api.github.com/users/blockchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blockchain/subscriptions","organizations_url":"https://api.github.com/users/blockchain/orgs","repos_url":"https://api.github.com/users/blockchain/repos","events_url":"https://api.github.com/users/blockchain/events{/privacy}","received_events_url":"https://api.github.com/users/blockchain/received_events","type":"Organization","site_admin":false},"repo":{"id":26277947,"node_id":"MDEwOlJlcG9zaXRvcnkyNjI3Nzk0Nw==","name":"My-Wallet-V3-iOS","full_name":"blockchain/My-Wallet-V3-iOS","private":false,"owner":{"login":"blockchain","id":1777722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3Nzc3MjI=","avatar_url":"https://avatars3.githubusercontent.com/u/1777722?v=4","gravatar_id":"","url":"https://api.github.com/users/blockchain","html_url":"https://github.com/blockchain","followers_url":"https://api.github.com/users/blockchain/followers","following_url":"https://api.github.com/users/blockchain/following{/other_user}","gists_url":"https://api.github.com/users/blockchain/gists{/gist_id}","starred_url":"https://api.github.com/users/blockchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blockchain/subscriptions","organizations_url":"https://api.github.com/users/blockchain/orgs","repos_url":"https://api.github.com/users/blockchain/repos","events_url":"https://api.github.com/users/blockchain/events{/privacy}","received_events_url":"https://api.github.com/users/blockchain/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/blockchain/My-Wallet-V3-iOS","description":"Blockchain iOS Wallet","fork":false,"url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS","forks_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/forks","keys_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/teams","hooks_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/hooks","issue_events_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/events","assignees_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/tags","blobs_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/languages","stargazers_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/stargazers","contributors_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/contributors","subscribers_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/subscribers","subscription_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/subscription","commits_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/merges","archive_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/downloads","issues_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/labels{/name}","releases_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/releases{/id}","deployments_url":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/deployments","created_at":"2014-11-06T16:07:58Z","updated_at":"2018-09-15T17:34:28Z","pushed_at":"2018-09-15T19:13:42Z","git_url":"git://github.com/blockchain/My-Wallet-V3-iOS.git","ssh_url":"git@github.com:blockchain/My-Wallet-V3-iOS.git","clone_url":"https://github.com/blockchain/My-Wallet-V3-iOS.git","svn_url":"https://github.com/blockchain/My-Wallet-V3-iOS","homepage":"https://itunes.apple.com/us/app/blockchain-bitcoin-wallet/id493253309","size":91213,"stargazers_count":100,"watchers_count":100,"language":"Assembly","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":63,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":63,"open_issues":7,"watchers":100,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/pulls/497"},"html":{"href":"https://github.com/blockchain/My-Wallet-V3-iOS/pull/497"},"issue":{"href":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/issues/497"},"comments":{"href":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/issues/497/comments"},"review_comments":{"href":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/pulls/497/comments"},"review_comment":{"href":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/pulls/497/commits"},"statuses":{"href":"https://api.github.com/repos/blockchain/My-Wallet-V3-iOS/statuses/c335abb45233bc9a66cb8e77ed2e707fb85c76bb"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"woudini"}}