mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-18 13:38:12 +00:00
src/apps/common: fix cache.get_state calls
This commit is contained in:
parent
56e15625d6
commit
f6be3899eb
@ -54,7 +54,7 @@ async def request_passphrase_ack(ctx, on_device):
|
|||||||
raise wire.ProcessError('Passphrase not provided')
|
raise wire.ProcessError('Passphrase not provided')
|
||||||
passphrase = ack.passphrase
|
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)
|
ack = await ctx.call(req, wire_types.PassphraseStateAck, wire_types.Cancel)
|
||||||
|
|
||||||
return passphrase
|
return passphrase
|
||||||
|
@ -2,7 +2,6 @@ from trezor import config, utils
|
|||||||
from trezor.wire import register, protobuf_workflow
|
from trezor.wire import register, protobuf_workflow
|
||||||
from trezor.messages import wire_types
|
from trezor.messages import wire_types
|
||||||
from trezor.messages.Features import Features
|
from trezor.messages.Features import Features
|
||||||
from trezor.messages.Initialize import Initialize
|
|
||||||
from trezor.messages.Success import Success
|
from trezor.messages.Success import Success
|
||||||
|
|
||||||
from apps.common import storage, cache
|
from apps.common import storage, cache
|
||||||
@ -33,7 +32,7 @@ def get_features():
|
|||||||
|
|
||||||
|
|
||||||
async def handle_Initialize(ctx, msg):
|
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)
|
cache.clear(msg.skip_passphrase)
|
||||||
return get_features()
|
return get_features()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user