chore(python): remove deprecated `details` argument from `btc.sign_tx()`
What changed, and why it matters
This is a routine cleanup in Trezor's Python library. It removes an old, already-deprecated way of passing extra transaction signing options (the `details` argument) from the `btc.sign_tx()` helper. Users who still relied on that old argument will now get a normal Python error instead of a deprecation warning, but the change does not fix or introduce any security vulnerability.
No security action required. Developers using the Python library should update any code still passing `details=` to `btc.sign_tx()` and switch to the equivalent kwargs instead.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit deletes the deprecated details: Optional[messages.SignTx] = None parameter and its associated warnings.warn(...) fallback from python/src/trezorlib/btc.py. Since the parameter was already deprecated in commit 3d6d1a56ac595866b0d826445caeb429bac13a26, this change simply enforces the newer kwargs-based API. The functional behavior when the argument was not used is unchanged.
Changed components
python/src/trezorlib/btc.pyInspect captured patch +11 / −24
### python/.changelog.d/+signtx-details.removed
@@ -0,0 +1 @@
+Remove deprecated `details` argument from `btc.sign_tx()`.
### python/src/trezorlib/btc.py
@@ -16,7 +16,6 @@
from __future__ import annotations
-import warnings
from collections.abc import Sequence
from copy import copy
from decimal import Decimal
@@ -276,7 +275,6 @@ def sign_tx(
coin_name: str,
inputs: Sequence[messages.TxInputType],
outputs: Sequence[messages.TxOutputType],
- details: Optional[messages.SignTx] = None,
prev_txes: Optional["TxCacheType"] = None,
payment_reqs: Sequence[messages.PaymentRequest] = (),
preauthorized: bool = False,
@@ -298,28 +296,16 @@ def sign_tx(
if prev_txes is None:
prev_txes = {}
- if details is not None:
- warnings.warn(
- "'details' argument is deprecated, use kwargs instead",
- DeprecationWarning,
- stacklevel=2,
- )
- signtx = details
- signtx.coin_name = coin_name
- signtx.inputs_count = len(inputs)
- signtx.outputs_count = len(outputs)
-
- else:
- signtx = messages.SignTx(
- coin_name=coin_name,
- inputs_count=len(inputs),
- outputs_count=len(outputs),
- )
- for name, value in kwargs.items():
- if messages.SignTx.get_field(name) is not None:
- setattr(signtx, name, value)
- else:
- raise ValueError(f"Unknown attribute for SignTx: {name}")
+ signtx = messages.SignTx(
+ coin_name=coin_name,
+ inputs_count=len(inputs),
+ outputs_count=len(outputs),
+ )
+ for name, value in kwargs.items():
+ if messages.SignTx.get_field(name) is not None:
+ setattr(signtx, name, value)
+ else:
+ raise ValueError(f"Unknown attribute for SignTx: {name}")
if unlock_path:
session.call(Why this scored 20/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.