1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-18 13:38:12 +00:00
Commit Graph

718 Commits

Author SHA1 Message Date
matejcik
f3a042db80 trezorlib: split out methods from ProtocolMixin 2018-07-09 13:56:22 +02:00
matejcik
1820f529fc trezorlib: shuffling things from client 2018-07-09 13:50:25 +02:00
matejcik
2f3a32f8e8 trezorlib: drop support for EncryptMessage and DecryptMessage 2018-07-09 13:46:18 +02:00
matejcik
19a0f4cc7b tx_api: support blockbook, allow url-less operation
Bitcoin Testnet backends were removed.
This broke our tests that work purely on local data but nevertheless
need to know backend URLs. Because the design is less than ideal.

Here, we do a little cleanup:
* blockbook URLs are respected
* Dogecoin is now supported by our blockbook backend so we don't need
  a special tx-api implementation
* it's possible to instantiate a TxApi that is backed by the cache,
  without a known URL
* relevant tests now make use of this feature
2018-07-09 13:46:18 +02:00
matejcik
85a32d01b9 build: do not import trezorlib in setup.py, parse out __version__ by hand
also update path to coin generating tool
2018-07-09 13:46:18 +02:00
matejcik
6f23331dfc build: remove prebuilt protobuf files
Also clean out .gitignore a little while we're at it
2018-07-09 13:46:18 +02:00
matejcik
ad16588171 stellar: update T1 tests 2018-06-28 12:40:49 +02:00
ZuluCrypto
b2f35de8b8 stellar.py - do not alias trezorlib.messages import to "proto" 2018-06-28 11:57:56 +02:00
ZuluCrypto
cd7189839c stellar - return addresses as utf-8 strings 2018-06-28 11:57:56 +02:00
ZuluCrypto
2549eaf5a6 test_stellar.py - split imports into two lines and do not alias messages to "proto" 2018-06-28 11:57:56 +02:00
ZuluCrypto
05afd986c1 test_stellar.py - fix style issues 2018-06-28 11:57:56 +02:00
ZuluCrypto
af38407a43 stellar - add unit tests for parsing XDR 2018-06-28 11:57:56 +02:00
ZuluCrypto
96f0801b90 stellar.py - fix missing destination_amount when parsing path payment 2018-06-28 11:57:56 +02:00
ZuluCrypto
dd324a99c5 stellar.py - fix mising str() cast on type 2018-06-28 11:57:56 +02:00
ZuluCrypto
8a284c03d1 stellar.py - fix incorrect constants 2018-06-28 11:57:56 +02:00
ZuluCrypto
4628327789 fix comment 2018-06-28 11:57:56 +02:00
ZuluCrypto
188178a438 stellar - add test for setting inflation destination 2018-06-28 11:57:56 +02:00
ZuluCrypto
6afaa41616 stellar - _xdr_read_address now returns string instead of bytes 2018-06-28 11:57:56 +02:00
Pavol Rusnak
cc6cc49999
tests: re-enable Stellar for T1 2018-06-27 17:42:11 +02:00
Tomas Susanka
5f73976893 stellar: note on BIP-32 usage; address test with Stellar's official test vectors 2018-06-26 11:52:47 +02:00
matejcik
201297a1f9 tests: close debuglink in fixture-based tests 2018-06-22 14:18:18 +02:00
Pavol Rusnak
3c1456939c
tests: update test_cancel to test using Initialize 2018-06-22 13:28:32 +02:00
matejcik
f9f79b745c Merge branch '0.10.x' 2018-06-22 13:19:28 +02:00
matejcik
b7cbbba6a7 release: bump version to 0.10.2 2018-06-21 16:50:38 +02:00
matejcik
54f1599a5a regenerate license headers
This clarifies the intent: the project is licenced under terms
of LGPL version 3 only, but the standard headers cover only "3 or later",
so we had to rewrite them.

In the same step, we removed author information from individual files
in favor of "SatoshiLabs and contributors", and include an AUTHORS
file that lists the contributors.

Apologies to those whose names are missing; please contact us if you wish
to add your info to the AUTHORS file.
2018-06-21 16:49:13 +02:00
Tomas Susanka
10bbb57c86
tests/device: stellar accounts are addresses 2018-06-20 15:58:13 +02:00
Pavol Rusnak
44ac7656b4
vendor: update trezor-common; regenerate protobuf 2018-06-20 15:57:35 +02:00
Pavol Rusnak
b1eae58884
tests: disable Stellar tests for T1 too 2018-06-20 00:13:34 +02:00
Pavol Rusnak
3f93b28fe4
device_tests: fix test_msg_signtx_zcash 2018-06-15 10:35:28 +02:00
Tomas Susanka
ebe41c69f8 tests/stellar: trezor core currently throws Firmware err 2018-06-13 13:40:58 +02:00
Pavol Rusnak
015d72102d
device_tests: add failing tests for stellar 2018-06-11 19:22:16 +02:00
matejcik
cf661a8196 Merge branch 'fix-0.10.1' 2018-06-11 19:05:32 +02:00
Pavol Rusnak
1477c9aa9e
trezorctl/trezorlib: add show_display to StellarGetAddress/StellarGetPublicKey 2018-06-11 18:55:52 +02:00
matejcik
77361e563d release: bump version and changelog for 0.10.1 2018-06-11 18:51:16 +02:00
Tomas Susanka
22872c53c2 tests/stellar: missing field annotation 2018-06-11 18:42:23 +02:00
Tomas Susanka
d3d9ceb0c4 tests: stellar test for get address 2018-06-11 18:42:23 +02:00
Tomas Susanka
c0a823ca1c protobuf: stellar get address 2018-06-11 18:42:23 +02:00
matejcik
741f264a2f release: bump version and add date to changelog 2018-06-08 16:07:46 +02:00
matejcik
d2021fd8a2 ckd_public: restore as a deprecation wrapper
(because older versions of electrum will still require it)
2018-06-07 17:07:20 +02:00
matejcik
73f016c465 trezorctl: update firmware_update to work better with TT (fix #269)
This removes the --erase option which was fishy before (and is now superseded
by wipe_device in bootloader mode).

Also adds a draft of "local fingerprint check" functionality for T1. This will
be expanded to work with TT in future releases.
2018-06-07 17:06:31 +02:00
Tomas Susanka
63222931be tests/device: nem is not xfail anymore 2018-06-07 14:41:47 +02:00
matejcik
e110d87494 protobuf: update trezor-common and regenerate 2018-06-07 14:07:26 +02:00
Aleksey Popov
922748e348 lisk: restore Lisk sign and verify message functionality 2018-06-07 14:07:26 +02:00
Pavol Rusnak
9238382435
tests: update test_msg_signtx_zcash 2018-06-06 16:42:58 +02:00
Pavol Rusnak
21670b8226
tests: update zcash test 2018-06-05 17:20:38 +02:00
Pavol Rusnak
e4dcc8d8c6
zcash overwinter support 2018-06-05 16:05:14 +02:00
matejcik
cd3559b419 tests: rename test_cancel after it was parametrized 2018-06-05 13:11:24 +02:00
matejcik
269eaa298f tests: make a fixture out of client
also implement Cancel tests
2018-06-05 13:08:54 +02:00
ZuluCrypto
7673ebf952 stellar - add additional tests and instructions for calculating signature 2018-06-05 11:59:48 +02:00
Pavol Rusnak
17479f26a7
device_tests: re-enable decred test for T1 2018-06-02 15:53:22 +02:00
Pavol Rusnak
5e14a5f059
device_tests: cashaddr test in sign/verify message 2018-06-01 21:30:05 +02:00
Pavol Rusnak
1a642713a5
Revert "device_tests: update test_bip32_speed cache-speed ratio to 1.2x"
This reverts commit 2ab4751dcb.
2018-05-30 12:44:39 +02:00
Pavol Rusnak
61f5bbca91
vendor: update trezor-common 2018-05-30 11:31:12 +02:00
Pavol Rusnak
d4b17c5b36
device_tests: fix bitcore entry in coins.py 2018-05-30 10:50:49 +02:00
Pavol Rusnak
0d6ac99bf5
device_tests: fix bgold unit test 2018-05-29 17:33:18 +02:00
matejcik
279da34864 Merge branch 'matejcik/refactor' 2018-05-28 17:52:01 +02:00
matejcik
5191fd09be device_tests: add a compat test for cosi, checking interoperability between Trezor and local implementation 2018-05-28 17:41:52 +02:00
Pavol Rusnak
2ab4751dcb
device_tests: update test_bip32_speed cache-speed ratio to 1.2x 2018-05-28 16:58:42 +02:00
matejcik
8410151810 remove remaining usages of expand_path 2018-05-28 15:47:57 +02:00
matejcik
c10c3f7fd9 stellar: better way to handle default path
(maybe do this for other currencies too?)
2018-05-28 15:47:40 +02:00
matejcik
aace6577c8 log: remove special handling of Features/CoinType in prettyprinter
now that Trezor won't send CoinTypes anymore
2018-05-28 15:01:17 +02:00
matejcik
99bc267301 client: hide uninteresting functions from test tracebacks 2018-05-28 14:45:54 +02:00
matejcik
2bf34dc4b4 unit_tests: added test suite for Ed25519 and CoSi
It's rather slow so it's disabled by default.
Use `pytest -m slow_cosi` to run.
2018-05-28 14:20:45 +02:00
matejcik
a0f73b726d cosi: typehints, documentation, removed selftest 2018-05-28 14:20:26 +02:00
matejcik
0e8fe9e743 ed25519: type hints 2018-05-28 14:17:11 +02:00
Pavol Rusnak
648ef511b6
device_tests: use original ethereum message digest, enable ethereum_{sign,verify}message for T2 2018-05-25 14:23:16 +02:00
matejcik
2fdb5cd538 cosi: publish "pubkey from privkey" operation from ed25519 2018-05-25 13:12:42 +02:00
matejcik
886e269e2f trezorlib: mark ed25519 impl as private 2018-05-25 13:07:02 +02:00
Tomas Susanka
f273bbb736 tests/device/stellar: assert pubkey, address comment 2018-05-25 12:01:07 +02:00
matejcik
9982ef98f9 Merge branch 'master' into matejcik/refactor 2018-05-24 19:18:26 +02:00
matejcik
e779a251fb transport: better ways to handle errors when enumerating devices 2018-05-24 19:14:05 +02:00
matejcik
97fa4670ac transport: add message logging to bridge 2018-05-24 18:08:50 +02:00
Pavol Rusnak
e2962ef9f7
fix typo 2018-05-24 17:07:17 +02:00
Pavol Rusnak
bb5e49e452
device_tests: fix failed test 2018-05-24 17:02:11 +02:00
Pavol Rusnak
b67322be2f
device_tests: enable cashaddr tests (msg_getaddress, signtx_bcash) for T2 2018-05-24 16:40:27 +02:00
matejcik
17b37034e8 device_tests: fix test_msg_recoverydevice for T1 2018-05-23 17:08:16 +02:00
matejcik
f8f0be9c86 device_tests: fix T1 test differences in wording 2018-05-23 16:54:24 +02:00
matejcik
f2aee59e27 device_tests: do not xfail Lisk tests, they are now merged 2018-05-23 14:21:24 +02:00
matejcik
4b7926268e drop Lisk and Stellar sign/verify message functionality 2018-05-23 14:20:54 +02:00
matejcik
70172520fb protobuf: update messages from upstream.
This drops sign/verify messages for Lisk and Stellar so we have to
remove the corresponding methods.
2018-05-23 14:04:09 +02:00
Jan Pochyla
bc27089546 tests: remove lisk sign/verify 2018-05-23 13:16:14 +02:00
matejcik
ce7ee8ae30 device_tests: mark decred 2018-05-22 20:12:51 +02:00
matejcik
2225343c52 device_tests: in test_multisig, T1 raises a different message
expected: "Pubkey not found in multisig script"
actual: "signing.c:780:Pubkey not found in multisig script"
2018-05-22 20:12:51 +02:00
matejcik
013e0f6d66 device_tests: get nicer tracebacks by using pytest.raises instead of custom exception code 2018-05-22 20:12:51 +02:00
matejcik
224e3c18f5 device_tests: fix test_protection_levels for T1
a couple expected ButtonRequests were missing
2018-05-22 20:12:45 +02:00
matejcik
a4fe17b461 device_tests: xfail for decred. This should be investigated more though. 2018-05-22 17:51:41 +02:00
matejcik
465c01d4f7 device_tests: add more currency markers
missed Stellar tests, plus Ethereum, for good measure
2018-05-22 17:29:03 +02:00
matejcik
af98a4071a device_tests: allow custom runxfail
We can now selectively runxfail certain tests. This is useful for
accepting PRs into trezor-core:

1. trezor-core is going to get a pytest.ini that sets xfail_strict.
   That means that if an `xfail`ed test actually passes, that will
   break the test suite. So it will be visible when we implement
   a feature for which tests exist.
2. To allow PRs to pass the test suite without touching python-trezor
   directly, we add a new pytest.ini option: run_xfail.
   This adds a list of markers which will ignore `xfail`.
   So:
   2.1 First, the python-trezor PR marks the tests with the name
       of the feature. This commit already does that: Lisk tests
       are marked `@pytest.mark.lisk`, NEMs are `@pytest.mark.nem`,
       etc.
       The tests will be also marked with `xfail`, because the
       feature is not in core yet.
   2.2 Then, the trezor-core PR implements the feature, which makes
       the `xfail`ed tests pass. That breaks the test suite.
   2.3 To fix the test suite, the core PR also adds a `run_xfail`
       to `pytest.ini`: `run_xfail = lisk`.
       (it can take a list: `run_xfail = lisk nem stellar`)
       That will make the test suite behave as if the tests are not
       `xfail`ed. If the feature is implemented correctly, the tests
       will pass.
   2.4 When the PR is accepted to core, the next step should be
       a PR to python-trezor that removes the `xfail`s. After that,
       we should also remove the `run_xfail` option, just to be tidy.
2018-05-22 17:29:03 +02:00
Tomas Susanka
e656bbf072 stellar: xdr parse move to trezorctl; client works with messages 2018-05-17 17:17:09 +02:00
matejcik
db92b13f97 cosi: move things around
ed25519raw is moved back to trezorlib
ed25519cosi is renamed to cosi, and has a couple more functions,
with the expectation that TrezorClient.cosi_* methods will move there.

Also most code shouldn't need ed25519raw for anything, so it might get
renamed to "_ed25519" to indicate that it's a private implementation.

For now, I added a "verify" method to cosi, so that you don't need to
call into ed25519raw.checkvalid. But trezor-core's keyctl is also
using ed25519raw.publickey. I'm not sure if that's worth replicating
in cosi, or whether to just leave it be, so I'm leaving it be for now.

Importantly, new function "sign_with_privkey" does that math thing that
was part of the selftest and is also explicitly listed in keyctl.
(it's called sign_with_privkey because I expect to have a "sign" method
here that calls into Trezor)
2018-05-17 12:53:01 +02:00
Tomas Susanka
277296be90 tests/stellar: verify marked as not passing on T2 2018-05-16 15:04:00 +02:00
Tomas Susanka
3ee3083e8c tests/device/stellar: verify message 2018-05-14 16:53:10 +02:00
Tomas Susanka
bb74950e23 stellar: message is normalized before sign/verify 2018-05-14 15:33:57 +02:00
Tomas Susanka
22560128fe stellar: StellarSignMessage.message is bytes 2018-05-14 15:17:13 +02:00
Tomas Susanka
d57fe33582 tests/device/stellar: sign message 2018-05-14 14:09:39 +02:00
matejcik
cc7c8ccb59 client: clean up exception and decorator code 2018-05-11 15:34:49 +02:00
matejcik
a478dac5f7 client: clean up logging and printing 2018-05-11 15:34:23 +02:00
matejcik
123aec5d7d tests/device_tests: remove all star imports 2018-05-11 15:29:38 +02:00
matejcik
266e34eec4 tests/device_tests: disable protobuf outputs unless run with -v 2018-05-11 15:29:38 +02:00
matejcik
0b6ec27064 logging: get rid of pprint and VerboseWireMixin
(and also TrezorClientVerbose)
2018-05-11 15:29:38 +02:00