1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-25 08:58:14 +00:00
trezor-firmware/core/tests/test_apps.ripple.address.py
obrusvit e073e619c9 chore(tests): re-run black and isort on core/tests
isort set to skip the first necessary "from common import *" line. A
better solution would be to get rid of the need of this import in the
future.

[no changelog]
2024-02-22 12:10:12 +01:00

34 lines
1.0 KiB
Python

from common import * # isort:skip
if not utils.BITCOIN_ONLY:
from apps.ripple.helpers import address_from_public_key
@unittest.skipUnless(not utils.BITCOIN_ONLY, "altcoin")
class TestRippleAddress(unittest.TestCase):
def test_pubkey_to_address(self):
addr = address_from_public_key(
unhexlify(
"ed9434799226374926eda3b54b1b461b4abf7237962eae18528fea67595397fa32"
)
)
self.assertEqual(addr, "rDTXLQ7ZKZVKz33zJbHjgVShjsBnqMBhmN")
addr = address_from_public_key(
unhexlify(
"03e2b079e9b09ae8916da8f5ee40cbda9578dbe7c820553fe4d5f872eec7b1fdd4"
)
)
self.assertEqual(addr, "rhq549rEtUrJowuxQC2WsHNGLjAjBQdAe8")
addr = address_from_public_key(
unhexlify(
"0282ee731039929e97db6aec242002e9aa62cd62b989136df231f4bb9b8b7c7eb2"
)
)
self.assertEqual(addr, "rKzE5DTyF9G6z7k7j27T2xEas2eMo85kmw")
if __name__ == "__main__":
unittest.main()