Skip to content

Commit 9fbe6be

Browse files
committed
Merge #735: test/test_device: do not enforce a password
7fef64e test/test_device: do not enforce a password (Marko Bencun) Pull request description: According to the type in `HardwareWalletClient`, password is optional and can be `None`: ``` def __init__(self, path: str, password: Optional[str], expert: bool, chain: Chain = Chain.MAIN) -> None: ``` The test code also expects that it can be `None`, e.g.: https://github.com/bitcoin-core/HWI/blob/d774d65255e1e78ea4d97846c2b4d26a23febcfb/test/test_device.py#L140 The BitBox02 client in fact checks that it must be `None` and raises a `BadArgumentError` otherwise, as the BitBox02 does not accept any password/passphrase from the host: https://github.com/bitcoin-core/HWI/blob/d774d65255e1e78ea4d97846c2b4d26a23febcfb/hwilib/devices/bitbox02.py#L266 Other devices like the Jade also don't take a host password/passphrase, and simply ignore the param. We could also do this for the BitBox02 (not raise any error if a password is supplied), but the right solution is to not enforce a password in the tests. This commit is in preparation of adding a BitBox02 simulator with tests. ACKs for top commit: achow101: ACK 7fef64e Tree-SHA512: 6a32fa347706c6bc4f74a534a77369d8e85a7cdb75042155d04d7c18647278e78ad2c2bf1cfd4936529dbd6aea6aa236001acedefe608cdf39cbae90a08c8068
2 parents 1a129af + 7fef64e commit 9fbe6be

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/test_device.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def start(self):
4141
assert self.path is not None
4242
assert self.fingerprint is not None
4343
assert self.master_xpub is not None
44-
assert self.password is not None
44+
# No need to check that self.password is not None, as it can be None if the device does not
45+
# accept a password/passphrase from the host.
4546
assert self.supports_ms_display is not None
4647
assert self.supports_xpub_ms_display is not None
4748
assert self.supports_unsorted_ms is not None

0 commit comments

Comments
 (0)