mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-25 08:58:14 +00:00
apps.common.coins: throw exceptions when coin is not found instead of returning None
This commit is contained in:
parent
2ede564cbd
commit
965a6e653a
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user