From ea675f1e5889350dc63ed76eaf196b0117fbbb76 Mon Sep 17 00:00:00 2001 From: matejcik Date: Fri, 26 Oct 2018 14:09:32 +0200 Subject: [PATCH] client: inline PassphraseState flow into Passphrase flow --- trezorlib/client.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/trezorlib/client.py b/trezorlib/client.py index 9440952e9..9ea1b4bf6 100644 --- a/trezorlib/client.py +++ b/trezorlib/client.py @@ -126,10 +126,11 @@ class BaseClient(object): passphrase = None else: passphrase = self.ui.get_passphrase() - return self.call_raw(proto.PassphraseAck(passphrase=passphrase)) - def callback_PassphraseStateRequest(self, msg): - self.state = msg.state + state_request = self.call_raw(proto.PassphraseAck(passphrase=passphrase)) + if not isinstance(state_request, proto.PassphraseStateRequest): + raise exceptions.TrezorException("Passphrase state missing") + self.state = state_request.state return self.call_raw(proto.PassphraseStateAck()) def callback_ButtonRequest(self, msg):