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

homescreen: return correct coins in Features

This commit is contained in:
Jan Pochyla 2016-11-11 11:26:38 +01:00
parent 4c056d8aaa
commit 2e4c63f836
2 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@ from trezor.messages.CoinType import CoinType
# the following list is generated using tools/coins-gen.py
# do not edit manually!
_coins = [
COINS = [
CoinType(
coin_name='Bitcoin',
coin_shortcut='BTC',
@ -87,21 +87,21 @@ _coins = [
def by_shortcut(shortcut):
for c in _coins:
for c in COINS:
if c.coin_shortcut == shortcut:
return c
raise Exception('Unknown coin shortcut "%s"' % shortcut)
def by_name(name):
for c in _coins:
for c in COINS:
if c.coin_name == name:
return c
raise Exception('Unknown coin name "%s"' % name)
def by_address_type(version):
for c in _coins:
for c in COINS:
if c.address_type == version:
return c
raise Exception('Unknown coin address type %d' % version)

View File

@ -4,7 +4,7 @@ from trezor.messages.wire_types import Initialize, GetFeatures
async def respond(_, session_id):
from ..common import storage
from ..common import storage, coins
from trezor.messages.Features import Features
f = Features()
@ -14,7 +14,7 @@ async def respond(_, session_id):
f.major_version = 2
f.minor_version = 0
f.patch_version = 0
f.coins = []
f.coins = coins.COINS
f.device_id = storage.get_device_id()
f.label = storage.get_label()