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

build_tx.py is not working #4191

Closed
onvej-sl opened this issue Sep 18, 2024 · 1 comment · Fixed by #4092
Closed

build_tx.py is not working #4191

onvej-sl opened this issue Sep 18, 2024 · 1 comment · Fixed by #4092
Assignees
Labels
bug Something isn't working as expected trezorlib Python library and the command line trezorctl tool.

Comments

@onvej-sl
Copy link
Contributor

The tool python/tools/build_tx.py doesn't allow me to exit the loop where inputs are entered:

Coin name [Bitcoin]: 
Blockbook server [btc1.trezor.io]: 

Previous output to spend (txid:vout) []: 1570416eb4302cf52979afd5e6909e37d8fdd874301f7cc87e547e509cb1caa6:0
From address: 1HWDaLTpTCTtRWyWqZkzWx1wex5NKyncLW
Input amount: 100000000
BIP-32 path to derive the key: m/44h/0h/0h/0/0
Script type: SPENDADDRESS
Sequence Number to use (RBF opt-in enabled by default) [4294967293]: 

Previous output to spend (txid:vout) []: 
Error: 
Previous output to spend (txid:vout) []: 

It can be fixed for example by this patch:

diff --git a/python/tools/build_tx.py b/python/tools/build_tx.py
index 12aabc768..422ec37fa 100755
--- a/python/tools/build_tx.py
+++ b/python/tools/build_tx.py
@@ -62,7 +62,9 @@ def _default_script_type(address_n: Optional[List[int]], script_types: Any) -> s
     # return script_types[script_type]
 
 
-def parse_vin(s: str) -> Tuple[bytes, int]:
+def parse_vin(s: str) -> Optional[Tuple[bytes, int]]:
+    if not s:
+        return None
     txid, vout = s.split(":")
     return bytes.fromhex(txid), int(vout)
@onvej-sl onvej-sl added bug Something isn't working as expected trezorlib Python library and the command line trezorctl tool. labels Sep 18, 2024
@matejcik
Copy link
Contributor

fixed here: #4092

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected trezorlib Python library and the command line trezorctl tool.
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants