1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-26 00:08:10 +00:00

apps.common.coins: throw exceptions when coin is not found instead of returning None

This commit is contained in:
Pavol Rusnak 2016-10-24 18:26:53 +02:00
parent 2ede564cbd
commit 965a6e653a
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -14,16 +14,16 @@ def by_shortcut(shortcut):
for c in _couns:
if c['coin_shortcut'] == shortcut:
return c
return None
raise Exception('Unknown coin shortcut "%s"' % shortcut)
def by_name(name):
for c in _couns:
if c['coin_name'] == name:
return c
return None
raise Exception('Unknown coin name "%s"' % name)
def by_address_type(version):
for c in _couns:
if c['address_type'] == version:
return c
return None
raise Exception('Unknown coin address type %d' % version)