diff --git a/tests/test_msg_recoverydevice.py b/tests/test_msg_recoverydevice.py index cdc55f61e3..f187140a98 100644 --- a/tests/test_msg_recoverydevice.py +++ b/tests/test_msg_recoverydevice.py @@ -51,7 +51,7 @@ class TestDeviceRecovery(common.TrezorTest): self.assertTrue(self.client.features.pin_protection) self.assertTrue(self.client.features.passphrase_protection) - + # Do passphrase-protected action, PassphraseRequest should be raised resp = self.client.call_raw(proto.Ping(passphrase_protection=True)) self.assertIsInstance(resp, proto.PassphraseRequest) @@ -106,7 +106,7 @@ class TestDeviceRecovery(common.TrezorTest): # Do PIN-protected action, PinRequest should NOT be raised resp = self.client.call_raw(proto.Ping(pin_protection=True)) self.assertIsInstance(resp, proto.Success) - + def test_word_fail(self): ret = self.client.call_raw(proto.RecoveryDevice(word_count=12, passphrase_protection=False, diff --git a/tools/encfs_aes_getpass.py b/tools/encfs_aes_getpass.py index 22ebaecf16..d9ea3782d3 100755 --- a/tools/encfs_aes_getpass.py +++ b/tools/encfs_aes_getpass.py @@ -95,7 +95,7 @@ def main(): data = {'label': label, 'bip32_path': bip32_path, 'password_encrypted_hex': binascii.hexlify(passw_encrypted)} - + json.dump(data, open(passw_file, 'wb')) # Let's load password diff --git a/trezorlib/ckd_public.py b/trezorlib/ckd_public.py index 64787b7e79..bdf1eaac63 100644 --- a/trezorlib/ckd_public.py +++ b/trezorlib/ckd_public.py @@ -17,7 +17,7 @@ def point_to_pubkey(point): x_str = number_to_string(point.x(), order) y_str = number_to_string(point.y(), order) vk = x_str + y_str - return chr((ord(vk[63]) & 1) + 2) + vk[0:32] # To compressed key + return chr((ord(vk[63]) & 1) + 2) + vk[0:32] # To compressed key def sec_to_public_pair(pubkey): """Convert a public key in sec binary format to a public pair.""" @@ -115,7 +115,7 @@ def deserialize(xpub): node.fingerprint = struct.unpack('>I', data[5:9])[0] node.child_num = struct.unpack('>I', data[9:13])[0] node.chain_code = data[13:45] - + key = data[45:-4] if key[0] == '\x00': node.private_key = key[1:] diff --git a/trezorlib/client.py b/trezorlib/client.py index 173bb540bd..6e14ab3b46 100644 --- a/trezorlib/client.py +++ b/trezorlib/client.py @@ -78,7 +78,7 @@ class expect(object): # or raises an exception def __init__(self, *expected): self.expected = expected - + def __call__(self, f): def wrapped_f(*args, **kwargs): ret = f(*args, **kwargs) @@ -220,7 +220,7 @@ class DebugLinkMixin(object): # Always press Yes and provide correct pin self.setup_debuglink(True, True) - + # Do not expect any specific response from device self.expected_responses = None @@ -292,7 +292,7 @@ class DebugLinkMixin(object): resp = super(DebugLinkMixin, self).call_raw(msg) self._check_request(resp) return resp - + def _check_request(self, msg): if self.expected_responses != None: try: @@ -310,7 +310,7 @@ class DebugLinkMixin(object): if not msg.HasField(field.name) or getattr(msg, field.name) != value: raise CallException(types.Failure_Other, "Expected %s, got %s" % (pprint(expected), pprint(msg))) - + def callback_ButtonRequest(self, msg): log("ButtonRequest code: " + get_buttonrequest_value(msg.code)) diff --git a/trezorlib/debuglink.py b/trezorlib/debuglink.py index 9bc1c17faf..374c19a6b9 100644 --- a/trezorlib/debuglink.py +++ b/trezorlib/debuglink.py @@ -19,7 +19,7 @@ class DebugLink(object): def close(self): self.transport.close() - + def _call(self, msg, nowait=False): print "DEBUGLINK SEND", pprint(msg) self.transport.write(msg) @@ -53,7 +53,7 @@ class DebugLink(object): print "Encoded PIN:", pin_encoded return pin_encoded - + def read_layout(self): obj = self._call(proto.DebugLinkGetState()) return obj.layout diff --git a/trezorlib/mapping.py b/trezorlib/mapping.py index f631ed0b5b..c20661d637 100644 --- a/trezorlib/mapping.py +++ b/trezorlib/mapping.py @@ -10,7 +10,7 @@ def build_map(): map_type_to_class[i] = msg_class map_class_to_type[msg_class] = i - + def get_type(msg): return map_class_to_type[msg.__class__] diff --git a/trezorlib/qt/pinmatrix.py b/trezorlib/qt/pinmatrix.py index 070ff03fee..dc96a9d373 100644 --- a/trezorlib/qt/pinmatrix.py +++ b/trezorlib/qt/pinmatrix.py @@ -27,7 +27,7 @@ class PinMatrixWidget(QWidget): ''' def __init__(self, show_strength=True, parent=None): super(PinMatrixWidget, self).__init__(parent) - + self.password = QLineEdit() self.password.setValidator(QRegExpValidator(QRegExp('[1-9]+'), None)) self.password.setEchoMode(QLineEdit.Password)