From 965a6e653a213bd041b6e31904eb5fe0d8312f10 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 24 Oct 2016 18:26:53 +0200 Subject: [PATCH] apps.common.coins: throw exceptions when coin is not found instead of returning None --- src/apps/common/coins.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/apps/common/coins.py b/src/apps/common/coins.py index d56b876d20..6c2b717ee2 100644 --- a/src/apps/common/coins.py +++ b/src/apps/common/coins.py @@ -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)