b45607c1cf bitbox02: unlock during enumerate() (Marko Bencun)
070d5eafbf bitbox02: fix enumerate regression (Marko Bencun)
087bc691f2 Add back support for Ledger legacy USB product IDs (TamtamHero)
b8f0901752 Upgrade USB enumeration logic for Ledger products (TamtamHero)
Pull request description:
Backports #403#399#404 to the 1.x branch for a 1.2.1 release.
Top commit has no ACKs.
Tree-SHA512: 98803ebe742b0277762f7ae008dc70bddfcc98c72ff0eedbe265637ae8e117e0585a9a7df617cb03e078fcbf9b3a31a2e12f6827a975d9042994a4f616e52048
Make it consistent with other HW wallets. Nunchuk relies on having an
unlocked device after enumerate() finishes.
Github-Pull: #404
Rebased-From: e1cc1937179a7fdb8e9807a0ef9e6f9b8ece8df0
6a6c46f6834b4dac5e67d0c92a9ef791619e9dce checks that a password must
exist instead of that a password must not exist.
That commit does not describe the reason for the change. Password
cannot be None anyway, as the type of password is `str`, not `Optional[str]`.
Github-Pull: #399
Rebased-From: b8cf8578836cf92918c619f6f763c69697926810
2f56cd3839 ignored .vscode folder (fametrano)
Pull request description:
This is to ignore the folder where Visual Studio Code save its own stuff
ACKs for top commit:
instagibbs:
ACK 2f56cd3839
achow101:
ACK 2f56cd3839
Tree-SHA512: 1f8e22febe5cc3ab5d6a5937b0df51c56569335cc0382ef463539784fd6d12db699b3449c2f332850080e6880ad718828ea43d9f05578ca494d46b89b17c3e6c
0683dc246a Fix README features table rendering (benk10)
Pull request description:
The HWW features table seems to have been broken with #363 due to a small issue (needed to add another `:---:|` at the table separator list), so just a small PR to fix that (and remove duplicated spaces).
ACKs for top commit:
achow101:
ACK 0683dc246a
instagibbs:
utACK 0683dc246a
Tree-SHA512: 36a7b9e039d397bb2a48ac34841727f4c2bfe67aaaabd5fd651f3b058eb52a50a2a395f404e86ae8ab31042d89e5ceb3bb0f3b9ceb16d13e147995262ba38bf3
b24f2aaa2d hwilib/gui: make sure the bb02 pairing window is painted (Marko Bencun)
5010844a27 hwwclient: fix send_pin signature (Marko Bencun)
6169788aa7 bitbox02: consistent errs when the device is (not) initialized (Marko Bencun)
d255229639 commands/find_device: only get the device fingerprint if required (Marko Bencun)
4df060d0c6 bitbox02: use local copy of parse_path (Marko Bencun)
ed1125115f typecheck bitbox02.py (Marko Bencun)
4e4455d2b2 add BitBox02 support (Marko Bencun)
1d0bbb6281 add bitbox02 dependency (Marko Bencun)
Pull request description:
This adds cli and gui support for the BitBox02. For now, only single sig support is added, with the plan to add multisig support soon after this is merged.
This PR has had an internal review over here before: https://github.com/benma/hwi/pull/1, and I tested it quite extensively.
ACKs for top commit:
achow101:
ACK b24f2aaa2d
instagibbs:
utACK b24f2aaa2d
Tree-SHA512: 0dd7c48f0381c4f72c0ea033dd9e64212f6c44c4c9c2711441500d7816b7327379dfb314494bbf8301a87f05601c1ed78a4c1d4397fa2d309ccb613faa847946
Sometimes, one processEvents() was not enough to have Qt5 finish
painting the window before proceeding onto the blocking call to show
the pairing code on the bitbox02 screen.
This is an attempt at making this more robust.
If the fingerprint is not specified on the CLI, the fingerprint does
not need to be queried from the device.
This is helpful for uninitialized devices, to invoke the 'setup' or
'restore' commands, at which point the device does not have a keystore
and fingerprint yet.
Since trezorlib is imported also by bitbox02, it would be type-checked
by mypy. Since it contains no types, it is easiest to ignore trezorlib
in mypy.
--implicit-reexport is disabled by --strict, but that is a bit too
strict. The bitbox02 package relies on implicit reexports.
44dabcfa80 Avoided bare expect (Ferdinando Ametrano)
Pull request description:
Using a bare `except:` is not a good coding practice: it catches all exceptions inheriting from `BaseException`, including `SystemExit`, `KeyboardInterrupt`, and `GeneratorExit` (which is not an error and should not normally be caught by user code).
```
BaseException
- Exception
- GeneratorExit
- KeyboardInterrupt
- SystemExit
```
This patch is sub-optimal because only specific exceptions should be catched... anyway, in situations where one wants to catch all “normal” exceptions, at least restrict to explicitly catch the `Exception` base class, instead of implicitly catching any `BaseException`.
ACKs for top commit:
achow101:
ACK 44dabcfa80
Tree-SHA512: 220dc4be1c47958e3727205d9cbb03069a49108ce697983c1967cf04f980cf3f607399e9a2c9e511d270f13154aa85a1cf9c92cfd0681f7ba56622134f663dd1
2c381fa2dc tests: Add trezor t back to mixed and external signing tests (Andrew Chow)
2ea932ed78 tests: Use m/48' for multisig tests (Andrew Chow)
4791841d63 tests: Use descriptor wallets (Andrew Chow)
c5a64885bc tests: Refactor multisig signtx to be able to use a separate path (Andrew Chow)
f0cef6ea39 tests: Combine multisig displayaddress path and descriptor tests (Andrew Chow)
10f094a0b0 tests: move xpub multisig displayaddress to separate test case (Andrew Chow)
84eacd63e1 tests: Properly skip multisig displayaddress for unsupported devices (Andrew Chow)
c6038cbbd9 tests: Use a unique wallet name for each test case (Andrew Chow)
e8316657a5 test: Remove wallet setup from displayaddress tests (Andrew Chow)
b9931556b1 tests: Refactor multisig setup in multisig displayaddress (Andrew Chow)
66182f0ca7 tests: Refactor wallet creation to parent class function (Andrew Chow)
4498c3f347 tests: Use parent class setUp and don't re-set self.rpc (Andrew Chow)
79f74a78fc tests: refactor --testnet in self.dev_args to __init__ (Andrew Chow)
Pull request description:
* Refactor and cleanup wallet, RPC, and `--testnet` argument setup
* A new wallet is made for each individual test case for now. Funds still provided by the default wallet.
* Multisig setups are refactored and updated to not use the wallet
* Common functionality is refactored into a separate function to deduplicate a bunch of code.
* The setup itself is simplified to not require the use of the wallet.
* The multisig descriptor with xpub test added in #353 is moved to its own function
* The multisig `displayaddress` tests for descriptor and paths have been combined as they are basically the same
* The wallet we import stuff into is now a descriptor wallet and we use `importdescriptors` now. This is necessary to fix the Trezor 1 test failure.
* Change multisigs to use the `m/48'` path that is supposedly a standard but not really documented anywhere. This is necessary to fix the Trezor 1 test failure.
ACKs for top commit:
instagibbs:
reACK 2c381fa2dc
Tree-SHA512: 035c369fba908ba2836ad6af9e5d50b15d89ea23210be6d97a9bf5dd47d7f21a581ab6f2a59d9eb46d3732ac568c07b77e35962b48daf1bc26925edf7b9f9e49
Apparently m/48' (where 48 is the purpose number in a BIP 44 path) is
the standard path for use with multisigs. This is mistakenly called BIP
48 in many places, but no such BIP 48 actually exists. Anyways, Trezor
requires multisigs use m/48' for multisigs, so we need to use them in
our tests.
We are really targeting descriptor wallets, so we should be testing
those.
Because descriptor wallets also change how the imports will work w.r.t
rescans and the next address to give out, the getkeypool path checks are
changed to just check that the begin with the correct path prefix.
self.rpc is already setup when the test starts, no need to set it again.
Additionally, use the parent class setUp so we aren't duplicating as
much code.
5e296ca4dc Cleaned up log messages (Ferdinando M. Ametrano)
Pull request description:
In my team, we comment out that line to avoid Trezor writing to our LOG.info
As they say "your mileage may vary", but a final user's LOG.info should not be polluted by third party library.
ACKs for top commit:
achow101:
ACK 5e296ca4dc
Tree-SHA512: bfde661893c2cd966f8656964b782d16a8190008c4a74d8c3bc2a4491cd5248062f8ed0e5ea022d440cb1f2674b1724011858c6431c67f643fae21ec22cd7922
7a896e792b added gitignore directives for virtual environments (Ferdinando M. Ametrano)
Pull request description:
virtual environments are routinely created in the root project (sub)folder(s) and should be ignored by Git
ACKs for top commit:
achow101:
ACK 7a896e792b
Tree-SHA512: fd5ae7cc430871a96d4db8336dad9f2206005fa9b05911445bc72363603b13fee97ef55c5fe3a65520d3a9203814014e71511b20d2c4cbd8eeff7fde85d14ca5
287bce9894 added py.typed so that static type checkers use package stubs (PEP 561) (Ferdinando Ametrano)
Pull request description:
- Problem: mypy can't find type hints when importing from hwi
- Solution: add a py.typed file to make hwi PEP-561-compatible
At the moment hwi has type hints, but they are useless to packages importing from hwi because there is no py.typed file to tell mypy they're there.
PEP 561 specifies that packages which contain either inline type hints or type stubs should indicate their support for type hints via including a blank file named py.typed in the root of the package. Package maintainers who wish to support type checking of their code MUST add it to their package supporting typing.
ACKs for top commit:
achow101:
ACK 287bce9894
Tree-SHA512: 536c3022a0ab71673c542eaf238f231e812dd8beda92269e61647ec8e22762de720f89a83c9711e648d687fc67bf8fcee627db80ade8f4b0829ea6bbba081f98
78a8801f94 Support multisig xpub descriptors (benk10)
Pull request description:
Trezor Model T has an option when displaying a multisig address to also show all xpubs used as cosigners of the multisig. Currently, the display address function did not support using xpubs, so here I added support in Trezor for such descriptors, which will make xpubs show up correctly.
ACKs for top commit:
achow101:
ACK 78a8801f94
Tree-SHA512: 707e56b3cbac5f21ccdaeba912e751f23fe5fff637c18366cbe76b618840d4ba38fd2442919e2ff61f770c8381e59a6147d385a44d2def5dad07d89a09730eed