mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-21 05:48:23 +00:00
tests: bytes are not necessary in unhexlify
This commit is contained in:
parent
9917d9ebfc
commit
11bfacc9b3
@ -25,8 +25,8 @@ class TestMsgEthereumVerifymessage(common.TrezorTest):
|
|||||||
def test_verify(self):
|
def test_verify(self):
|
||||||
self.setup_mnemonic_nopin_nopassphrase()
|
self.setup_mnemonic_nopin_nopassphrase()
|
||||||
res = self.client.ethereum_verify_message(
|
res = self.client.ethereum_verify_message(
|
||||||
binascii.unhexlify(b'cb3864960e8db1a751212c580af27ee8867d688f'),
|
binascii.unhexlify('cb3864960e8db1a751212c580af27ee8867d688f'),
|
||||||
binascii.unhexlify(b'95b64a7b3aa492f0cc1668a24097004562cc2b4f0e755e3c0d60dd791b9f9e285f95b618258ff97036b8419d0a0dd1af3751c625b4d248ee6deff84eba21b8ee1c'),
|
binascii.unhexlify('95b64a7b3aa492f0cc1668a24097004562cc2b4f0e755e3c0d60dd791b9f9e285f95b618258ff97036b8419d0a0dd1af3751c625b4d248ee6deff84eba21b8ee1c'),
|
||||||
'This is an example of a signed message.'
|
'This is an example of a signed message.'
|
||||||
)
|
)
|
||||||
self.assertTrue(res)
|
self.assertTrue(res)
|
||||||
@ -34,8 +34,8 @@ class TestMsgEthereumVerifymessage(common.TrezorTest):
|
|||||||
def test_verify_long(self):
|
def test_verify_long(self):
|
||||||
self.setup_mnemonic_nopin_nopassphrase()
|
self.setup_mnemonic_nopin_nopassphrase()
|
||||||
ret = self.client.ethereum_verify_message(
|
ret = self.client.ethereum_verify_message(
|
||||||
binascii.unhexlify(b'cb3864960e8db1a751212c580af27ee8867d688f'),
|
binascii.unhexlify('cb3864960e8db1a751212c580af27ee8867d688f'),
|
||||||
binascii.unhexlify(b'70d03c8447b64489e80ae44ce4f1a543e8eb5dd9e9a19c4743ce95fbd9b8234b2d2a16db87cee857f5b474107ad2c0c0c86118f8a33d5df3d98b766be92d71331b'),
|
binascii.unhexlify('70d03c8447b64489e80ae44ce4f1a543e8eb5dd9e9a19c4743ce95fbd9b8234b2d2a16db87cee857f5b474107ad2c0c0c86118f8a33d5df3d98b766be92d71331b'),
|
||||||
'VeryLongMessage!' * 64
|
'VeryLongMessage!' * 64
|
||||||
)
|
)
|
||||||
self.assertTrue(ret)
|
self.assertTrue(ret)
|
||||||
|
@ -26,16 +26,16 @@ from trezorlib.client import CallException
|
|||||||
from trezorlib.tx_api import TxApiTestnet
|
from trezorlib.tx_api import TxApiTestnet
|
||||||
|
|
||||||
|
|
||||||
TXHASH_157041 = binascii.unhexlify(b'1570416eb4302cf52979afd5e6909e37d8fdd874301f7cc87e547e509cb1caa6')
|
TXHASH_157041 = binascii.unhexlify('1570416eb4302cf52979afd5e6909e37d8fdd874301f7cc87e547e509cb1caa6')
|
||||||
TXHASH_39a29e = binascii.unhexlify(b'39a29e954977662ab3879c66fb251ef753e0912223a83d1dcb009111d28265e5')
|
TXHASH_39a29e = binascii.unhexlify('39a29e954977662ab3879c66fb251ef753e0912223a83d1dcb009111d28265e5')
|
||||||
TXHASH_4a7b7e = binascii.unhexlify(b'4a7b7e0403ae5607e473949cfa03f09f2cd8b0f404bf99ce10b7303d86280bf7')
|
TXHASH_4a7b7e = binascii.unhexlify('4a7b7e0403ae5607e473949cfa03f09f2cd8b0f404bf99ce10b7303d86280bf7')
|
||||||
TXHASH_54aa56 = binascii.unhexlify(b'54aa5680dea781f45ebb536e53dffc526d68c0eb5c00547e323b2c32382dfba3')
|
TXHASH_54aa56 = binascii.unhexlify('54aa5680dea781f45ebb536e53dffc526d68c0eb5c00547e323b2c32382dfba3')
|
||||||
TXHASH_58497a = binascii.unhexlify(b'58497a7757224d1ff1941488d23087071103e5bf855f4c1c44e5c8d9d82ca46e')
|
TXHASH_58497a = binascii.unhexlify('58497a7757224d1ff1941488d23087071103e5bf855f4c1c44e5c8d9d82ca46e')
|
||||||
TXHASH_6f90f3 = binascii.unhexlify(b'6f90f3c7cbec2258b0971056ef3fe34128dbde30daa9c0639a898f9977299d54')
|
TXHASH_6f90f3 = binascii.unhexlify('6f90f3c7cbec2258b0971056ef3fe34128dbde30daa9c0639a898f9977299d54')
|
||||||
TXHASH_c63e24 = binascii.unhexlify(b'c63e24ed820c5851b60c54613fbc4bcb37df6cd49b4c96143e99580a472f79fb')
|
TXHASH_c63e24 = binascii.unhexlify('c63e24ed820c5851b60c54613fbc4bcb37df6cd49b4c96143e99580a472f79fb')
|
||||||
TXHASH_c6be22 = binascii.unhexlify(b'c6be22d34946593bcad1d2b013e12f74159e69574ffea21581dad115572e031c')
|
TXHASH_c6be22 = binascii.unhexlify('c6be22d34946593bcad1d2b013e12f74159e69574ffea21581dad115572e031c')
|
||||||
TXHASH_d5f65e = binascii.unhexlify(b'd5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882')
|
TXHASH_d5f65e = binascii.unhexlify('d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882')
|
||||||
TXHASH_d6da21 = binascii.unhexlify(b'd6da21677d7cca5f42fbc7631d062c9ae918a0254f7c6c22de8e8cb7fd5b8236')
|
TXHASH_d6da21 = binascii.unhexlify('d6da21677d7cca5f42fbc7631d062c9ae918a0254f7c6c22de8e8cb7fd5b8236')
|
||||||
TXHASH_d2dcda = binascii.unhexlify('d2dcdaf547ea7f57a713c607f15e883ddc4a98167ee2c43ed953c53cb5153e24')
|
TXHASH_d2dcda = binascii.unhexlify('d2dcdaf547ea7f57a713c607f15e883ddc4a98167ee2c43ed953c53cb5153e24')
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ class TestMsgSigntx(common.TrezorTest):
|
|||||||
inp1 = proto_types.TxInputType(
|
inp1 = proto_types.TxInputType(
|
||||||
address_n=[2147483692, 2147483649, 2147483648, 0, 0], # tmQoJ3PTXgQLaRRZZYT6xk8XtjRbr2kCqwu
|
address_n=[2147483692, 2147483649, 2147483648, 0, 0], # tmQoJ3PTXgQLaRRZZYT6xk8XtjRbr2kCqwu
|
||||||
# amount=123456700,
|
# amount=123456700,
|
||||||
prev_hash=binascii.unhexlify(b'93373e63cc626c4a7d049ad775d6511bb5eba985f142db660c9b9f955c722f5c'),
|
prev_hash=binascii.unhexlify('93373e63cc626c4a7d049ad775d6511bb5eba985f142db660c9b9f955c722f5c'),
|
||||||
prev_index=0,
|
prev_index=0,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -50,12 +50,12 @@ class TestMsgSigntx(common.TrezorTest):
|
|||||||
self.client.set_tx_api(TxApiZcashTestnet)
|
self.client.set_tx_api(TxApiZcashTestnet)
|
||||||
self.client.set_expected_responses([
|
self.client.set_expected_responses([
|
||||||
proto.TxRequest(request_type=proto_types.TXINPUT, details=proto_types.TxRequestDetailsType(request_index=0)),
|
proto.TxRequest(request_type=proto_types.TXINPUT, details=proto_types.TxRequestDetailsType(request_index=0)),
|
||||||
proto.TxRequest(request_type=proto_types.TXMETA, details=proto_types.TxRequestDetailsType(tx_hash=binascii.unhexlify(b"93373e63cc626c4a7d049ad775d6511bb5eba985f142db660c9b9f955c722f5c"))),
|
proto.TxRequest(request_type=proto_types.TXMETA, details=proto_types.TxRequestDetailsType(tx_hash=binascii.unhexlify("93373e63cc626c4a7d049ad775d6511bb5eba985f142db660c9b9f955c722f5c"))),
|
||||||
proto.TxRequest(request_type=proto_types.TXOUTPUT, details=proto_types.TxRequestDetailsType(request_index=0, tx_hash=binascii.unhexlify(b"93373e63cc626c4a7d049ad775d6511bb5eba985f142db660c9b9f955c722f5c"))),
|
proto.TxRequest(request_type=proto_types.TXOUTPUT, details=proto_types.TxRequestDetailsType(request_index=0, tx_hash=binascii.unhexlify("93373e63cc626c4a7d049ad775d6511bb5eba985f142db660c9b9f955c722f5c"))),
|
||||||
proto.TxRequest(request_type=proto_types.TXEXTRADATA, details=proto_types.TxRequestDetailsType(tx_hash=binascii.unhexlify(b"93373e63cc626c4a7d049ad775d6511bb5eba985f142db660c9b9f955c722f5c"), extra_data_offset=0, extra_data_len=1024)),
|
proto.TxRequest(request_type=proto_types.TXEXTRADATA, details=proto_types.TxRequestDetailsType(tx_hash=binascii.unhexlify("93373e63cc626c4a7d049ad775d6511bb5eba985f142db660c9b9f955c722f5c"), extra_data_offset=0, extra_data_len=1024)),
|
||||||
proto.TxRequest(request_type=proto_types.TXEXTRADATA, details=proto_types.TxRequestDetailsType(tx_hash=binascii.unhexlify(b"93373e63cc626c4a7d049ad775d6511bb5eba985f142db660c9b9f955c722f5c"), extra_data_offset=1024, extra_data_len=1024)),
|
proto.TxRequest(request_type=proto_types.TXEXTRADATA, details=proto_types.TxRequestDetailsType(tx_hash=binascii.unhexlify("93373e63cc626c4a7d049ad775d6511bb5eba985f142db660c9b9f955c722f5c"), extra_data_offset=1024, extra_data_len=1024)),
|
||||||
proto.TxRequest(request_type=proto_types.TXEXTRADATA, details=proto_types.TxRequestDetailsType(tx_hash=binascii.unhexlify(b"93373e63cc626c4a7d049ad775d6511bb5eba985f142db660c9b9f955c722f5c"), extra_data_offset=2048, extra_data_len=1024)),
|
proto.TxRequest(request_type=proto_types.TXEXTRADATA, details=proto_types.TxRequestDetailsType(tx_hash=binascii.unhexlify("93373e63cc626c4a7d049ad775d6511bb5eba985f142db660c9b9f955c722f5c"), extra_data_offset=2048, extra_data_len=1024)),
|
||||||
proto.TxRequest(request_type=proto_types.TXEXTRADATA, details=proto_types.TxRequestDetailsType(tx_hash=binascii.unhexlify(b"93373e63cc626c4a7d049ad775d6511bb5eba985f142db660c9b9f955c722f5c"), extra_data_offset=3072, extra_data_len=629)),
|
proto.TxRequest(request_type=proto_types.TXEXTRADATA, details=proto_types.TxRequestDetailsType(tx_hash=binascii.unhexlify("93373e63cc626c4a7d049ad775d6511bb5eba985f142db660c9b9f955c722f5c"), extra_data_offset=3072, extra_data_len=629)),
|
||||||
proto.TxRequest(request_type=proto_types.TXOUTPUT, details=proto_types.TxRequestDetailsType(request_index=0)),
|
proto.TxRequest(request_type=proto_types.TXOUTPUT, details=proto_types.TxRequestDetailsType(request_index=0)),
|
||||||
proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput),
|
proto.ButtonRequest(code=proto_types.ButtonRequest_ConfirmOutput),
|
||||||
proto.ButtonRequest(code=proto_types.ButtonRequest_SignTx),
|
proto.ButtonRequest(code=proto_types.ButtonRequest_SignTx),
|
||||||
|
@ -25,7 +25,7 @@ import trezorlib.types_pb2 as proto_types
|
|||||||
from trezorlib.client import CallException
|
from trezorlib.client import CallException
|
||||||
|
|
||||||
|
|
||||||
TXHASH_d5f65e = binascii.unhexlify(b'd5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882')
|
TXHASH_d5f65e = binascii.unhexlify('d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882')
|
||||||
|
|
||||||
|
|
||||||
class TestOpReturn(common.TrezorTest):
|
class TestOpReturn(common.TrezorTest):
|
||||||
|
@ -24,7 +24,7 @@ from trezorlib import messages_pb2 as proto
|
|||||||
from trezorlib import types_pb2 as proto_types
|
from trezorlib import types_pb2 as proto_types
|
||||||
|
|
||||||
|
|
||||||
TXHASH_d5f65e = binascii.unhexlify(b'd5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882')
|
TXHASH_d5f65e = binascii.unhexlify('d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882')
|
||||||
|
|
||||||
|
|
||||||
class TestProtectionLevels(common.TrezorTest):
|
class TestProtectionLevels(common.TrezorTest):
|
||||||
@ -155,7 +155,7 @@ class TestProtectionLevels(common.TrezorTest):
|
|||||||
self.client.verify_message(
|
self.client.verify_message(
|
||||||
'Bitcoin',
|
'Bitcoin',
|
||||||
'14LmW5k4ssUrtbAB4255zdqv3b4w1TuX9e',
|
'14LmW5k4ssUrtbAB4255zdqv3b4w1TuX9e',
|
||||||
binascii.unhexlify(b'209e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be80'),
|
binascii.unhexlify('209e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be80'),
|
||||||
'This is an example of a signed message.')
|
'This is an example of a signed message.')
|
||||||
|
|
||||||
def test_estimate_txsize(self):
|
def test_estimate_txsize(self):
|
||||||
|
@ -33,7 +33,7 @@ else:
|
|||||||
return data[index]
|
return data[index]
|
||||||
|
|
||||||
|
|
||||||
TXHASH_d5f65e = binascii.unhexlify(b'd5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882')
|
TXHASH_d5f65e = binascii.unhexlify('d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882')
|
||||||
|
|
||||||
|
|
||||||
# address_n = [177] < 68
|
# address_n = [177] < 68
|
||||||
|
Loading…
Reference in New Issue
Block a user