1a2b67d Test how a very large transaction is handled (Andrew Chow)
c69c0ee Add travis job for cli interface test (Andrew Chow)
e594a0b Allow specifiying a different interface for using HWI in tests (Andrew Chow)
Pull request description:
It was mentioned in the #bitcoin-core-dev IRC channel a few days ago that really big transactions can cause problems if it was entered as an argument in the shell. This PR adds to the test suite the option to run the tests with different interfaces to allow us to test this. It can use the "library" interface which is what we currently do. This interface calls `process_commands` directly. The `cli` interface uses `subprocess` to run the `hwi` command in the shell to test the command line interface. This will emulate entering a command in the shell. This allows us to test the big transaction case which has been added. This case only tests the interface and not whether the transaction is signed. This test should pass when using the `library` interface but not when using the `cli`. Both interfaces will also be tested on travis as separate jobs.
Tree-SHA512: 47c85c3b4df66aaa552dc55028267024ea53a56f8028bc0e161fd390ea3e96166f3d9157f320bbf922c63fd5726f13c3918c75cbd3a1311c1536477c0605dcee
6c9964e Fix Digital Bitbox tests for API changes (Andrew Chow)
Pull request description:
The Digital Bitbox API changed slightly which broke our tests due to the ordering of some operations. Normal usage is still fine. This fixes the test.
Tree-SHA512: bed658d935f6833c7f6e656f35edf5d123edf54a0dfd42383a65a9f178a556d07c84f930bc93e42b3df0b5b79b05e43e12a18042a2401c7040183472bfd6ddb6
6e1e9aa ledger: check keypath format for getxpub (Gregory Sanders)
Pull request description:
Currently does none.
Tree-SHA512: 0219a415db038be0e40b5fda2798a000dce71a33d89265adfdf47f4e3a2c66b8d80238bb74688a68da146461e08f95bd08be6390ffecf13b3e704d1365787326
2d62204 Use descriptors with checksums in TestSignTx (Andrew Chow)
c2ff20b Use descriptor class in getkeypool (Andrew Chow)
f2aff4d Add descriptor checksums and tests (Andrew Chow)
Pull request description:
Adds checksums to the Descriptor class. Checksums are optional, but if provided, must be valid. `getkeypool` is also changed to use the descriptor class to return checksums. Tests are updated so that all descriptors used have checksums.
Closes#129
Tree-SHA512: f77b44a1edbc02d4dc6130fb4f6a97aadf2f12fef90f4b93e734df7374decb060e5486f0a5a03074aa696f6af3c772a52380bbce3ef045042e00597791aacbd1
ff8e257 travis: fix bitcoind update (Andrew Chow)
Pull request description:
Currently travis is not working correctly because it isn't updating bitcoind when upstream changes. This fixes that.
Tree-SHA512: 9354324402d8dcfefbd65ceb79ed9811bc773ddbf266a9072528095c07e8f2b09136b7e607dac779d84996a0a3168907aa31fc45efaf7c2a580987d333f23766
a71658c displayaddress: descriptor support, make --path a named argument (Sjors Provoost)
163f926 Add descriptor class (Sjors Provoost)
6fc1524 HardwareWalletClient: store fingerprint (Sjors Provoost)
Pull request description:
Adds a `Descriptor` class, which currently handles some of the descriptor functionality.
Changes `displayaddress` to allow a descriptor argument. This means `--path` and `--desc` are now named arguments.
When using a descriptor `displayaddress` performs additional checks to make sure the fingerprint and xpub match. To enable the fingerprint check, I'm storing the fingerprint on `HardwareWalletClient` instances.
Tree-SHA512: f149481203c340b8e5347f42fd2924f1b2095197d6c25f39f94acfb11f430881412cce48c510260db4e773b662e8b2a0a747c413ba7fadfc6eb78a85f1ec4838
7c0fd1e Update dependencies in the readme (Andrew Chow)
681a52d Replace btchip-python with our own stripped down version of it (Andrew Chow)
f7d04ff Replace ckcc dependency with our own version of the library itself (Andrew Chow)
f0c5aa7 Add Keepkey to Trezorlib and have KeepkeyClient use TrezorClient (Andrew Chow)
2693ae3 Change TrezorClient to do what TrezorNoInit did (Andrew Chow)
aa3665c Replace trezorlib with our own stripped down version (Andrew Chow)
Pull request description:
This PR replaces all of the device libraries (`trezor`, `keepkey`, `ckcc-protocol,` and `btchip-python`) with stripped down versions of them directly in the source tree. These stripped down versions have several unused functions removed, including support for outdated hardware (e.g. Ledger HW.1) and altcoins. Some additional modifications have been made to them in order to make our implementations cleaner and easier to understand.
One major part of this change is replacing the Keepkey implementation with the Trezor implementation entirely. I found during testing that the Keepkey and Trezor use largely the same protocol. Some parts were different but those did not affect our usage of the Keepkey and the Trezor, so those differences were removed and reconciled. This allows us to have only one library which serves both the Trezor and Keepkey and have just one implementation that works for both Trezor and Keepkey.
Overall, by replacing the vendor provided libraries with our own versions of them, we are able to reduce the total number of dependencies required, and reduce some possible implementation errors (e.g. it would be a simple mistake to let Trezor or Keepkey do their default behavior of phoning home to fetch previous transactions). We can also make changes to the lower level implementations as needed instead of waiting on changes and fixes to be merged into upstream libraries.
This PR is based on #118 so that everything that was changed could be tested.
Tree-SHA512: 2e8e581ebf533a9306d76edfff607d6c5fe85f3764e80015b03638abb15edc76f174b013a64604d3b3e70dacf8b70d00c5a1484702d4fbb7c26625dd18da54dc
3e52a4f Do basic keypath check for display/signmessage for ledger (Gregory Sanders)
Pull request description:
This causes me to pass tests locally.
Tree-SHA512: 604bac8362b565f7ab07bf10e65fb704add9aa6ebf70b09e496bdfd823b3399c417557d1c74a0fe280fe2276b33b3c8c620aba6540a356f6e3df00cccdc29989
a38e993 Tests and fixes for remaining Ledger commands (Andrew Chow)
d627634 Tests and fixes for remainig Keepkey commands. (Andrew Chow)
cf152b7 Tests and fixes for remaining Trezor commands (Andrew Chow)
40abbc2 Tests and fixes for remaining Digital Bitbox commands (Andrew Chow)
0085b8f Tests and fixes remaining commands for Coldcard (Andrew Chow)
5c54c0f Add tests and fixes for invalid paths (Andrew Chow)
a7d0121 Tests for nonexistent fingerprints and device types (Andrew Chow)
cd0c994 Test signtx with all three output types as tx outputs (Andrew Chow)
a1b36e2 Remove several unused functions (Andrew Chow)
Pull request description:
Adds tests for nearly all commands for all devices and related fixes. Only `restore` for `trezor` and `keepkey` are untested as I could not get them to work. All other commands for all devices have tests and related bug fixes.
Tree-SHA512: 2c49e0fce037955f1a10ed24664f7eabae8a7db6803ac3afc296c9a2763ba8f91c5e2bc598847719a1cad82f8afaad352eaf98aa4a3e1aa0475d5f6efab5b9c3
b203585 Handle Ledger error codes (Andrew Chow)
7a8e38c Handle Digital Bitbox errors (Andrew Chow)
d279a7e Handle KeepKey bad arguments (Andrew Chow)
7de7e54 Handle Coldcard canceled actions and bad arguments (Andrew Chow)
4e49da2 Handle Trezor canceled actions and bad arguments to trezorlib (Andrew Chow)
9d52695 Add ActionCanceledError, DeviceConnectionError, DeviceBusyError (Andrew Chow)
0a809b2 Handle errors to have cli output always be JSON (Andrew Chow)
4c3a6df Use HWWErrors instead of built-ins (Andrew Chow)
b4a95a6 subclass specific errors so codes and error messages are easy to get (Andrew Chow)
32e56c7 consolidate errors to errors.py (Andrew Chow)
Pull request description:
This PR adds `except` statements around the main command function to catch any and all exceptions and output the correct error code and message. Additional exceptions and error codes are added for new types of errors. Any exception thrown by a library will be caught and converted into the correct type of exception so that the correct message and code can be returned. This change makes it so that users using the command line tool should never see a backtrace.
This removes from the main `commands.py` file handling of exceptions. Instead those functions (which are intended for use as a library in other software) will throw the exceptions and the caller can handle them.
Tree-SHA512: 88dc0bc576c98e5df09635bf624efcac88a214a09493cd4012333d12c04529999c9ed0c46aac42693b05a2f43ddd7e7b5a157734328ed10ea6bd591a2f28ea6e
Handle HWWErrors generically when the command is invoked in
process_commands. The library functions that used to handle the
errors will instead raise the exceptions.
All exceptions possible are handled, with unknown ones resulting
in an UNKNOWN_ERROR code.