From 117c3c932f51825e08a5c34ab33910502af8cc18 Mon Sep 17 00:00:00 2001 From: David Misiak Date: Tue, 15 Feb 2022 10:59:11 +0100 Subject: [PATCH] fix(cardano): update testnet protocol magic --- core/src/apps/cardano/helpers/protocol_magics.py | 2 +- core/tests/test_apps.cardano.address.py | 6 +++--- python/src/trezorlib/cardano.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/apps/cardano/helpers/protocol_magics.py b/core/src/apps/cardano/helpers/protocol_magics.py index dc05388966..cc5c567e8a 100644 --- a/core/src/apps/cardano/helpers/protocol_magics.py +++ b/core/src/apps/cardano/helpers/protocol_magics.py @@ -1,5 +1,5 @@ MAINNET = 764824073 -TESTNET = 42 +TESTNET = 1097911063 NAMES = { MAINNET: "Mainnet", diff --git a/core/tests/test_apps.cardano.address.py b/core/tests/test_apps.cardano.address.py index 67c94870bc..40d784ce98 100644 --- a/core/tests/test_apps.cardano.address.py +++ b/core/tests/test_apps.cardano.address.py @@ -279,9 +279,9 @@ class TestCardanoAddress(unittest.TestCase): def test_testnet_byron_address(self): addresses = [ - "2657WMsDfac5F3zbgs9BwNWx3dhGAJERkAL93gPa68NJ2i8mbCHm2pLUHWSj8Mfea", - "2657WMsDfac6ezKWszxLFqJjSUgpg9NgxKc1koqi24sVpRaPhiwMaExk4useKn5HA", - "2657WMsDfac7hr1ioJGr6g7r6JRx4r1My8Rj91tcPTeVjJDpfBYKURrPG2zVLx2Sq", + "2cWKMJemoBajmHz9haobccjHnxiynESe2hqtza25GBgHpKAtE8BpvUgd3ixRzrAvMjgfo", + "2cWKMJemoBakg9bfV8iHwNxF4TtoJVUsFMGZPJ2e1xnLLZ12WTcvYbTZg2eeXMBZmkrA1", + "2cWKMJemoBakYYADj3dviYVXQhzHxdDEHdsnkJfSYevd3wZi8eneSzEGRmXNvNDjYdjBw", ] for i, expected in enumerate(addresses): diff --git a/python/src/trezorlib/cardano.py b/python/src/trezorlib/cardano.py index cef8f94248..d49dcfc1e7 100644 --- a/python/src/trezorlib/cardano.py +++ b/python/src/trezorlib/cardano.py @@ -36,7 +36,7 @@ if TYPE_CHECKING: from .client import TrezorClient from .protobuf import MessageType -PROTOCOL_MAGICS = {"mainnet": 764824073, "testnet": 42} +PROTOCOL_MAGICS = {"mainnet": 764824073, "testnet": 1097911063} NETWORK_IDS = {"mainnet": 1, "testnet": 0} REQUIRED_FIELDS_TRANSACTION = ("inputs", "outputs")