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

16 lines
405 B
Python
Raw Normal View History

2018-03-09 10:37:06 +00:00
from micropython import const
2018-03-14 13:53:11 +00:00
NEM_NETWORK_MAINNET = const(0x68)
NEM_NETWORK_TESTNET = const(0x98)
NEM_NETWORK_MIJIN = const(0x60)
NEM_CURVE = 'ed25519-keccak'
2018-03-09 10:37:06 +00:00
def nem_validate_network(network):
2018-03-14 13:53:11 +00:00
if network in (NEM_NETWORK_MAINNET, NEM_NETWORK_TESTNET, NEM_NETWORK_MIJIN):
2018-03-09 10:37:06 +00:00
return network
if network is None:
2018-03-14 13:53:11 +00:00
return NEM_NETWORK_MAINNET
2018-03-09 10:37:06 +00:00
raise ValueError('Invalid NEM network')