Commit Graph

76 Commits

Author SHA1 Message Date
Andrew Chow
18857d9cd0 Add interactive option and move setup and restore to interactive only 2019-03-14 16:39:12 -04:00
Andrew Chow
0dd2e86394
Merge #126: Add option to enter commands over stdin
49bc7fa Add tests for stdin interface and travis job (Andrew Chow)
0185391 Add --stdin to enter commands and arguments over stdin (Andrew Chow)

Pull request description:

  This PR adds a `--stdin` option which allows arguments to be entered over stdin in a way similar to bitcoin-cli's `--stdin` option.

  Built on #125 and to test the `stdin` interface

Tree-SHA512: 48e04298b3537ac59523e40fab3e1709d2ec4ca50284b0bcbbe9062f284bcfbf0cbc4492bd5b8fa673be35375fe8d9436d4aaec0a304b574ba411ee0fb284c0d
2019-03-14 15:00:24 -04:00
Andrew Chow
49bc7fa5da Add tests for stdin interface and travis job 2019-03-11 10:23:45 -04:00
Andrew Chow
376245ae0f Update tests documentation with new tests 2019-03-09 01:17:05 -05:00
Andrew Chow
8931ae0e90 Run tests using the binary distribution 2019-03-08 00:42:43 -05:00
Andrew Chow
8d738ee31c
Merge #125: Test how the CLI deals with really big transactions
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
2019-02-28 21:47:56 -05:00
Andrew Chow
6c9964ef84 Fix Digital Bitbox tests for API changes
The Digital Bitbox API changed slightly which broke our tests due to
the ordering of some operations. Normal usage is still fine.
2019-02-25 16:03:50 -05:00
Andrew Chow
1a2b67d1f3 Test how a very large transaction is handled 2019-02-19 10:21:58 -05:00
Andrew Chow
e594a0b4b3 Allow specifiying a different interface for using HWI in tests 2019-02-19 10:21:58 -05:00
Andrew Chow
75a915edba
Merge #130: Implement descriptor checksums
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
2019-02-19 10:19:51 -05:00
Andrew Chow
ff8e257839 travis: fix bitcoind update 2019-02-18 17:17:01 -05:00
Andrew Chow
2d622046ce Use descriptors with checksums in TestSignTx 2019-02-17 18:11:18 -05:00
Andrew Chow
f2aff4d642 Add descriptor checksums and tests 2019-02-17 17:41:45 -05:00
Andrew Chow
dba7acd5ed
Merge #127: Update things now that Bitcoin Core master is usable
aac8243 Update Bitcoin Core usage docs (Andrew Chow)
daa99c7 Change to building from bitcoin master (Andrew Chow)

Pull request description:

  Updates `setup_environment.sh` to build Bitcoin Core master branch instead of my hww branch.

  Updates the Bitcoin Core usage documentation.

Tree-SHA512: f7a9f2c6cb10f67cfc8b4a8a757d37e2ef8c37e26d5297215e6c8612780496b476d41c614106286813141b1278173094149df2b34a02fc64a71aec844fb081dc
2019-02-15 15:06:01 -05:00
Sjors Provoost
a71658cf6d
displayaddress: descriptor support, make --path a named argument 2019-02-15 08:44:41 +01:00
Andrew Chow
daa99c7ea3 Change to building from bitcoin master 2019-02-15 00:36:04 -05:00
Sjors Provoost
163f926d52
Add descriptor class 2019-02-14 09:35:17 +01:00
Andrew Chow
f7d04ff2eb Replace ckcc dependency with our own version of the library itself 2019-02-12 17:26:27 -05:00
Andrew Chow
f0c5aa7d3c Add Keepkey to Trezorlib and have KeepkeyClient use TrezorClient 2019-02-12 17:26:27 -05:00
Andrew Chow
2693ae34f6 Change TrezorClient to do what TrezorNoInit did 2019-02-12 17:26:27 -05:00
Andrew Chow
aa3665c971 Replace trezorlib with our own stripped down version 2019-02-12 17:26:27 -05:00
Andrew Chow
a38e993607 Tests and fixes for remaining Ledger commands
Tests and fixes for promptpin, sendpin, setup, wipe, restore, backup,
and signmessage commands
2019-02-10 10:45:29 -05:00
Andrew Chow
d627634ce6 Tests and fixes for remainig Keepkey commands.
Tests for setup, wipe, restore, backup, promptpin, sendpin
2019-02-10 10:45:29 -05:00
Andrew Chow
cf152b709a Tests and fixes for remaining Trezor commands
Tests and fixes for Trezor signmessage, setup, wipe, backup, promptpin, and sendpin
2019-02-10 10:45:29 -05:00
Andrew Chow
40abbc2927 Tests and fixes for remaining Digital Bitbox commands
Adds tests for setup, wipe, backup, restore, displayaddress,
promptpin, and sendpin.
2019-02-10 10:45:29 -05:00
Andrew Chow
0085b8fd2c Tests and fixes remaining commands for Coldcard
Tests and fixes for promptpin, sendpin, and restore and backup commands on Coldcard
2019-02-10 10:45:29 -05:00
Andrew Chow
5c54c0f6ee Add tests and fixes for invalid paths 2019-02-10 10:45:29 -05:00
Andrew Chow
a7d0121c7b Tests for nonexistent fingerprints and device types 2019-02-10 10:45:29 -05:00
Andrew Chow
cd0c994d6d Test signtx with all three output types as tx outputs 2019-02-10 10:45:29 -05:00
Andrew Chow
4c3a6df1b7 Use HWWErrors instead of built-ins 2019-02-04 10:04:30 -05:00
Andrew Chow
5ea8831d55 Document Keepkey emulator build instructions 2019-01-24 20:52:09 -05:00
Andrew Chow
af52908206 Use Digital Bitbox's repo for simulator 2019-01-24 20:47:28 -05:00
Andrew Chow
2ddd4ed41a Refactor to make hwilib more like a library
Moves the command argument parsing to hwi.py. Instead of each function
taking args and client, they now take client and whatever else they
need. hwi.py handles the conversion from args and client to the actual
arguments.
2019-01-19 16:58:31 -05:00
Andrew Chow
0b870d8673 Document how to build the simulator 2019-01-14 17:31:16 -05:00
Andrew Chow
8f1dff2f04 Change Digital Bitbox test to use simulator 2019-01-14 17:31:16 -05:00
Andrew Chow
07c97716e7 Build digital bitbox simulator in setup_environment.sh 2019-01-14 17:31:16 -05:00
Andrew Chow
b404a5050d Include the device type in test case output 2019-01-14 15:42:27 -05:00
Andrew Chow
a0fa20888a Show full test case names in output 2019-01-14 15:00:41 -05:00
Andrew Chow
8ddf434489 Refactor tests to optionally have emulator start and stop for each test
The trezor and keepkey emulators use the same port so they cannot
be run at the same time. To work around this, the emulators are
instead started and stopped before and after each test using
unittest's setUp and tearDown functions. However, other devices
which do not have conflicts can still be run at test suite creation
time. This is still done for the coldcard.

Furthermore, since the trezor and keepkey both create and use
emulator.img files in the current working directory, when they are
started, the working directory is changed to be the one containing
the emulator executable to avoid conflicting emulator.img files
2019-01-12 21:45:42 -05:00
Andrew Chow
a3f31aae60 Add keepkey automated test 2019-01-12 21:45:42 -05:00
Andrew Chow
8d53b7da64 Build keepkey emulator in setup_environment 2019-01-12 21:45:42 -05:00
Andrew Chow
3578ecaee5
Merge #96: Bitbox test
41d3fae Digital Bitbox manual tests (Andrew Chow)
a834e13 Allow providing device passwords for manual tests (Andrew Chow)

Pull request description:

  Like the ledger test, but for bitbox.

  Also lets you specify the password for the device. This is currently only used for the bitbox.

Tree-SHA512: 04ee87cc9b176d151c1d0367c6dca6d03b9fc1087837185180cc9ba89f97b059ef29571d6c32fa2a445ca7ab1d738c1fc7f19c76aa421c97532fcb18c757b335
2019-01-11 14:12:55 -05:00
Andrew Chow
c54bc33381 Ensure that a bogus signature will always be created for ignored inputs
Fixes the issue where multisig inputs not belonging to the trezor
would cause an error. Also re-enables that test for the trezor
2019-01-11 13:44:43 -05:00
Gregory Sanders
0d6ad3a996 Test signtx with unknown inputs by wiping master fingerprint and processing 2019-01-10 22:13:48 -05:00
Andrew Chow
41d3faedfd Digital Bitbox manual tests 2019-01-09 13:09:06 -05:00
Andrew Chow
a834e13e18 Allow providing device passwords for manual tests 2019-01-09 13:06:40 -05:00
Andrew Chow
d8d74ac2dc Enable multisig tests for Trezor 2019-01-09 12:47:57 -05:00
Gregory Sanders
68a4935c88 multisig test
When device is marked as multi-sig enabled
create and spend 3 standard multisig types:

sh(wsh(multi()), sh(multi()), wsh(multi())
2019-01-09 11:15:22 -05:00
Gregory Sanders
dd5533f286 Adapt signing test to support devices that can't do mixed input signing 2019-01-08 14:19:37 -05:00
Gregory Sanders
08f1a94752 Add basic physical Ledger test with ./run_tests.py --ledger option. 2019-01-08 14:19:37 -05:00