1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-02 20:48:30 +00:00
trezor-firmware/src/apps/nem/helpers.py

15 lines
383 B
Python
Raw Normal View History

2018-03-09 10:37:06 +00:00
from micropython import const
_NEM_NETWORK_MAINNET = const(0x68)
_NEM_NETWORK_TESTNET = const(0x98)
_NEM_NETWORK_MIJIN = const(0x60)
def nem_validate_network(network):
if network in (_NEM_NETWORK_MAINNET, _NEM_NETWORK_TESTNET, _NEM_NETWORK_MIJIN):
return network
if network is None:
return _NEM_NETWORK_MAINNET
raise ValueError('Invalid NEM network')