Commit Graph

1166 Commits

Author SHA1 Message Date
PrisionMike
870f0db189 feat(tron): Adding FreezeBalanceV2 contract logic
- Main logic for Staking Tron for energy or bandwidth.
- Scaffolding in preceding commit.

[no changelog]
2026-02-17 22:54:19 +05:30
PrisionMike
1189138408 feat(tron): adding FreezeBalanceV2 message support
- Updated message definitions. Introduced new strings.
- Mostly generated code. Main changes in subsequent commit.

[no changelog]
2026-02-17 22:54:19 +05:30
matejcik
67013755e8 chore(python): bump version after release 2026-02-11 13:50:15 +01:00
matejcik
45ff241919 docs(python): generate changelog for 0.20.0 2026-02-11 13:50:15 +01:00
Andrew Kozlik
3e0a170eab feat(python): add root production key for T3B1 2026-02-11 13:50:15 +01:00
Andrew Kozlik
7dec396c2d feat(python): Ensure that Trezor provides Tropic signature when expected. 2026-02-11 13:50:15 +01:00
matejcik
e397ee5fcb fix(python): improve handling for CA blacklists/whitelists
* handle inability to download the allowlist
* prepare for blacklist that will be used for T3W1
2026-02-11 13:50:15 +01:00
matejcik
d7fce2ab15 docs(python): fix typo 2026-02-11 13:50:15 +01:00
matejcik
47c900be8d fix(python): fix BLE behavior on macos
* macOS does not have `client.pair()`, as documented in bleak docs. This
way we just ignore the NotImplementedError and everything Just Works(tm)
* installing firmware will fail on macos unless response=True. we don't
want to limit other OSes for that so we configure that with a top level
constant
2026-02-11 13:50:15 +01:00
matejcik
977402ec0e refactor(python): improve authenticity check
moving complexity around to a better siloed location, as a preparation
for adding new kinds of (PQ) cryptography
2026-02-11 13:50:15 +01:00
Roman Zeyde
c6564b0110 fix(core): include telemetry-related source in emulator builds
[no changelog]
2026-02-10 10:07:07 +01:00
Roman Zeyde
34d382d46f chore(python): update click dependency versions
[no changelog]
2026-02-09 11:07:57 +01:00
Roman Zeyde
0edb43ec3e fix(python): restore TrezorClient.cancel() behaviour
It should only send `messages.Cancel()`, so the main flow will receive the `ActionCancelled` failure.

[no changelog]
2026-02-09 11:07:33 +01:00
Roman Zeyde
8cb7675d37 fix(python): fix trezorctl get-session for legacy
`TrezorConnection._version` wasn't set, so the command was failing with:
```
Traceback (most recent call last):
  File "./venv/bin/trezorctl", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "./venv/lib/python3.12/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "./venv/lib/python3.12/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/rzeyde/src/trezor-firmware/python/src/trezorlib/cli/trezorctl.py", line 161, in invoke
    return super().invoke(ctx)
           ^^^^^^^^^^^^^^^^^^^
  File "./venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "./venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "./venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "./venv/lib/python3.12/site-packages/click/decorators.py", line 45, in new_func
    return f(get_current_context().obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rzeyde/src/trezor-firmware/python/src/trezorlib/cli/trezorctl.py", line 361, in get_session
    if obj.features.model == "1" and obj.version < (1, 9, 0):
                                     ^^^^^^^^^^^
  File "/home/rzeyde/src/trezor-firmware/python/src/trezorlib/cli/__init__.py", line 280, in version
    if self._version is None:
       ^^^^^^^^^^^^^
AttributeError: 'TrezorConnection' object has no attribute '_version'. Did you mean: 'version'?
```

[no changelog]
2026-02-09 11:07:16 +01:00
Roman Zeyde
103146f39f feat(common): introduce Failure_InProgress code
It will be used to indicate that an non-interruptible workflow is
currently running on the device.

[no changelog]
2026-02-04 17:21:24 +01:00
Roman Zeyde
fee2f28330 chore(common): remove unused Failure_BufferError code
[no changelog]
2026-02-04 17:21:24 +01:00
Roman Zeyde
ef48ecc940 docs(python): add changelog entries 2026-02-03 14:47:31 +01:00
Roman Zeyde
d3908fa6aa fix(python): avoid reseeding in HW tests
[no changelog]
2026-02-03 14:47:31 +01:00
Roman Zeyde
975a2ac70e refactor(core): unify emulator detection
[no changelog]
2026-02-03 14:47:31 +01:00
Roman Zeyde
956d74d163 refactor(python): inline ThpErrorCode.to_exception()
[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
983d7afe94 chore(python/debuglink): remove vestigial memory_write/read/erase methods
unsupported on core models, not used by anyone on legacy for years
2026-02-03 14:47:31 +01:00
matejcik
e3ca6ebe6a fix(python/trezorctl): avoid using atexit for closing of transport
Otherwise we conflict with atexit registered in webusb transport and may
cause a segfault in libusb.

What we practically want is to close the obj "after a command", not "at
exit", so we hook into Click's invoke()

[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
603a216072 refactor(python): better management of open-depth for transport
this way a high-level "reopen" functionality is exposed to callers that
want to cycle the connection, without needing to fragilly mess with open
count

[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
6a86927f77 refactor(python/trezorctl): improve session management
the session id string now includes device path as well, so setting
TREZOR_SESSION_ID is always sufficient when multiple Trezors are
connected.

THP sessions can now be restored (fixes #5855)
2026-02-03 14:47:31 +01:00
matejcik
4324f4e9cc refactor(python): do not request credential in get_default_client
Currently there is no good way of passing back the credential that was
requested, so it is lost anyway.

[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
d4945e139d refactor(python): improve credential management in trezorctl
* expose Trezor masked key set after handshake phase
* change "username" of keyring passwords to be a random identifier,
  store unmasked Trezor key as another password
* allow credential lookup by id, unmasked Trezor public key, or
  the masked key set
* expose functionality to trezorctl for forgetting current key or
  all remembered keys

[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
c5a30ba1bb feat(python): do not skip pairing if credential is requested
because SkipPairing takes us straight to FINISHED phase, where
CredentialRequest doesn't work without a pre-existing credential

this implies that trezorctl won't skip pairing anymore, even if the skip
method is available

[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
5e261d5efe fix(python): allow THP session id 255
[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
776355e003 refactor(python): streamline record_screen functionality
The function as written didn't really belong into debuglink, so it was
moved to trezorctl, and emu.py can import it from there. Also improved
type annotations, simplified implementation, and made sure that
recording is properly stopped even on an error.

[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
8ebd829152 fix(python): improve session handling and unlocking
* for trezorctl, implement custom version of `ensure_unlocked()` on
  TrezorConnection, so that we can reuse the standard session which
  unlocked the device
* move some of the passphrase handling into TrezorConnection in order
  to avoid get_default_session, which has to call its own
  ensure_unlocked()
* clean up features handling in client.get_session(), to properly handle
  the case that features are locked

[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
debe4b6c59 fix(python): allow client.ensure_unlocked() to proceed on an uninitialized device
[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
6401bacd72 fix(python): do not warn about session id when in bootloader mode
[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
26186e484e fix(python/thp): correctly handle maximum allowable THP message size
[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
0d5d6b9d88 chore(python): invalidate session even if EndSession call fails
[no changelog]
2026-02-03 14:47:31 +01:00
Roman Zeyde
76b2775539 fix(python): support older releases without Features.capabilities
Otherwise, `test_cardano_address_does_not_change_by_upgrade` fail on older releases.

[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
6e3018509b refactor(python): rework session-based API
Co-authored-by: M1nd3r <petrsedlacek.km@seznam.cz>
Co-authored-by: Roman Zeyde <roman.zeyde@satoshilabs.com>

[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
61783a059d refactor(python): move protocols out of transport
[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
c474c03e42 chore(python): bump version to 0.20
to indicate a big API break

[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
fe10e429cd style(python): improve type annotations at trezorlib.transport
[no changelog]
2026-02-03 14:47:31 +01:00
matejcik
1a2c9bf438 refactor(python): better handling of TREZOR_BLE flag
[no changelog]
2026-02-03 14:47:31 +01:00
Ioan Bizău
9bcf69ecc7 fix(tests): visit menus on all pages
[no changelog]
2026-01-28 16:03:25 +02:00
Martin Pastyřík
379484d6ec fix(core): remove host static public key from protobuf message
[no changelog]
2026-01-27 14:54:38 +01:00
kopecdav
19ff65bf89 feat(python): Update trezorctl telemetry command with battery_cycle field.
[no changelog]
2026-01-23 12:54:34 +01:00
tychovrahe
239605c3f9 fix(python): send DebugLinkOptigaSetSecMax via debuglink
[no changelog]
2026-01-23 12:00:45 +01:00
tychovrahe
04ec4b251e feat(python): add command for reading out telemetry data
[no changelog]
2026-01-19 12:58:56 +01:00
tychovrahe
1143f5e0ed chore(core): add messages for reading out telemetry data
[no changelog]
2026-01-19 12:58:56 +01:00
Roman Zeyde
9e1f7077eb chore(python): re-introduce sleep when starting Tropic emulator
It seems that even if the model is listening for connections it sometimes needs up to 2 seconds more before it actually correctly processes requests.

See #6128.

[no changelog]
2026-01-19 12:36:01 +01:00
Ioan Bizău
ac2fea3310 feat(tests): return selected menu item
[no changelog]
2026-01-14 09:56:42 +02:00
Ioan Bizău
6c55926bb0 feat(tests): get Bolt FIDO account name
[no changelog]
2026-01-14 09:56:42 +02:00
tychovrahe
e2bfa90870 feat(core): introduce secmon downgrade protection 2026-01-13 09:30:29 +01:00