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

device_tests: cashaddr test in sign/verify message

This commit is contained in:
Pavol Rusnak 2018-06-01 21:30:05 +02:00
parent edfc857013
commit 5e14a5f059
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 16 additions and 0 deletions

View File

@ -34,6 +34,12 @@ class TestMsgSignmessage(TrezorTest):
assert sig.address == 'mirio8q3gtv7fhdnmb3TpZ4EuafdzSs7zL'
assert hexlify(sig.signature) == b'209e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be80'
def test_sign_bch(self):
self.setup_mnemonic_nopin_nopassphrase()
sig = self.client.sign_message('Bcash', [0], "This is an example of a signed message.")
assert sig.address == 'bitcoincash:qqj22md58nm09vpwsw82fyletkxkq36zxyxh322pru'
assert hexlify(sig.signature) == b'209e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be80'
def test_sign_long(self):
self.setup_mnemonic_nopin_nopassphrase()
sig = self.client.sign_message('Bitcoin', [0], "VeryLongMessage!" * 64)

View File

@ -124,6 +124,16 @@ class TestMsgVerifymessage(TrezorTest):
)
assert res is False
def test_message_verify_bcash(self):
self.setup_mnemonic_nopin_nopassphrase()
res = self.client.verify_message(
'Bcash',
'bitcoincash:qqj22md58nm09vpwsw82fyletkxkq36zxyxh322pru',
unhexlify('209e23edf0e4e47ff1dec27f32cd78c50e74ef018ee8a6adf35ae17c7a9b0dd96f48b493fd7dbab03efb6f439c6383c9523b3bbc5f1a7d158a6af90ab154e9be80'),
'This is an example of a signed message.'
)
assert res is True
def test_verify_bitcoind(self):
self.setup_mnemonic_nopin_nopassphrase()