1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-13 01:58:08 +00:00
trezor-firmware/core/src/apps/cardano/helpers/protocol_magics.py
2022-03-18 14:32:54 +01:00

16 lines
264 B
Python

MAINNET = 764824073
TESTNET = 1097911063
NAMES = {
MAINNET: "Mainnet",
TESTNET: "Testnet",
}
def is_mainnet(protocol_magic: int) -> bool:
return protocol_magic == MAINNET
def to_ui_string(value: int) -> str:
return NAMES.get(value, "Unknown")