Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

Commit

Permalink
flake8: fix complaints (for the last time, hopefully)
Browse files Browse the repository at this point in the history
  • Loading branch information
matejcik committed Aug 10, 2018
1 parent 6029a98 commit ca608d0
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ ignore =
E741,
##### E266: too many leading '#' for block comment
E266,
# W503 line break before binary operator
W503,
4 changes: 2 additions & 2 deletions trezorctl
Original file line number Diff line number Diff line change
Expand Up @@ -348,15 +348,15 @@ def load_device(connect, mnemonic, expand, xprv, pin, passphrase_protection, lab
passphrase_protection,
label,
'english'
)
)
if slip0014:
return debuglink.load_device_by_mnemonic(
client,
' '.join(['all'] * 12),
pin,
passphrase_protection,
'SLIP-0014'
)
)


@cli.command(help='Start safe recovery workflow.')
Expand Down
1 change: 1 addition & 0 deletions trezorlib/tests/device_tests/test_msg_lisk_getaddress.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

LISK_PATH = parse_path("m/44h/134h/0h/1h")


@pytest.mark.lisk
@pytest.mark.skip_t1
class TestMsgLiskGetaddress(TrezorTest):
Expand Down
1 change: 1 addition & 0 deletions trezorlib/tests/device_tests/test_msg_lisk_getpublickey.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

LISK_PATH = parse_path("m/44h/134h/0h/0h")


@pytest.mark.lisk
@pytest.mark.skip_t1
class TestMsgLiskGetPublicKey(TrezorTest):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_verify(self):
unhexlify('eb56d7bbb5e8ea9269405f7a8527fe126023d1db2c973cfac6f760b60ae27294'),
unhexlify('7858ae7cd52ea6d4b17e800ca60144423db5560bfd618b663ffbf26ab66758563df45cbffae8463db22dc285dd94309083b8c807776085b97d05374d79867d05'),
'This is an example of a signed message.'
)
)

def test_verify_long(self):
self.setup_mnemonic_nopin_nopassphrase()
Expand Down
20 changes: 10 additions & 10 deletions trezorlib/tests/device_tests/test_msg_verifymessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_message_testnet(self):
'mirio8q3gtv7fhdnmb3TpZ4EuafdzSs7zL',
unhexlify('209e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be80'),
'This is an example of a signed message.'
)
)
assert ret is True

def test_message_verify(self):
Expand All @@ -54,7 +54,7 @@ def test_message_verify(self):
'1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T',
unhexlify('1ba77e01a9e17ba158b962cfef5f13dfed676ffc2b4bada24e58f784458b52b97421470d001d53d5880cf5e10e76f02be3e80bf21e18398cbd41e8c3b4af74c8c2'),
'This is an example of a signed message.'
)
)
assert res is True

# uncompressed pubkey - FAIL - wrong sig
Expand All @@ -64,7 +64,7 @@ def test_message_verify(self):
'1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T',
unhexlify('1ba77e01a9e17ba158b962cfef5f13dfed676ffc2b4bada24e58f784458b52b97421470d001d53d5880cf5e10e76f02be3e80bf21e18398cbd41e8c3b4af74c800'),
'This is an example of a signed message.'
)
)
assert res is False

# uncompressed pubkey - FAIL - wrong msg
Expand All @@ -74,7 +74,7 @@ def test_message_verify(self):
'1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T',
unhexlify('1ba77e01a9e17ba158b962cfef5f13dfed676ffc2b4bada24e58f784458b52b97421470d001d53d5880cf5e10e76f02be3e80bf21e18398cbd41e8c3b4af74c8c2'),
'This is an example of a signed message!'
)
)
assert res is False

# compressed pubkey - OK
Expand All @@ -93,7 +93,7 @@ def test_message_verify(self):
'1C7zdTfnkzmr13HfA2vNm5SJYRK6nEKyq8',
unhexlify('1f44e3e461f7ca9f57c472ce1a28214df1de1dadefb6551a32d1907b80c74d5a1fbfd6daaba12dd8cb06699ce3f6941fbe0f3957b5802d13076181046e741eaa00'),
'This is an example of a signed message.'
)
)
assert res is False

# compressed pubkey - FAIL - wrong msg
Expand All @@ -112,7 +112,7 @@ def test_message_verify(self):
'14LmW5k4ssUrtbAB4255zdqv3b4w1TuX9e',
unhexlify('209e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be80'),
'This is an example of a signed message.'
)
)
assert res is True

# trezor pubkey - FAIL - wrong sig
Expand All @@ -122,7 +122,7 @@ def test_message_verify(self):
'14LmW5k4ssUrtbAB4255zdqv3b4w1TuX9e',
unhexlify('209e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be00'),
'This is an example of a signed message.'
)
)
assert res is False

# trezor pubkey - FAIL - wrong msg
Expand All @@ -132,7 +132,7 @@ def test_message_verify(self):
'14LmW5k4ssUrtbAB4255zdqv3b4w1TuX9e',
unhexlify('209e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be80'),
'This is an example of a signed message!'
)
)
assert res is False

def test_message_verify_bcash(self):
Expand All @@ -143,7 +143,7 @@ def test_message_verify_bcash(self):
'bitcoincash:qqj22md58nm09vpwsw82fyletkxkq36zxyxh322pru',
unhexlify('209e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be80'),
'This is an example of a signed message.'
)
)
assert res is True

def test_verify_bitcoind(self):
Expand All @@ -155,7 +155,7 @@ def test_verify_bitcoind(self):
'1KzXE97kV7DrpxCViCN3HbGbiKhzzPM7TQ',
unhexlify('1cc694f0f23901dfe3603789142f36a3fc582d0d5c0ec7215cf2ccd641e4e37228504f3d4dc3eea28bbdbf5da27c49d4635c097004d9f228750ccd836a8e1460c0'),
u'\u017elu\u0165ou\u010dk\xfd k\u016f\u0148 \xfap\u011bl \u010f\xe1belsk\xe9 \xf3dy'
)
)

assert res is True

Expand Down
8 changes: 4 additions & 4 deletions trezorlib/tests/device_tests/test_msg_verifymessage_segwit.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_message_testnet(self):
'2N4VkePSzKH2sv5YBikLHGvzUYvfPxV6zS9',
unhexlify('249e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be80'),
'This is an example of a signed message.'
)
)
assert ret is True

def test_message_verify(self):
Expand All @@ -54,7 +54,7 @@ def test_message_verify(self):
'3CwYaeWxhpXXiHue3ciQez1DLaTEAXcKa1',
unhexlify('249e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be80'),
'This is an example of a signed message.'
)
)
assert res is True

# trezor pubkey - FAIL - wrong sig
Expand All @@ -64,7 +64,7 @@ def test_message_verify(self):
'3CwYaeWxhpXXiHue3ciQez1DLaTEAXcKa1',
unhexlify('249e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be00'),
'This is an example of a signed message.'
)
)
assert res is False

# trezor pubkey - FAIL - wrong msg
Expand All @@ -74,7 +74,7 @@ def test_message_verify(self):
'3CwYaeWxhpXXiHue3ciQez1DLaTEAXcKa1',
unhexlify('249e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be80'),
'This is an example of a signed message!'
)
)
assert res is False

def test_verify_utf(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_message_testnet(self):
'tb1qyjjkmdpu7metqt5r36jf872a34syws336p3n3p',
unhexlify('289e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be80'),
'This is an example of a signed message.'
)
)
assert ret is True

def test_message_verify(self):
Expand All @@ -54,7 +54,7 @@ def test_message_verify(self):
'bc1qyjjkmdpu7metqt5r36jf872a34syws33s82q2j',
unhexlify('289e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be80'),
'This is an example of a signed message.'
)
)
assert res is True

# trezor pubkey - FAIL - wrong sig
Expand All @@ -64,7 +64,7 @@ def test_message_verify(self):
'bc1qyjjkmdpu7metqt5r36jf872a34syws33s82q2j',
unhexlify('289e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be00'),
'This is an example of a signed message.'
)
)
assert res is False

# trezor pubkey - FAIL - wrong msg
Expand All @@ -74,7 +74,7 @@ def test_message_verify(self):
'bc1qyjjkmdpu7metqt5r36jf872a34syws33s82q2j',
unhexlify('289e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be80'),
'This is an example of a signed message!'
)
)
assert res is False

def test_verify_utf(self):
Expand Down

0 comments on commit ca608d0

Please sign in to comment.