mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-18 10:32:02 +00:00
homescreen: return correct coins in Features
This commit is contained in:
parent
4c056d8aaa
commit
2e4c63f836
@ -2,7 +2,7 @@ from trezor.messages.CoinType import CoinType
|
|||||||
|
|
||||||
# the following list is generated using tools/coins-gen.py
|
# the following list is generated using tools/coins-gen.py
|
||||||
# do not edit manually!
|
# do not edit manually!
|
||||||
_coins = [
|
COINS = [
|
||||||
CoinType(
|
CoinType(
|
||||||
coin_name='Bitcoin',
|
coin_name='Bitcoin',
|
||||||
coin_shortcut='BTC',
|
coin_shortcut='BTC',
|
||||||
@ -87,21 +87,21 @@ _coins = [
|
|||||||
|
|
||||||
|
|
||||||
def by_shortcut(shortcut):
|
def by_shortcut(shortcut):
|
||||||
for c in _coins:
|
for c in COINS:
|
||||||
if c.coin_shortcut == shortcut:
|
if c.coin_shortcut == shortcut:
|
||||||
return c
|
return c
|
||||||
raise Exception('Unknown coin shortcut "%s"' % shortcut)
|
raise Exception('Unknown coin shortcut "%s"' % shortcut)
|
||||||
|
|
||||||
|
|
||||||
def by_name(name):
|
def by_name(name):
|
||||||
for c in _coins:
|
for c in COINS:
|
||||||
if c.coin_name == name:
|
if c.coin_name == name:
|
||||||
return c
|
return c
|
||||||
raise Exception('Unknown coin name "%s"' % name)
|
raise Exception('Unknown coin name "%s"' % name)
|
||||||
|
|
||||||
|
|
||||||
def by_address_type(version):
|
def by_address_type(version):
|
||||||
for c in _coins:
|
for c in COINS:
|
||||||
if c.address_type == version:
|
if c.address_type == version:
|
||||||
return c
|
return c
|
||||||
raise Exception('Unknown coin address type %d' % version)
|
raise Exception('Unknown coin address type %d' % version)
|
||||||
|
@ -4,7 +4,7 @@ from trezor.messages.wire_types import Initialize, GetFeatures
|
|||||||
|
|
||||||
|
|
||||||
async def respond(_, session_id):
|
async def respond(_, session_id):
|
||||||
from ..common import storage
|
from ..common import storage, coins
|
||||||
from trezor.messages.Features import Features
|
from trezor.messages.Features import Features
|
||||||
|
|
||||||
f = Features()
|
f = Features()
|
||||||
@ -14,7 +14,7 @@ async def respond(_, session_id):
|
|||||||
f.major_version = 2
|
f.major_version = 2
|
||||||
f.minor_version = 0
|
f.minor_version = 0
|
||||||
f.patch_version = 0
|
f.patch_version = 0
|
||||||
f.coins = []
|
f.coins = coins.COINS
|
||||||
|
|
||||||
f.device_id = storage.get_device_id()
|
f.device_id = storage.get_device_id()
|
||||||
f.label = storage.get_label()
|
f.label = storage.get_label()
|
||||||
|
Loading…
Reference in New Issue
Block a user