Jan Pochyla
c02673152a
protobuf: optimize message dumping
...
- count the size in bytes in sync code
- cache message fields between counting and dumping
- cache message fields for repeated embedded messages
2018-10-26 15:02:19 +02:00
Pavol Rusnak
6bced8bb54
style: fix F841 local variable is assigned to but never used
2018-10-06 13:38:30 +02:00
Dusan Klinec
5b5b593eb3
workflow: allow more arguments to the import workflow
...
Allows to use stateful message handlers
```python
wire.add(MessageType.MoneroTransactionSign, __name__, "get_address", STATE)
```
2018-08-30 14:12:03 +02:00
Jan Pochyla
8421fa4fdb
apps: unify wire registering, load modules automatically
2018-08-27 14:56:21 +02:00
Jan Pochyla
dcb15f77c3
src: run black
2018-07-10 13:05:15 +02:00
Jan Pochyla
ead154b907
src: run isort
2018-07-10 13:05:15 +02:00
Jan Pochyla
88744d2450
wire: remove codec_v2.py
2018-06-21 15:51:36 +02:00
Jan Pochyla
db696b23fd
src/trezor/wire: add exceptions for all defined FailureTypes
...
Makes the error API much more ergonomic.
2018-04-23 16:12:44 +01:00
Jan Pochyla
e223173b4e
loop: wait -> spawn, select -> wait
...
select was a bit confusing name, as we always block on only one
interface.
2018-04-13 14:57:04 +02:00
Jan Pochyla
60bec0b4d1
src/trezor/wire: allow passing MessageType classes to register()
2018-04-05 12:34:51 +02:00
Jan Pochyla
04680f4bbf
src/trezor/wire: clean up after workflows
2018-04-03 20:39:26 +02:00
Pavol Rusnak
67d835fd3e
src: make flake8 happy
2018-02-28 18:25:04 +01:00
Jan Pochyla
8ac915e75f
src/trezor/wire: make sure the writes succeed
2018-02-28 17:17:09 +01:00
Jan Pochyla
8f1ed5edce
src: handle wire msgs while waiting for ui
2018-02-28 17:17:09 +01:00
Jan Pochyla
323714dc61
src/trezor/wire: disable v2 codec
2018-02-27 02:09:04 +01:00
Jan Pochyla
04acab723a
trezor/loop: add loop.close()
2017-10-10 15:35:01 +02:00
Jan Pochyla
49cc4651c2
bunch of api cleanups
2017-09-19 23:47:35 +02:00
Jan Pochyla
a235a6b38b
all: docs, logging
2017-08-21 13:22:35 +02:00
Jan Pochyla
3db1bf89fa
remove trezor.main, simplify trezor.workflow
2017-08-16 15:02:03 +02:00
Jan Pochyla
bc9beaf5d8
wire: fix Context.call
2017-08-15 18:14:14 +02:00
Jan Pochyla
3562ffdc54
wire: pass Context to apps
2017-08-15 18:14:14 +02:00
Jan Pochyla
d2781d030d
msg: rename to io
2017-08-15 18:14:14 +02:00
Jan Pochyla
1f90e781d5
wire: simplify, use async codecs
2017-08-15 18:14:14 +02:00
Jan Pochyla
915cf849e9
trezor.msg: remove select, add poll
...
TODO: decide if we want to continue polling on interface numbers, or rather on usb/touch file objects
2017-06-26 16:03:20 +02:00
Jan Pochyla
98e82e3cd5
code style
2017-06-12 18:16:06 +02:00
Jan Pochyla
6e15b37205
trezor.wire: less logs
2017-06-12 18:05:06 +02:00
Jan Pochyla
e86924d645
trezor.wire: fix unexpected message error
2017-01-24 14:14:03 +01:00
Jan Pochyla
ec49c2d97a
trezor.wire: unexpected message should interrupt workflow silently
2017-01-18 18:00:38 +01:00
Jan Pochyla
8bdd59642f
trezor.wire: print session ID as hex
2017-01-06 14:07:18 +01:00
Jan Pochyla
d56dc88861
wire: refactoring
...
- prefer importing modules instead of module members
- session_id is always first argument
- prefer much shorter names, don't expect users to import module members
- shuffle around session-specific code
- reduce allocations
2016-12-08 16:19:09 +01:00
Jan Pochyla
0b7874ad43
loop: rename Future to Signal
...
Future semantics were changed to allow multiple deliveries to avoid allocating more future objects than neccessary, and Signal describes this behaviour more accurately.
2016-12-08 16:19:09 +01:00
Jan Pochyla
1b27bb480d
trezor.wire: rename modules
2016-12-08 16:19:09 +01:00
Jan Pochyla
02d615ff06
wire: convert to bytearray every time
2016-11-15 18:55:38 +01:00
Jan Pochyla
e556aea42b
wire: fix when the footer is too short
2016-11-15 18:09:45 +01:00
Jan Pochyla
83043f7aef
wire: update to latest changes in protobuf
2016-10-26 17:36:11 +02:00
Jan Pochyla
507d9bdf68
wire: add tests for v1 codec
2016-10-24 15:40:34 +02:00
Jan Pochyla
d0b29d4caa
wire: add tests, fix missing 0-padding
2016-10-21 15:02:20 +02:00
Jan Pochyla
688d293b01
wire: use memoryview() asap in the parsing process
2016-10-20 15:14:40 +02:00
Pavol Rusnak
882efbf21b
modtrezormsg: use interfaces index internally, usage_page externally
2016-10-11 13:15:13 +02:00
Pavol Rusnak
3f44dfedb5
modtrezormsg: use usage_page to identify interfaces
2016-10-11 12:14:17 +02:00
Jan Pochyla
6d5514ac4a
make logging less verbose
2016-10-06 15:05:14 +02:00
Jan Pochyla
c019741c33
wire: fix write_message, pbuf dumps is sync now
2016-10-06 15:05:14 +02:00
Jan Pochyla
4b0da8677a
wire: fix read_message for v1 protocol
2016-10-06 15:05:14 +02:00
Jan Pochyla
407169af01
import qualified const()
2016-09-29 12:29:43 +02:00
Jan Pochyla
c93133026e
autopep8 and minor cosmetics
2016-09-28 23:28:53 +02:00
Jan Pochyla
fb7b85e479
move protobuf to a single module
2016-09-28 23:17:11 +02:00
slush0
cb1dcc965d
TREZOR v1 protocol codec
2016-09-28 22:59:30 +02:00
slush0
e8850e4aa5
Fixing generator startup in read_message.
2016-09-28 22:57:45 +02:00
slush0
8a160becb9
Added support for TREZOR v1 protocol (acts as session 0 internally).
2016-09-28 22:34:12 +02:00
Pavol Rusnak
a3ec1c082a
add log to wire.io
2016-09-27 17:26:14 +02:00