1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-30 03:18:20 +00:00
Commit Graph

267 Commits

Author SHA1 Message Date
Andrew Kozlik
1e89f7923d tests: Don't lock storage after setup if the mnemonic needs to be checked. 2019-02-14 21:07:30 +01:00
Andrew Kozlik
9a1e14d974 tests: Check PIN properly in test_msg_changepin. 2019-02-14 19:16:43 +01:00
Pavol Rusnak
d5c2636f0d
style: reformat decred test 2019-02-04 01:29:08 +01:00
Pavol Rusnak
333af87ce2
tests: use simplified API for MultisigRedeemScriptType where possible
This is possible when address_n is the same for all involved nodes
2019-02-04 01:14:14 +01:00
Pavol Rusnak
50b302dfec
format: black uppercase of hex constant 2019-01-31 21:22:51 +01:00
Pavol Rusnak
1f7a405cb2
tests: pass branch_id in zcash tests 2019-01-31 21:08:43 +01:00
matejcik
68da6881b5 debuglink: add null debuglink, allow running tests interactively
run with:
INTERACT=1 pytest <your options here>
2019-01-31 15:30:05 +01:00
Tomas Susanka
f81bc61316 ethereum: update tests to new message format (addresses are strings) 2019-01-29 17:17:05 +01:00
Tomas Susanka
015664cc9d
Merge pull request #342 from vacuumlabs/cardano-generalize-network
Change network to protocol magic in cardano
2019-01-29 16:47:34 +01:00
matejcik
5355ce4879 device_tests: upgrade get_marker to get_closest_marker
This bumps pytest requirement to 3.6. But we have that everywhere already.
For bonus points, get_closest_marker still exists in 4.1.
2019-01-28 17:11:37 +01:00
refi93
66111121bb
add tests for cardano address validation 2019-01-25 16:59:44 +01:00
matejcik
37dfcf90bf device_tests: clarify input_flow for cardano signing 2019-01-25 16:22:18 +01:00
refi93
f4e1da41b7 change network to protocol magic in cardano 2019-01-21 10:23:55 +01:00
Tomas Susanka
d09f4470d2 tests/stellar: use bytes.fromhex instead of binascii.unhexlify 2019-01-17 14:31:07 +01:00
Tomas Susanka
6c659715dc tests: style 2019-01-17 14:26:15 +01:00
Tomas Susanka
e732ee6a75 tests/stellar: add more tests for SetOptionsOp 2019-01-17 14:18:02 +01:00
matejcik
921d881cdf Revert "device_tests: xfail EthereumGetPublicKey on TT (feature is postponed)"
This reverts commit 953e0d1d8c.
2019-01-15 14:50:03 +01:00
matejcik
953e0d1d8c device_tests: xfail EthereumGetPublicKey on TT (feature is postponed) 2019-01-15 14:03:32 +01:00
Tomas Susanka
7288700b86 eth: add get public key 2019-01-15 12:46:20 +01:00
Tomas Susanka
701b603419 tests: uncomment ripple test
Some ripple tests stayed commented out accidentally. Shame on me.
2019-01-09 15:00:44 +01:00
Alexander Block
d131b70bed Dash: Support spending DIP2 special transaction inputs (#351)
This implements support for spending of TX outputs which are part of a [DIP2](https://github.com/dashpay/dips/blob/master/dip-0002.md) special transaction, especially [DIP4 coinbases](https://github.com/dashpay/dips/blob/master/dip-0004.md#coinbase-special-transaction).

This is for Dash only and thus required the addition of `is_dash` in `tx_api.py`.

Support on the firmware side is not required for this to work as it reuses the logic from Zcash's `extra_data` and `extra_data_len` fields.
2019-01-09 14:43:30 +01:00
Tomas Susanka
897bc14a36 tests: add ripple test case with destination tag 2019-01-08 16:38:45 +01:00
strmci
402e72e36e device_tests: add input flow function to Ontology tests (#348) 2019-01-07 12:58:42 +01:00
Pavol Rusnak
831fde9c5c
tests: T1 now caches the PIN after PIN set/change 2018-12-14 15:17:41 +01:00
Jan Pochyla
0390c1da0a tests: use valid paths in various altcoin tests 2018-12-13 15:49:31 +01:00
strmci
b0a227866a device_tests: add input flow function to NEM signing test 2018-12-06 17:41:24 +01:00
matejcik
db1a5adee7 device_tests: style 2018-11-26 17:02:00 +01:00
Tomas Susanka
0d01298f71 tests/eth: add invalid signature test for verify 2018-11-26 16:30:34 +01:00
matejcik
11e56a7e1b client: clean up constants 2018-11-26 15:30:42 +01:00
Tomas Susanka
786bccfa34 tests/lisk: all all all seed 2018-11-21 17:08:18 +01:00
Tomas Susanka
29d3a21d84 tests/eth: all all all seed 2018-11-21 17:08:18 +01:00
Tomas Susanka
f5af12c043 paths: compatibility for derivation paths checks 2018-11-21 17:08:18 +01:00
Pavol Rusnak
da3223d703
tests: change flags for test_msg_signtx_capricoin.py 2018-11-14 17:36:19 +01:00
strmci
252f946f40 Add a test case for segwit inputs/outputs with very high amounts (#337)
Add a test case for segwit inputs/outputs with very high amount, fixes #332
2018-11-12 16:27:56 +01:00
matejcik
ed473e2e42 trezorlib: add licence headers where missing 2018-11-12 12:22:32 +01:00
matejcik
85b85c67b3 trezorlib: reentrant session handling
This fixes the breakage introduced by transport reshuffles.
It's still not great and I'd love to see context manager based sessions.
But it's good enough for now.
2018-11-12 12:22:32 +01:00
matejcik
aac7726824 trezorlib: transport/protocol reshuffle
This commit breaks session handling (which matters with Bridge) and
regresses Bridge to an older code state. Both of these issues will be
rectified in subsequent commits.

Explanation of this big API reshuffle follows:

* protocols are moved to trezorlib.transport, and to a single common file.
* there is a cleaner definition of Transport and Protocol API (see below)
* fully valid mypy type hinting
* session handle counters and open handle counters mostly went away. Transports
  and Protocols are meant to be "raw" APIs; TrezorClient will implement
  context-handler-based sessions, session tracking, etc.

I'm calling this a "reshuffle" because it involved very small number of
code changes. Most of it is moving things around where they sit better.

The API changes are as follows.

Transport is now a thing that can:
* open and close sessions
* read and write protobuf messages
* enumerate and find devices

Some transports (all except bridge) are technically bytes-based and need
a separate protocol implementation (because we have two existing protocols,
although only the first one is actually used). Hence a protocol superclass.

Protocol is a thing that *also* can:
* open and close sessions
* read and write protobuf messages
For that, it requires a `handle`.

Handle is a physical layer for a protocol. It can:
* open and close some sort of device connection
  (this is distinct from session! Connection is a channel over which you can
  send data. Session is a logical arrangement on top of that; you can have
  multiple sessions on a single connection.)
* read and write 64-byte chunks of data

With that, we introduce ProtocolBasedTransport, which simply delegates
the appropriate Transport functionality to respective Protocol methods.

hid and webusb transports are ProtocolBasedTransport-s that provide separate
device handles. HidHandle and WebUsbHandle existed before, but the distinction
of functionality between a Transport and its Handle was unclear. Some methods
were moved and now the handles implement the Handle API, while the transports
provide the enumeration parts of the Transport API, as well as glue between
the respective Protocols and Handles.

udp transport is also a ProtocolBasedTransport, but it acts as its own handle.
(That might be changed. For now, I went with the pre-existing structure.)

In addition, session_begin/end is renamed to begin/end_session to keep
consistent verb_noun naming.
2018-11-12 12:22:26 +01:00
matejcik
ca345e9766 cardano: clean up test case 2018-11-06 13:38:13 +01:00
matejcik
81c55c1c5f device_tests: fix remaining use of btc.sign_tx 2018-11-06 13:38:09 +01:00
matejcik
1233feb358 style: fix imports 2018-11-06 13:36:25 +01:00
matejcik
620e48e4d0 tests: adapt tests to new APIs 2018-11-06 13:36:25 +01:00
Pavol Rusnak
b4e34b98fc
trezorlib: add monero getaddress/getwatchkey + tests 2018-11-04 15:27:45 +01:00
Tibor Arpas
e9b540e6b6 altcoin: Capricoin support tests and minor trezorctl addition. (#325) 2018-10-24 15:05:59 +02:00
Pavol Rusnak
57f1dddc2f
fix style 2018-10-23 15:30:31 +02:00
Pavol Rusnak
45265cdcb7
tests: enable Stellar tests for T1 2018-10-23 14:13:55 +02:00
Pavol Rusnak
7e9501e816
tests: fix test_protection_levels (add buttonrequest to reset workflow) 2018-10-23 12:26:10 +02:00
Pavol Rusnak
ac0731300e
fix style 2018-10-23 12:24:10 +02:00
Pavol Rusnak
0aa6e45eec
tests: add tests for missing multisig 2018-10-22 15:59:07 +02:00
Pavol Rusnak
43b7ca4fd6
tests: fix style 2018-10-22 15:41:27 +02:00
Pavol Rusnak
1397c3b4d9
tests: update T1+T2 reset+recovery tests to reflect new Confirm dialog 2018-10-22 14:44:36 +02:00