From 5e14a5f0593dd760d388dfb5594a347d1b236f84 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 1 Jun 2018 21:30:05 +0200 Subject: [PATCH] device_tests: cashaddr test in sign/verify message --- trezorlib/tests/device_tests/test_msg_signmessage.py | 6 ++++++ trezorlib/tests/device_tests/test_msg_verifymessage.py | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/trezorlib/tests/device_tests/test_msg_signmessage.py b/trezorlib/tests/device_tests/test_msg_signmessage.py index 592f0c15c..b2bdc4eb7 100644 --- a/trezorlib/tests/device_tests/test_msg_signmessage.py +++ b/trezorlib/tests/device_tests/test_msg_signmessage.py @@ -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) diff --git a/trezorlib/tests/device_tests/test_msg_verifymessage.py b/trezorlib/tests/device_tests/test_msg_verifymessage.py index 7c64670b0..eb388a581 100644 --- a/trezorlib/tests/device_tests/test_msg_verifymessage.py +++ b/trezorlib/tests/device_tests/test_msg_verifymessage.py @@ -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()