From f6be3899eb4ebbdb659799d587ed490072ddecc3 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sat, 2 Jun 2018 13:11:21 +0200 Subject: [PATCH] src/apps/common: fix cache.get_state calls --- src/apps/common/request_passphrase.py | 2 +- src/apps/homescreen/__init__.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/apps/common/request_passphrase.py b/src/apps/common/request_passphrase.py index c7d2ccdde..018655ce6 100644 --- a/src/apps/common/request_passphrase.py +++ b/src/apps/common/request_passphrase.py @@ -54,7 +54,7 @@ async def request_passphrase_ack(ctx, on_device): raise wire.ProcessError('Passphrase not provided') passphrase = ack.passphrase - req = PassphraseStateRequest(state=get_state(state=ack.state, passphrase=passphrase)) + req = PassphraseStateRequest(state=get_state(prev_state=ack.state, passphrase=passphrase)) ack = await ctx.call(req, wire_types.PassphraseStateAck, wire_types.Cancel) return passphrase diff --git a/src/apps/homescreen/__init__.py b/src/apps/homescreen/__init__.py index cc93dc63d..e7f8484be 100644 --- a/src/apps/homescreen/__init__.py +++ b/src/apps/homescreen/__init__.py @@ -2,7 +2,6 @@ from trezor import config, utils from trezor.wire import register, protobuf_workflow from trezor.messages import wire_types from trezor.messages.Features import Features -from trezor.messages.Initialize import Initialize from trezor.messages.Success import Success from apps.common import storage, cache @@ -33,7 +32,7 @@ def get_features(): async def handle_Initialize(ctx, msg): - if msg.state is None or msg.state != cache.get_state(bytes(msg.state)): + if msg.state is None or msg.state != cache.get_state(prev_state=bytes(msg.state)): cache.clear(msg.skip_passphrase) return get_features()