Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clarify how to break out of build_tx loops #4092

Merged
merged 1 commit into from
Sep 19, 2024
Merged

fix: clarify how to break out of build_tx loops #4092

merged 1 commit into from
Sep 19, 2024

Conversation

ibz
Copy link
Contributor

@ibz ibz commented Aug 7, 2024

Fixes #4191

@ibz ibz self-assigned this Aug 7, 2024
@ibz ibz requested a review from matejcik as a code owner August 7, 2024 10:15
@prusnak
Copy link
Member

prusnak commented Aug 7, 2024

If you enter empty string, the condition above (if not x) will be true and perform break instead of continue, no?

@ibz
Copy link
Contributor Author

ibz commented Aug 7, 2024

If you enter empty string, the condition above (if not x) will be true and perform break instead of continue, no?

I think that was the original intent, indeed. But it does not seem to work for me. If you enter empty string, parse_vin will fail to parse it, and prompt will keep asking you for a new value until it receives one it can parse.

I added the continue for the case where you input an invalid value that is not "", so you will be asked for a new value and break is there to get out of the infinite loop.

@obrusvit
Copy link
Contributor

obrusvit commented Sep 4, 2024

related: #4144

@@ -72,7 +72,7 @@ After authenticating, open the "Send" tab, fill-out all details, then open the "

.. code::

$ python3 tools/build_tx.py | trezorctl btc sign-tx -
$ python3 python/tools/build_tx.py | trezorctl btc sign-tx -
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the "source distribution" is what you get when you download trezor...zip from pypi
so the paths in python/ subdir are relative to that. please revert here & below.

(the change is appropriate in tools/snippets)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. 7407bd7

@matejcik
Copy link
Contributor

it seems that the fix proposed in #4191 is simpler, why not use that?

@ibz
Copy link
Contributor Author

ibz commented Sep 18, 2024

it seems that the fix proposed in #4191 is simpler, why not use that?

That also works, but there are 2 loops I got stuck in, and this PR addresses both.

But sure, I could change parse_vin in this case like the suggested change. But this way it is consistent.

@ibz ibz merged commit c82fad6 into main Sep 19, 2024
85 checks passed
@ibz ibz deleted the ibz/20270807-tx branch September 19, 2024 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Approved
Development

Successfully merging this pull request may close these issues.

build_tx.py is not working
4 participants