mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-29 00:31:02 +00:00
src/trezor/wire: disable v2 codec
This commit is contained in:
parent
5e8ea18cce
commit
323714dc61
@ -6,7 +6,6 @@ from trezor import messages
|
|||||||
from trezor import workflow
|
from trezor import workflow
|
||||||
|
|
||||||
from . import codec_v1
|
from . import codec_v1
|
||||||
from . import codec_v2
|
|
||||||
|
|
||||||
workflow_handlers = {}
|
workflow_handlers = {}
|
||||||
|
|
||||||
@ -20,9 +19,11 @@ def register(mtype, handler, *args):
|
|||||||
|
|
||||||
def setup(iface):
|
def setup(iface):
|
||||||
'''Initialize the wire stack on passed USB interface.'''
|
'''Initialize the wire stack on passed USB interface.'''
|
||||||
session_supervisor = codec_v2.SesssionSupervisor(iface, session_handler)
|
# session_supervisor = codec_v2.SesssionSupervisor(iface, session_handler)
|
||||||
session_supervisor.open(codec_v1.SESSION_ID)
|
# session_supervisor.open(codec_v1.SESSION_ID)
|
||||||
loop.schedule(session_supervisor.listen())
|
# loop.schedule(session_supervisor.listen())
|
||||||
|
handler = session_handler(iface, codec_v1.SESSION_ID)
|
||||||
|
loop.schedule(handler)
|
||||||
|
|
||||||
|
|
||||||
class Context:
|
class Context:
|
||||||
@ -81,16 +82,10 @@ class Context:
|
|||||||
await writer.aclose()
|
await writer.aclose()
|
||||||
|
|
||||||
def getreader(self):
|
def getreader(self):
|
||||||
if self.sid == codec_v1.SESSION_ID:
|
return codec_v1.Reader(self.iface)
|
||||||
return codec_v1.Reader(self.iface)
|
|
||||||
else:
|
|
||||||
return codec_v2.Reader(self.iface, self.sid)
|
|
||||||
|
|
||||||
def getwriter(self):
|
def getwriter(self):
|
||||||
if self.sid == codec_v1.SESSION_ID:
|
return codec_v1.Writer(self.iface)
|
||||||
return codec_v1.Writer(self.iface)
|
|
||||||
else:
|
|
||||||
return codec_v2.Writer(self.iface, self.sid)
|
|
||||||
|
|
||||||
|
|
||||||
class UnexpectedMessageError(Exception):
|
class UnexpectedMessageError(Exception):
|
||||||
|
@ -12,10 +12,7 @@ sleep 1
|
|||||||
# run tests
|
# run tests
|
||||||
cd ../tests
|
cd ../tests
|
||||||
error=0
|
error=0
|
||||||
if ! TREZOR_TRANSPORT_V1=0 pytest -k 'not skip_t2' --pyargs trezorlib.tests.device_tests ; then
|
if ! pytest -k 'not skip_t2' --pyargs trezorlib.tests.device_tests ; then
|
||||||
error=1
|
|
||||||
fi
|
|
||||||
if ! TREZOR_TRANSPORT_V1=1 pytest -k 'not skip_t2' --pyargs trezorlib.tests.device_tests ; then
|
|
||||||
error=1
|
error=1
|
||||||
fi
|
fi
|
||||||
kill $upy_pid
|
kill $upy_pid
|
||||||
|
Loading…
Reference in New Issue
Block a user