{"action":"created","comment":{"url":"https://api.github.com/repos/trezor/trezor-core/pulls/comments/215893369","pull_request_review_id":153259492,"id":215893369,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNTg5MzM2OQ==","diff_hunk":"@@ -0,0 +1,231 @@\n+#!/usr/bin/env python\n+# -*- coding: utf-8 -*-\n+# Author: Dusan Klinec, ph4r05, 2018\n+\n+\n+class TrezorInterface(object):\n+    def __init__(self, ctx=None):\n+        self.ctx = ctx\n+\n+    def gctx(self, ctx):\n+        return ctx if ctx is not None else self.ctx\n+\n+    async def restore_default(self):\n+        from trezor import workflow\n+\n+        workflow.restartdefault()\n+\n+    async def confirm_out(\n+        self, dst, is_change=False, creds=None, int_payment=None, ctx=None\n+    ):\n+        \"\"\"\n+        Single transaction destination confirmation\n+        \"\"\"\n+        from apps.monero.xmr.sub.addr import encode_addr\n+        from apps.monero.xmr.sub.xmr_net import net_version\n+        from apps.monero import layout\n+\n+        ver = net_version(\n+            creds.network_type, dst.is_subaddress, int_payment is not None\n+        )\n+        addr = encode_addr(\n+            ver, dst.addr.spend_public_key, dst.addr.view_public_key, int_payment\n+        )\n+\n+        await layout.require_confirm_tx(\n+            self.gctx(ctx), addr.decode(\"ascii\"), dst.amount, is_change\n+        )\n+\n+    async def confirm_payment_id(self, payment_id, ctx=None):\n+        \"\"\"\n+        Confirm payment ID\n+        :param payment_id:\n+        :param ctx:\n+        :return:","path":"src/apps/monero/controller/iface.py","position":44,"original_position":44,"commit_id":"2b1be83c5af39334f5f7d6833f2df06fb75f9ad8","original_commit_id":"2b1be83c5af39334f5f7d6833f2df06fb75f9ad8","user":{"login":"ph4r05","id":1052761,"node_id":"MDQ6VXNlcjEwNTI3NjE=","avatar_url":"https://avatars2.githubusercontent.com/u/1052761?v=4","gravatar_id":"","url":"https://api.github.com/users/ph4r05","html_url":"https://github.com/ph4r05","followers_url":"https://api.github.com/users/ph4r05/followers","following_url":"https://api.github.com/users/ph4r05/following{/other_user}","gists_url":"https://api.github.com/users/ph4r05/gists{/gist_id}","starred_url":"https://api.github.com/users/ph4r05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ph4r05/subscriptions","organizations_url":"https://api.github.com/users/ph4r05/orgs","repos_url":"https://api.github.com/users/ph4r05/repos","events_url":"https://api.github.com/users/ph4r05/events{/privacy}","received_events_url":"https://api.github.com/users/ph4r05/received_events","type":"User","site_admin":false},"body":"Sure I will remove params docstring. It is mostly unused anyway (PyCharm is generating it automatically when adding the method comment). \r\nSo the basic method description stays if is helpful enough (I mean not just rephrasing the method name)? \r\n\r\nRegarding type hints it is a bit more complicated if the param is of a complex type. I can add the hinting for trivially typed params but I don't think it is doable to add import-needed types as it pollutes general namespace with the imports. And to my surprise, the memory consumption of imported module is quite non-trivial (up to several kB).","created_at":"2018-09-07T09:05:01Z","updated_at":"2018-09-07T09:05:01Z","html_url":"https://github.com/trezor/trezor-core/pull/293#discussion_r215893369","pull_request_url":"https://api.github.com/repos/trezor/trezor-core/pulls/293","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/trezor/trezor-core/pulls/comments/215893369"},"html":{"href":"https://github.com/trezor/trezor-core/pull/293#discussion_r215893369"},"pull_request":{"href":"https://api.github.com/repos/trezor/trezor-core/pulls/293"}},"in_reply_to_id":215597638},"pull_request":{"url":"https://api.github.com/repos/trezor/trezor-core/pulls/293","id":204441035,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0NDQxMDM1","html_url":"https://github.com/trezor/trezor-core/pull/293","diff_url":"https://github.com/trezor/trezor-core/pull/293.diff","patch_url":"https://github.com/trezor/trezor-core/pull/293.patch","issue_url":"https://api.github.com/repos/trezor/trezor-core/issues/293","number":293,"state":"open","locked":false,"title":"Monero support added [for review]","user":{"login":"ph4r05","id":1052761,"node_id":"MDQ6VXNlcjEwNTI3NjE=","avatar_url":"https://avatars2.githubusercontent.com/u/1052761?v=4","gravatar_id":"","url":"https://api.github.com/users/ph4r05","html_url":"https://github.com/ph4r05","followers_url":"https://api.github.com/users/ph4r05/followers","following_url":"https://api.github.com/users/ph4r05/following{/other_user}","gists_url":"https://api.github.com/users/ph4r05/gists{/gist_id}","starred_url":"https://api.github.com/users/ph4r05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ph4r05/subscriptions","organizations_url":"https://api.github.com/users/ph4r05/orgs","repos_url":"https://api.github.com/users/ph4r05/repos","events_url":"https://api.github.com/users/ph4r05/events{/privacy}","received_events_url":"https://api.github.com/users/ph4r05/received_events","type":"User","site_admin":false},"body":"The first  review attempt for Monero code.\r\n\r\nCode can be tested with monero-agent as with the previous PoC:\r\nhttps://github.com/ph4r05/monero-agent\r\n\r\nDocumentation for PoC (section \"Testing with Trezor\"):\r\nhttps://github.com/ph4r05/monero-agent/blob/master/PoC.md\r\n\r\nFor testing you may actually need my forks as I use my dependencies with PRs merged (update submodules after clone).\r\nhttps://github.com/ph4r05/trezor-core/tree/xmr-total-full\r\n\r\nIntegration docs:\r\nhttps://github.com/ph4r05/monero-trezor-doc\r\n\r\nThis PR depends on PRs:\r\n\r\n- https://github.com/trezor/trezor-crypto/pull/169\r\n\r\n","created_at":"2018-07-27T14:02:11Z","updated_at":"2018-09-07T09:05:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe604ec84bb0b41e8f5d311dff81160aee0fb11e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":857209162,"node_id":"MDU6TGFiZWw4NTcyMDkxNjI=","url":"https://api.github.com/repos/trezor/trezor-core/labels/altcoin","name":"altcoin","color":"c2e0c6","default":false},{"id":849229353,"node_id":"MDU6TGFiZWw4NDkyMjkzNTM=","url":"https://api.github.com/repos/trezor/trezor-core/labels/firmware","name":"firmware","color":"c5def5","default":false}],"milestone":{"url":"https://api.github.com/repos/trezor/trezor-core/milestones/4","html_url":"https://github.com/trezor/trezor-core/milestone/4","labels_url":"https://api.github.com/repos/trezor/trezor-core/milestones/4/labels","id":3437149,"node_id":"MDk6TWlsZXN0b25lMzQzNzE0OQ==","number":4,"title":"v2.0.8","description":"","creator":{"login":"prusnak","id":42201,"node_id":"MDQ6VXNlcjQyMjAx","avatar_url":"https://avatars2.githubusercontent.com/u/42201?v=4","gravatar_id":"","url":"https://api.github.com/users/prusnak","html_url":"https://github.com/prusnak","followers_url":"https://api.github.com/users/prusnak/followers","following_url":"https://api.github.com/users/prusnak/following{/other_user}","gists_url":"https://api.github.com/users/prusnak/gists{/gist_id}","starred_url":"https://api.github.com/users/prusnak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prusnak/subscriptions","organizations_url":"https://api.github.com/users/prusnak/orgs","repos_url":"https://api.github.com/users/prusnak/repos","events_url":"https://api.github.com/users/prusnak/events{/privacy}","received_events_url":"https://api.github.com/users/prusnak/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":10,"state":"open","created_at":"2018-06-19T22:19:39Z","updated_at":"2018-08-13T12:09:05Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/trezor/trezor-core/pulls/293/commits","review_comments_url":"https://api.github.com/repos/trezor/trezor-core/pulls/293/comments","review_comment_url":"https://api.github.com/repos/trezor/trezor-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trezor/trezor-core/issues/293/comments","statuses_url":"https://api.github.com/repos/trezor/trezor-core/statuses/2b1be83c5af39334f5f7d6833f2df06fb75f9ad8","head":{"label":"ph4r05:xmr-total-2","ref":"xmr-total-2","sha":"2b1be83c5af39334f5f7d6833f2df06fb75f9ad8","user":{"login":"ph4r05","id":1052761,"node_id":"MDQ6VXNlcjEwNTI3NjE=","avatar_url":"https://avatars2.githubusercontent.com/u/1052761?v=4","gravatar_id":"","url":"https://api.github.com/users/ph4r05","html_url":"https://github.com/ph4r05","followers_url":"https://api.github.com/users/ph4r05/followers","following_url":"https://api.github.com/users/ph4r05/following{/other_user}","gists_url":"https://api.github.com/users/ph4r05/gists{/gist_id}","starred_url":"https://api.github.com/users/ph4r05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ph4r05/subscriptions","organizations_url":"https://api.github.com/users/ph4r05/orgs","repos_url":"https://api.github.com/users/ph4r05/repos","events_url":"https://api.github.com/users/ph4r05/events{/privacy}","received_events_url":"https://api.github.com/users/ph4r05/received_events","type":"User","site_admin":false},"repo":{"id":117886575,"node_id":"MDEwOlJlcG9zaXRvcnkxMTc4ODY1NzU=","name":"trezor-core","full_name":"ph4r05/trezor-core","owner":{"login":"ph4r05","id":1052761,"node_id":"MDQ6VXNlcjEwNTI3NjE=","avatar_url":"https://avatars2.githubusercontent.com/u/1052761?v=4","gravatar_id":"","url":"https://api.github.com/users/ph4r05","html_url":"https://github.com/ph4r05","followers_url":"https://api.github.com/users/ph4r05/followers","following_url":"https://api.github.com/users/ph4r05/following{/other_user}","gists_url":"https://api.github.com/users/ph4r05/gists{/gist_id}","starred_url":"https://api.github.com/users/ph4r05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ph4r05/subscriptions","organizations_url":"https://api.github.com/users/ph4r05/orgs","repos_url":"https://api.github.com/users/ph4r05/repos","events_url":"https://api.github.com/users/ph4r05/events{/privacy}","received_events_url":"https://api.github.com/users/ph4r05/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ph4r05/trezor-core","description":":lock: TREZOR Core","fork":true,"url":"https://api.github.com/repos/ph4r05/trezor-core","forks_url":"https://api.github.com/repos/ph4r05/trezor-core/forks","keys_url":"https://api.github.com/repos/ph4r05/trezor-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ph4r05/trezor-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ph4r05/trezor-core/teams","hooks_url":"https://api.github.com/repos/ph4r05/trezor-core/hooks","issue_events_url":"https://api.github.com/repos/ph4r05/trezor-core/issues/events{/number}","events_url":"https://api.github.com/repos/ph4r05/trezor-core/events","assignees_url":"https://api.github.com/repos/ph4r05/trezor-core/assignees{/user}","branches_url":"https://api.github.com/repos/ph4r05/trezor-core/branches{/branch}","tags_url":"https://api.github.com/repos/ph4r05/trezor-core/tags","blobs_url":"https://api.github.com/repos/ph4r05/trezor-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ph4r05/trezor-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ph4r05/trezor-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/ph4r05/trezor-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ph4r05/trezor-core/statuses/{sha}","languages_url":"https://api.github.com/repos/ph4r05/trezor-core/languages","stargazers_url":"https://api.github.com/repos/ph4r05/trezor-core/stargazers","contributors_url":"https://api.github.com/repos/ph4r05/trezor-core/contributors","subscribers_url":"https://api.github.com/repos/ph4r05/trezor-core/subscribers","subscription_url":"https://api.github.com/repos/ph4r05/trezor-core/subscription","commits_url":"https://api.github.com/repos/ph4r05/trezor-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/ph4r05/trezor-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/ph4r05/trezor-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/ph4r05/trezor-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/ph4r05/trezor-core/contents/{+path}","compare_url":"https://api.github.com/repos/ph4r05/trezor-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ph4r05/trezor-core/merges","archive_url":"https://api.github.com/repos/ph4r05/trezor-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ph4r05/trezor-core/downloads","issues_url":"https://api.github.com/repos/ph4r05/trezor-core/issues{/number}","pulls_url":"https://api.github.com/repos/ph4r05/trezor-core/pulls{/number}","milestones_url":"https://api.github.com/repos/ph4r05/trezor-core/milestones{/number}","notifications_url":"https://api.github.com/repos/ph4r05/trezor-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ph4r05/trezor-core/labels{/name}","releases_url":"https://api.github.com/repos/ph4r05/trezor-core/releases{/id}","deployments_url":"https://api.github.com/repos/ph4r05/trezor-core/deployments","created_at":"2018-01-17T20:04:53Z","updated_at":"2018-08-15T14:45:15Z","pushed_at":"2018-09-07T08:53:56Z","git_url":"git://github.com/ph4r05/trezor-core.git","ssh_url":"git@github.com:ph4r05/trezor-core.git","clone_url":"https://github.com/ph4r05/trezor-core.git","svn_url":"https://github.com/ph4r05/trezor-core","homepage":"https://trezor.io/","size":14621,"stargazers_count":0,"watchers_count":0,"language":"Python","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":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"trezor:master","ref":"master","sha":"ebdd8c9b07537351c7dedec4db6e1fcbeb0426ef","user":{"login":"trezor","id":4146447,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxNDY0NDc=","avatar_url":"https://avatars1.githubusercontent.com/u/4146447?v=4","gravatar_id":"","url":"https://api.github.com/users/trezor","html_url":"https://github.com/trezor","followers_url":"https://api.github.com/users/trezor/followers","following_url":"https://api.github.com/users/trezor/following{/other_user}","gists_url":"https://api.github.com/users/trezor/gists{/gist_id}","starred_url":"https://api.github.com/users/trezor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trezor/subscriptions","organizations_url":"https://api.github.com/users/trezor/orgs","repos_url":"https://api.github.com/users/trezor/repos","events_url":"https://api.github.com/users/trezor/events{/privacy}","received_events_url":"https://api.github.com/users/trezor/received_events","type":"Organization","site_admin":false},"repo":{"id":46493241,"node_id":"MDEwOlJlcG9zaXRvcnk0NjQ5MzI0MQ==","name":"trezor-core","full_name":"trezor/trezor-core","owner":{"login":"trezor","id":4146447,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxNDY0NDc=","avatar_url":"https://avatars1.githubusercontent.com/u/4146447?v=4","gravatar_id":"","url":"https://api.github.com/users/trezor","html_url":"https://github.com/trezor","followers_url":"https://api.github.com/users/trezor/followers","following_url":"https://api.github.com/users/trezor/following{/other_user}","gists_url":"https://api.github.com/users/trezor/gists{/gist_id}","starred_url":"https://api.github.com/users/trezor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trezor/subscriptions","organizations_url":"https://api.github.com/users/trezor/orgs","repos_url":"https://api.github.com/users/trezor/repos","events_url":"https://api.github.com/users/trezor/events{/privacy}","received_events_url":"https://api.github.com/users/trezor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trezor/trezor-core","description":":lock: TREZOR Core","fork":false,"url":"https://api.github.com/repos/trezor/trezor-core","forks_url":"https://api.github.com/repos/trezor/trezor-core/forks","keys_url":"https://api.github.com/repos/trezor/trezor-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trezor/trezor-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trezor/trezor-core/teams","hooks_url":"https://api.github.com/repos/trezor/trezor-core/hooks","issue_events_url":"https://api.github.com/repos/trezor/trezor-core/issues/events{/number}","events_url":"https://api.github.com/repos/trezor/trezor-core/events","assignees_url":"https://api.github.com/repos/trezor/trezor-core/assignees{/user}","branches_url":"https://api.github.com/repos/trezor/trezor-core/branches{/branch}","tags_url":"https://api.github.com/repos/trezor/trezor-core/tags","blobs_url":"https://api.github.com/repos/trezor/trezor-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trezor/trezor-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trezor/trezor-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/trezor/trezor-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trezor/trezor-core/statuses/{sha}","languages_url":"https://api.github.com/repos/trezor/trezor-core/languages","stargazers_url":"https://api.github.com/repos/trezor/trezor-core/stargazers","contributors_url":"https://api.github.com/repos/trezor/trezor-core/contributors","subscribers_url":"https://api.github.com/repos/trezor/trezor-core/subscribers","subscription_url":"https://api.github.com/repos/trezor/trezor-core/subscription","commits_url":"https://api.github.com/repos/trezor/trezor-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/trezor/trezor-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/trezor/trezor-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/trezor/trezor-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/trezor/trezor-core/contents/{+path}","compare_url":"https://api.github.com/repos/trezor/trezor-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trezor/trezor-core/merges","archive_url":"https://api.github.com/repos/trezor/trezor-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trezor/trezor-core/downloads","issues_url":"https://api.github.com/repos/trezor/trezor-core/issues{/number}","pulls_url":"https://api.github.com/repos/trezor/trezor-core/pulls{/number}","milestones_url":"https://api.github.com/repos/trezor/trezor-core/milestones{/number}","notifications_url":"https://api.github.com/repos/trezor/trezor-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trezor/trezor-core/labels{/name}","releases_url":"https://api.github.com/repos/trezor/trezor-core/releases{/id}","deployments_url":"https://api.github.com/repos/trezor/trezor-core/deployments","created_at":"2015-11-19T13:16:23Z","updated_at":"2018-09-06T22:26:50Z","pushed_at":"2018-09-06T17:24:08Z","git_url":"git://github.com/trezor/trezor-core.git","ssh_url":"git@github.com:trezor/trezor-core.git","clone_url":"https://github.com/trezor/trezor-core.git","svn_url":"https://github.com/trezor/trezor-core","homepage":"https://trezor.io/","size":13784,"stargazers_count":247,"watchers_count":247,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":108,"mirror_url":null,"archived":false,"open_issues_count":53,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":108,"open_issues":53,"watchers":247,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/trezor/trezor-core/pulls/293"},"html":{"href":"https://github.com/trezor/trezor-core/pull/293"},"issue":{"href":"https://api.github.com/repos/trezor/trezor-core/issues/293"},"comments":{"href":"https://api.github.com/repos/trezor/trezor-core/issues/293/comments"},"review_comments":{"href":"https://api.github.com/repos/trezor/trezor-core/pulls/293/comments"},"review_comment":{"href":"https://api.github.com/repos/trezor/trezor-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trezor/trezor-core/pulls/293/commits"},"statuses":{"href":"https://api.github.com/repos/trezor/trezor-core/statuses/2b1be83c5af39334f5f7d6833f2df06fb75f9ad8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ph4r05"}}