1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-25 08:58:14 +00:00

common: remove coins.by_address_type because there are conflicts

Unfortunetly, there are coins with the same `address type` field. For
example ZClassic Coin uses the same one as Zcash.
This commit is contained in:
Tomas Susanka 2019-02-18 16:59:42 +01:00
parent 4709af146b
commit 7e3673ad26
2 changed files with 1 additions and 12 deletions

View File

@ -15,13 +15,6 @@ def by_name(name):
raise ValueError('Unknown coin name "%s"' % name)
def by_address_type(address_type):
for c in COINS:
if c.address_type == address_type:
return c
raise ValueError("Unknown coin address type %d" % address_type)
def by_slip44(slip44):
for c in COINS:
if c.slip44 == slip44:

View File

@ -17,18 +17,14 @@ class TestCoins(unittest.TestCase):
for s, n, a in ref:
c1 = coins.by_shortcut(s)
c2 = coins.by_name(n)
c3 = coins.by_address_type(a)
self.assertEqual(c1, c2)
self.assertEqual(c1, c3)
self.assertEqual(c2, c3)
self.assertEqual(c1.address_type, a)
def test_failure(self):
with self.assertRaises(ValueError):
coins.by_shortcut('XXX')
with self.assertRaises(ValueError):
coins.by_name('XXXXX')
with self.assertRaises(ValueError):
coins.by_address_type(1234)
if __name__ == '__main__':