From e86924d64519db78b434bade81906520e7deef76 Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Tue, 24 Jan 2017 14:13:37 +0100 Subject: [PATCH] trezor.wire: fix unexpected message error --- src/trezor/wire/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/trezor/wire/__init__.py b/src/trezor/wire/__init__.py index 04898e916a..699785fae2 100644 --- a/src/trezor/wire/__init__.py +++ b/src/trezor/wire/__init__.py @@ -148,8 +148,9 @@ def _handle_unexpected(session_id, msg_type, data_len): from trezor.messages.Failure import Failure from trezor.messages.FailureType import UnexpectedMessage failure = Failure(code=UnexpectedMessage, message='Unexpected message') + failure = Failure.dumps(failure) sessions.get_codec(session_id).encode( - session_id, failure.MESSAGE_WIRE_TYPE, failure.dumps(), _write_report) + session_id, Failure.MESSAGE_WIRE_TYPE, failure, _write_report) def _write_report(report):