1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-27 08:38:07 +00:00

fix whitespace

This commit is contained in:
Pavol Rusnak 2016-01-13 00:17:38 +01:00
parent a8a68ca5fc
commit fc1b12d80d
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
7 changed files with 13 additions and 13 deletions

View File

@ -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,

View File

@ -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

View File

@ -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:]

View File

@ -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))

View File

@ -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

View File

@ -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__]

View File

@ -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)