From 4b0da8677a0471e93e9d7747a4d284f74179f42c Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Thu, 6 Oct 2016 12:34:09 +0200 Subject: [PATCH] wire: fix read_message for v1 protocol --- src/trezor/wire/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/trezor/wire/__init__.py b/src/trezor/wire/__init__.py index 40040f6378..e349038638 100644 --- a/src/trezor/wire/__init__.py +++ b/src/trezor/wire/__init__.py @@ -78,8 +78,12 @@ def setup(): async def read_message(session_id, *exp_types): log.info(__name__, 'reading message of types %s', exp_types) future = Future() - wire_decoder = decode_wire_stream( - _dispatch_and_build_protobuf, session_id, exp_types, future) + if session_id == SESSION_V1: + wire_decoder = decode_wire_v1_stream( + _dispatch_and_build_protobuf, session_id, exp_types, future) + else: + wire_decoder = decode_wire_stream( + _dispatch_and_build_protobuf, session_id, exp_types, future) wire_decoder.send(None) register_session(session_id, wire_decoder) return await future