matejcik
c0d2af557c
further cleanup of normalize_nfc usage
2018-03-06 15:50:54 +01:00
matejcik
2c15a861dc
replace removed iterbytes with direct iteration
2018-03-06 15:50:54 +01:00
matejcik
5422c40451
start dropping py2 compatibility code
2018-03-06 15:50:54 +01:00
matejcik
9f2583f893
webusb: check if a device is functional when enumerating
...
this fixes issue #223 on Windows, where a device would be returned in two copies, only one of which works
2018-03-06 13:32:51 +01:00
matejcik
f75b90d260
Merge branch 'upstream' into refactor-transport-nicediff
2018-03-05 19:56:47 +01:00
matejcik
2752e6d046
bump version to 0.9.1
2018-03-05 19:14:04 +01:00
matejcik
cd9bd06163
prettyprint: fix flake8 complaints
2018-03-05 19:10:54 +01:00
matejcik
52c2319822
omit Features message from debug dumps
2018-03-05 18:57:40 +01:00
matejcik
db3767f7ef
tweak prettyprint for some known elements
2018-03-05 18:57:40 +01:00
matejcik
07ceb9aacc
pretty printing protobufs
2018-03-05 18:57:40 +01:00
Jan Pochyla
95603b85dd
tests: enable segwit sign&verify tests for t2
2018-03-05 17:45:17 +01:00
Jan Pochyla
4979c296b7
tests: enable test_apply_settings, test_apply_settings_passphrase for t2
2018-03-05 17:45:17 +01:00
Pavol Rusnak
db827bfe01
tests: update test_msg_getpublickey.py, add test_msg_getpublickey_curve.py
2018-03-05 17:37:56 +01:00
matejcik
dc8eec1656
trezorlib/transport: for get_transport(None), raise exception from None if no trezor is found,
...
because the IndexError should not be part of the traceback
2018-03-05 17:31:11 +01:00
matejcik
ff80ca1b82
restore device.py as a deprecated compatibility wrapper
2018-03-05 16:18:32 +01:00
Jan Pochyla
0e065237c9
tests: disable TestBip32Speed::test_cache on t2
2018-03-05 15:49:04 +01:00
matejcik
2f1c15b588
trezorlib/transport: make flake8 happy
2018-03-05 14:25:37 +01:00
matejcik
513e6aae08
better way for test suite to search for the right device,
...
that also respects TREZOR_PATH
2018-03-02 18:25:39 +01:00
matejcik
6519657808
trezorlib/transport: smarter handling of prefix search
...
For UDP transport, it's useful to be able to specify a path that should be tried directly,
without enumerating first.
2018-03-02 18:22:33 +01:00
matejcik
55641dd8b5
make flake8 happy ( #225 )
2018-03-02 16:47:29 +01:00
matejcik
d2913c20bd
trezorlib/transport: move TrezorDevice functionality to transport and make it better ^_^
2018-03-02 16:46:10 +01:00
Tomas Susanka
b24550c72f
tests: ethereum sign/verify is skipped ( #224 )
2018-03-02 16:37:34 +01:00
matejcik
bc8120230a
trezorlib/transport: make changes to support being a separate submodule, move common functions to superclass
2018-03-02 15:44:24 +01:00
matejcik
473ea19570
trezorlib/transport: rename files as separate step (to make diffs nicer)
2018-03-02 15:35:56 +01:00
slush
e37e9bfebd
Fixing Origin header for Bridge 2.0.7
2018-03-01 10:33:47 +01:00
Pavol Rusnak
b1a76e4a68
tests: revert basic tests
2018-03-01 00:07:27 +01:00
Pavol Rusnak
7841bbefbe
client: implement PassphraseStateRequest handling
2018-02-28 23:13:17 +01:00
Pavol Rusnak
ce9da28a3d
update protobuf
2018-02-28 23:13:17 +01:00
Pavol Rusnak
0d680944a4
txcache: add new tx
2018-02-28 00:56:55 +01:00
Pavol Rusnak
4cfcd93d48
transport: force V1 protocol for T2 for now
2018-02-27 18:30:09 +01:00
Tomas Susanka
6e1eb8e664
tests/device: ethereum erc20 tokens test
2018-02-27 17:41:18 +01:00
Jan Pochyla
6c8ccc0680
tests/device_tests: for t2, enable bch & multisig, disable load & reset
2018-02-27 16:29:59 +01:00
Pavol Rusnak
a352f41f07
protob: update PassphraseAck
2018-02-27 15:41:59 +01:00
Tomas Susanka
a8d34430a5
tests/device/bcash: fix attack amount test
2018-02-27 15:10:36 +01:00
Tomas Susanka
aec8f04f68
tests/device: assert exception type and message
2018-02-27 15:08:00 +01:00
Pavol Rusnak
03b3ef10f4
update protobuf
2018-02-27 14:24:23 +01:00
Pavol Rusnak
8dffdd8f85
tests: fix test_basic (don't compare state in Features), add test_basic_state
2018-02-27 14:24:23 +01:00
Tomas Susanka
55da3d9a9a
tests/device/signtx: assert exception type and message
2018-02-27 11:50:10 +01:00
Tomas Susanka
617ccc21d9
tests: deepcopy is required when debug_processor is invoked
2018-02-23 16:03:43 +01:00
Tomas Susanka
cbd3751bdb
tests/device: allow multiple output changes (treat second as a normal output)
...
based upon e716f7e84e
2018-02-23 13:14:10 +01:00
Tomas Susanka
0e2d5c8155
tests/device: change on main chain IS allowed
...
based upon e716f7e84e
2018-02-23 13:10:55 +01:00
Tomas Susanka
1e8f2d1e72
tests/device: change on main chain not allowed
2018-02-23 13:09:49 +01:00
Tomas Susanka
d6f0c54d3e
tests: CallException relaced with AssertionException in response validation
...
Generic exceptions are evil. When throwing a CallException in the
request check you can't distinguish in the tests if it is an Exception
that occured in during the execution (that's CallException) or during
some tests (that used to be CallException as well).
2018-02-22 16:51:34 +01:00
Tomas Susanka
bc036bc857
tests/device: two output changes yield error
...
this test should fail on T1 after e716f7e84ecdb4732ad97b56e78d7407ec0b321e
2018-02-22 14:20:53 +01:00
Jan Pochyla
2c91a668aa
tests: fix udp debuglink
2018-02-21 15:31:32 +01:00
Pavol Rusnak
bccd61cb23
client: implement PassphraseRequest.on_device handling
2018-02-14 19:11:21 +01:00
Pavol Rusnak
e256281a99
rebuild protobuf to add {Initialize,Features}.state
2018-02-09 17:46:54 +01:00
Tomas Susanka
30e5c80956
Multisig tests enabled for t2 ( #216 )
2018-02-08 15:36:26 +01:00
脇山P
4cbf74f789
Support monacoin ( #215 )
2018-02-08 14:09:40 +01:00
Pavol Rusnak
1c3b05a44b
bump version to 0.9.0
2018-02-06 22:12:17 +01:00
Pavol Rusnak
ba8bb99097
fix flake8 error
2018-02-06 21:39:02 +01:00
slush
489b1eb074
Removing unused transport_pipe.py
2018-02-06 21:30:13 +01:00
slush
e141a6f5d1
Added get_path() to transports
2018-02-06 21:10:30 +01:00
slush
f00a689087
Remove unnecessary logging
2018-02-06 20:52:45 +01:00
slush
6a22cf481c
Fix handling of find_by_path in transports.
2018-02-06 18:40:07 +01:00
Pavol Rusnak
d45cba1ddb
messages: add fw_vendor_keys to Features message
2018-02-06 16:25:30 +01:00
Pavol Rusnak
272ad30898
messages: add new fields to Features
2018-02-06 16:07:41 +01:00
Pavol Rusnak
e9705c8208
webusb: don't create usb context on WebUsbTransport import
2018-02-04 12:05:03 +01:00
Roman Zeyde
1b6873eb20
Allow compatibility with Python 2 ( #214 )
...
Following https://github.com/romanz/trezor-agent/issues/195
2018-02-04 11:44:20 +01:00
Yash
9ec331ed46
Add in import for TransportException in transport_udp.py ( #212 )
2018-02-04 11:42:58 +01:00
slush
9ebe1b5204
Remove debug print
2018-02-02 20:18:30 +01:00
slush
81db1da68f
Fix handling of bytes/str in transport paths
2018-02-02 20:17:10 +01:00
Karel Bilek
29ad78d57b
Ignoring non-webusb devices
2018-02-02 19:30:11 +01:00
slush
ac09c8d7de
Make all transport prefixes lowercase.
2018-02-02 19:20:03 +01:00
slush
03a11450c1
Adding bridge transport to TrezorDevice, using as default transport
2018-02-02 19:17:48 +01:00
slush
a4cdae39af
Introducing TrezorDevice, removing concept of transports from trezorctl
2018-02-02 18:29:20 +01:00
Pavol Rusnak
646338c414
small nits of last commit
2018-02-01 10:31:47 +01:00
Karel Bilek
759316e96f
Add webusb to transports
...
V2 protocol with debug link is not tested.
2018-02-01 10:25:01 +01:00
Pavol Rusnak
7b844f0379
add Sint64 to protobuf
2018-01-30 15:04:24 +01:00
slush
11fd72890c
trezorctl: Do not display PASSPHRASE on screen.
2018-01-29 18:09:42 +01:00
slush
ab42e93718
trezorctl: Allow entering passphrase by environment variable PASSPHRASE.
2018-01-29 18:04:48 +01:00
Pavol Rusnak
5b3e992521
transport: update to new bridge API
2018-01-29 17:48:08 +01:00
Anton Kolesnyk
a8cd90c3ad
Add varying url to broadcast tx, depending on the api
2018-01-15 00:25:05 +01:00
Anton Kolesnyk
28c9820b3d
Fixes for BlockCypher API and Dogecoin.
2018-01-14 16:14:39 +01:00
Pavol Rusnak
694bc7ac11
protobuf: don't generate storage protobuf
2018-01-12 13:06:43 +01:00
Pavol Rusnak
8f6b2449be
sort imports in pb2py
2018-01-12 12:58:39 +01:00
Pavol Rusnak
78d2c07d34
regenerate pb messages
2018-01-12 12:54:06 +01:00
Pavol Rusnak
47cfa178e4
tests: fix test_msg_ethereum_signtx.py
2018-01-11 23:06:47 +01:00
Tomas Susanka
0c517c1565
tests/device: code style typos
2018-01-11 22:54:08 +01:00
Tomas Susanka
4bbf5880ce
tests/device: ethereum sign tx with expected checks
2018-01-11 22:54:08 +01:00
Pavol Rusnak
0c5eac2f39
skip None and empty ([]) fields in proto messages
2018-01-07 18:07:13 +01:00
Pavol Rusnak
f587135b8d
fix last commit (also skip print statement)
2018-01-04 16:55:27 +01:00
Tomas Susanka
4e01971e4c
client: expected field check fix
2018-01-04 16:48:16 +01:00
slush
c71f234a8b
Added deprecation warning for Python2
...
Removed dependency to google's protobuf in bridge transport
Fixed PinRequest handling
2017-12-29 19:19:18 +01:00
Pavol Rusnak
6b31ac9753
fix typo
2017-12-27 01:44:26 +01:00
Anton Kolesnyk
956d5e7149
Add sign_tx support for Dogecoin
2017-12-27 01:39:06 +01:00
Pavol Rusnak
888b6f9171
fix file flags
2017-12-24 22:37:24 +01:00
Martin Skoviera
dac97ed5b6
Fixed enums in WordRequestType
2017-12-24 22:37:01 +01:00
Pavol Rusnak
70e6d13c23
device tests: simplify, drop unittest dependency
2017-12-23 22:03:24 +01:00
Pavol Rusnak
1881b0e6fd
device tests: re-enable ethereum tests for T2 again
2017-12-23 13:51:18 +01:00
Roman Zeyde
31c4836073
udp: fix __str__ method and allow simple enumeration
2017-12-23 13:43:51 +01:00
Roman Zeyde
f8a277dfba
transport_bridge: fix messages' module import
2017-12-23 13:43:51 +01:00
Roman Zeyde
8689440d90
client: fix PinMatrixRequestType enum usage
2017-12-23 13:43:51 +01:00
Saleem Rashid
b3ef649f64
device_tests: Add test_decred_multisig_change
2017-12-23 13:42:59 +01:00
Saleem Rashid
2df19127fd
device_tests: Add test_decred_send_change
2017-12-23 13:42:59 +01:00
Saleem Rashid
0926ab9bc8
device_tests: Clean up test_decred_send
2017-12-23 13:42:59 +01:00
Pavol Rusnak
41b75c5655
device_tests: use skip_t1 and skip_t2 markers
2017-12-19 19:24:40 +01:00
Saleem Rashid
2c00526d23
client: Remove DEFAULT_CURVE
...
The device should choose the default curve based on the coin or message.
2017-12-19 18:47:18 +01:00
Pavol Rusnak
c550e5c703
revert bytes/str change in tools.py
2017-12-19 16:10:37 +01:00
Pavol Rusnak
8a37c28ed6
fix typos in test names
2017-12-19 15:54:07 +01:00
Saleem Rashid
2996138341
protobuf: Call _fill_missing in __init__
2017-12-19 13:16:22 +01:00
Saleem Rashid
1c8f03968c
tests: Move to trezorlib.tests
2017-12-19 13:16:22 +01:00
Pavol Rusnak
753e91dff0
protobuf: encode to utf-8 bytestream
2017-12-18 22:44:54 +01:00
Pavol Rusnak
094d0b6ffb
revert ckd_public.py removal of bytes/string handling
2017-12-18 22:40:11 +01:00
Pavol Rusnak
c1b1bedb8c
ed25519: remove py2/py3 handling in ed25519 funcs as well
2017-12-18 22:34:15 +01:00
Pavol Rusnak
a9291e89c5
no need to use byteindex/iterbytes anymore
2017-12-18 22:26:55 +01:00
Saleem Rashid
9229f8b80a
coins: Add Decred Testnet
2017-12-18 16:34:43 +01:00
Saleem Rashid
c48724eca6
client: Fix string encoding for Python 2
2017-12-17 22:10:40 +01:00
Pavol Rusnak
60329f0b65
fix typo
2017-12-17 03:23:37 +01:00
slush
653ed4a67b
Added registering custom protobuf messages by application.
2017-12-17 03:17:37 +01:00
slush
da335049d7
Removed excessive logging
2017-12-17 02:58:35 +01:00
slush
3fedf44bf5
Bump version to 0.9.0a
2017-12-17 02:31:43 +01:00
slush
a27217811b
Rework from Google's protobuf to pure-python protobuf implementation
2017-12-17 02:19:16 +01:00
Saleem Rashid
1193b0ee85
transport_udp: Support TREZOR_TRANSPORT_V1
2017-12-16 22:47:19 +01:00
slush
f5c1587396
Version moved from version.py to __init__.py
2017-12-02 18:48:44 +01:00
slush
59ef832424
Add 'trezorctl version' to track version of installed package
2017-12-02 18:31:57 +01:00
Pavol Rusnak
ae663ffe0c
client: don't accept non-numerical values for PIN
2017-11-28 19:59:06 +01:00
Jochen Hoenicke
69067c9280
Parse json floats as string
...
With python-2.7 the float values are sometimes rounded to unacceptable
levels, e.g. stripping the last two digits for values over 100k BTC.
This change parses floats as strings to avoid rounding.
Refactored get_url out of fetch_json to make it easier to add
new tx_api with a different url scheme.
2017-11-28 19:55:31 +01:00
Nicola Larosa
62541cc55f
Fix encoding error in trezorlib.client.ProtocolMixin.load_device_by_mnemonic ( #153 )
2017-11-15 13:33:21 +01:00
Nicola Larosa
5d2d621055
Fix error when using trezorctl to connect to the trezor-core emulator. ( #152 )
...
* Fix error when using trezorctl to connect to the trezor-core emulator.
* Restore the ability to specify the host without the port
2017-11-13 22:15:09 +01:00
Pavol Rusnak
0d9ee4376d
use Mnemonic.normalize_string where possible
2017-11-13 22:13:32 +01:00
Pavol Rusnak
b9b11fa265
style: fix flake8 error
2017-11-08 21:25:15 +01:00
Pavol Rusnak
a5fc76d8c9
don't use generic Exception, but rather specific subclass
2017-11-06 11:10:23 +01:00
Jan Pochyla
fcd793e6e4
transport_hid: force V1 transport with env var
2017-10-31 13:51:13 +01:00
Pavol Rusnak
23d75bfc10
trezorctl: sign_tx command based on tx_sign_tool by mruddy
2017-10-24 00:50:01 +02:00
Pavol Rusnak
54426761c6
fix transport_hid for python2
2017-10-23 17:28:24 +02:00
Pavol Rusnak
5057e022c0
trezorlib: move ed25519cosi and ed25519raw from trezor-core
2017-10-04 00:38:53 +02:00
Pavol Rusnak
a71c33d123
trezorctl+client: add support for CoSi commit/sign
2017-10-03 18:43:28 +02:00
bithobbes
54df69a407
client.py: matrix recovery info: mention backspace
...
It is not obvious that it is possible to go back by backspace. Knowing this makes data entry much more comfortable.
2017-09-13 17:54:42 +09:00
Jan Pochyla
66ba2c20c0
transport: add TransportException
...
Fixes #134
2017-09-05 17:16:04 +02:00
Jan Pochyla
ac0184413d
transport_hid: refcount for hid handle
2017-09-05 17:15:19 +02:00
Pavol Rusnak
dffa93bee3
fix last commit (newline eof)
2017-09-04 17:40:15 +02:00
Jan Pochyla
b60ab51f9b
transport_hid: more strict interface detection
2017-09-04 17:30:07 +02:00
Pavol Rusnak
2a3f613242
hid: fix product_ids for v2
2017-09-04 14:31:15 +02:00
Jan Pochyla
52f96b3792
transport_hid: raise on missing debuglink
2017-09-04 13:44:19 +02:00
Jan Pochyla
8202971109
rework lazy connecting in client
2017-09-04 13:36:08 +02:00
Jan Pochyla
051f8e961b
protocol: 2/3 compat fixes
2017-09-04 11:44:33 +02:00
Jan Pochyla
3d3c2a29d0
client: add missing close method
...
close() is implemented in some of the mixins to dispose of any resources.
2017-09-04 11:30:34 +02:00
mruddy
02437d166a
fix v1 protocol
2017-09-03 19:34:01 +02:00
Saleem Rashid
eb1d66e27f
trezorlib: Add nem_get_address
2017-09-03 19:05:29 +02:00
Saleem Rashid
58b56bead6
trezorctl: Add nem_sign_tx
2017-09-03 19:05:29 +02:00
Saleem Rashid
991d367416
trezorlib: Update Protocol Buffers
2017-09-03 19:05:29 +02:00
Jan Pochyla
888a1edafa
fix style
2017-08-24 14:41:31 +02:00
Jan Pochyla
bc42eb68d6
transports: refactor, split protocol code
2017-08-24 14:29:27 +02:00
Pavol Rusnak
32fa08f38b
tests: remove estimate_tx_size
2017-07-31 14:00:26 +02:00
Saleem Rashid
b469519e26
client: fix matrix recovery, use named enums, use isdigit(), ignore broken E721 test
2017-07-31 13:35:31 +02:00
Pavol Rusnak
81d5170c10
tests: start rewriting device tests to pytest
2017-07-28 18:07:20 +02:00
Jan Pochyla
6df01fbfa3
TransportV2: adapt to recent changes
...
- remove checksum
- add sequence numbers
2017-07-28 15:58:20 +02:00
Jochen Hoenicke
9917d9ebfc
New unit tests for signing (bitcoin cash)
2017-07-27 21:51:00 +02:00
Pavol Rusnak
8133317172
add SignMessage.script_type
2017-07-24 16:11:38 +02:00