1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-03 12:00:59 +00:00

defs/tools: rename "coins" to "bitcoin"

This commit is contained in:
matejcik 2018-08-24 15:42:06 +02:00
parent a903b996c8
commit 467b41efda
85 changed files with 133 additions and 133 deletions

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

1
defs/coins Symbolic link
View File

@ -0,0 +1 @@
bitcoin

View File

@ -1 +0,0 @@
../../../tools/build_coins.py

View File

@ -5,62 +5,62 @@
"erc20:eth:GNT": { "erc20:eth:GNT": {
"coinmarketcap_alias": "golem-network-tokens" "coinmarketcap_alias": "golem-network-tokens"
}, },
"coin:BCH": { "bitcoin:BCH": {
"wallet": { "wallet": {
"Electron Cash": "https://electroncash.org" "Electron Cash": "https://electroncash.org"
} }
}, },
"coin:BTC": { "bitcoin:BTC": {
"wallet": { "wallet": {
"Electrum": "https://electrum.org" "Electrum": "https://electrum.org"
} }
}, },
"coin:BTCP": { "bitcoin:BTCP": {
"wallet": { "wallet": {
"BTCP Electrum": "https://github.com/BTCPrivate/electrum-btcp" "BTCP Electrum": "https://github.com/BTCPrivate/electrum-btcp"
} }
}, },
"coin:BTG": { "bitcoin:BTG": {
"wallet": { "wallet": {
"ElectrumG": "https://github.com/BTCGPU/electrum" "ElectrumG": "https://github.com/BTCGPU/electrum"
} }
}, },
"coin:DASH": { "bitcoin:DASH": {
"wallet": { "wallet": {
"Dash Electrum": "https://electrum.dash.org" "Dash Electrum": "https://electrum.dash.org"
} }
}, },
"coin:FJC": { "bitcoin:FJC": {
"wallet": { "wallet": {
"Electrum-FJC": "http://www.fujicoin.org/downloads.php" "Electrum-FJC": "http://www.fujicoin.org/downloads.php"
} }
}, },
"coin:GRS": { "bitcoin:GRS": {
"wallet": { "wallet": {
"Electrum-GRS": "https://www.groestlcoin.org/groestlcoin-electrum-wallet/" "Electrum-GRS": "https://www.groestlcoin.org/groestlcoin-electrum-wallet/"
} }
}, },
"coin:LTC": { "bitcoin:LTC": {
"wallet": { "wallet": {
"Electrum-LTC": "https://electrum-ltc.org" "Electrum-LTC": "https://electrum-ltc.org"
} }
}, },
"coin:MONA": { "bitcoin:MONA": {
"wallet": { "wallet": {
"Electrum-MONA": "https://electrum-mona.org" "Electrum-MONA": "https://electrum-mona.org"
} }
}, },
"coin:NMC": { "bitcoin:NMC": {
"wallet": { "wallet": {
"Electrum-NMC": "https://github.com/namecoin/electrum-nmc" "Electrum-NMC": "https://github.com/namecoin/electrum-nmc"
} }
}, },
"coin:VIA": { "bitcoin:VIA": {
"wallet": { "wallet": {
"Vialectrum": "https://vialectrum.org" "Vialectrum": "https://vialectrum.org"
} }
}, },
"coin:XZC": { "bitcoin:XZC": {
"wallet": { "wallet": {
"Electrum-XZC": "https://github.com/zcoinofficial/electrum-xzc", "Electrum-XZC": "https://github.com/zcoinofficial/electrum-xzc",
"Znode Tool": "https://github.com/yura-pakhuchiy/znode-tool" "Znode Tool": "https://github.com/yura-pakhuchiy/znode-tool"

View File

@ -1,55 +1,55 @@
{ {
"connect": { "connect": {
"supported": { "supported": {
"coin:BCH": true, "bitcoin:BCH": true,
"coin:BTC": true, "bitcoin:BTC": true,
"coin:BTG": true, "bitcoin:BTG": true,
"coin:DASH": true, "bitcoin:DASH": true,
"coin:DOGE": true, "bitcoin:DOGE": true,
"coin:LTC": true, "bitcoin:LTC": true,
"coin:TEST": true, "bitcoin:TEST": true,
"coin:VTC": true, "bitcoin:VTC": true,
"coin:ZEC": true "bitcoin:ZEC": true
}, },
"unsupported": {} "unsupported": {}
}, },
"trezor1": { "trezor1": {
"supported": { "supported": {
"coin:BCH": "1.6.2", "bitcoin:BCH": "1.6.2",
"coin:BTC": "1.5.2", "bitcoin:BTC": "1.5.2",
"coin:BTCP": "1.6.2", "bitcoin:BTCP": "1.6.2",
"coin:BTG": "1.6.2", "bitcoin:BTG": "1.6.2",
"coin:DASH": "1.5.2", "bitcoin:DASH": "1.5.2",
"coin:DCR": "1.6.2", "bitcoin:DCR": "1.6.2",
"coin:DGB": "1.6.0", "bitcoin:DGB": "1.6.0",
"coin:DNR": "soon", "bitcoin:DNR": "soon",
"coin:DOGE": "1.5.2", "bitcoin:DOGE": "1.5.2",
"coin:FJC": "1.6.1", "bitcoin:FJC": "1.6.1",
"coin:FLASH": "soon", "bitcoin:FLASH": "soon",
"coin:FTC": "soon", "bitcoin:FTC": "soon",
"coin:GRS": "1.6.2", "bitcoin:GRS": "1.6.2",
"coin:KOTO": "soon", "bitcoin:KOTO": "soon",
"coin:LTC": "1.5.2", "bitcoin:LTC": "1.5.2",
"coin:MONA": "1.6.0", "bitcoin:MONA": "1.6.0",
"coin:MUE": "soon", "bitcoin:MUE": "soon",
"coin:NMC": "1.5.2", "bitcoin:NMC": "1.5.2",
"coin:PTC": "soon", "bitcoin:PTC": "soon",
"coin:SMART": "soon", "bitcoin:SMART": "soon",
"coin:TAZ": "1.6.2", "bitcoin:TAZ": "1.6.2",
"coin:TBCH": "1.6.2", "bitcoin:TBCH": "1.6.2",
"coin:TBTG": "soon", "bitcoin:TBTG": "soon",
"coin:TDCR": "1.6.2", "bitcoin:TDCR": "1.6.2",
"coin:TEST": "1.5.2", "bitcoin:TEST": "1.5.2",
"coin:TLTC": "1.6.2", "bitcoin:TLTC": "1.6.2",
"coin:VIA": "1.6.2", "bitcoin:VIA": "1.6.2",
"coin:VTC": "1.6.1", "bitcoin:VTC": "1.6.1",
"coin:XMY": "soon", "bitcoin:XMY": "soon",
"coin:XZC": "1.6.2", "bitcoin:XZC": "1.6.2",
"coin:ZEC": "1.6.2", "bitcoin:ZEC": "1.6.2",
"coin:tDASH": "1.6.2", "bitcoin:tDASH": "1.6.2",
"coin:tGRS": "1.6.2", "bitcoin:tGRS": "1.6.2",
"coin:tSMART": "soon", "bitcoin:tSMART": "soon",
"coin:tXZC": "1.6.2", "bitcoin:tXZC": "1.6.2",
"erc20:ella:MINING": "1.6.2", "erc20:ella:MINING": "1.6.2",
"erc20:etc:BEC": "1.6.2", "erc20:etc:BEC": "1.6.2",
"erc20:eth:$FFC": "1.6.2", "erc20:eth:$FFC": "1.6.2",
@ -707,10 +707,10 @@
"nem:XEM": "1.6.2" "nem:XEM": "1.6.2"
}, },
"unsupported": { "unsupported": {
"coin:BTX": "address_type collides with Bitcoin", "bitcoin:BTX": "address_type collides with Bitcoin",
"coin:CRW": "address_type collides with Bitcoin", "bitcoin:CRW": "address_type collides with Bitcoin",
"coin:TRC": "address_type collides with Bitcoin", "bitcoin:TRC": "address_type collides with Bitcoin",
"coin:ZEN": "not implemented on T1", "bitcoin:ZEN": "not implemented on T1",
"erc20:etc:PLAY": "(AUTO) duplicate key", "erc20:etc:PLAY": "(AUTO) duplicate key",
"erc20:eth:ATH": "(AUTO) duplicate key", "erc20:eth:ATH": "(AUTO) duplicate key",
"erc20:eth:ATH (AIgatha Token)": "(AUTO) duplicate key", "erc20:eth:ATH (AIgatha Token)": "(AUTO) duplicate key",
@ -825,40 +825,40 @@
}, },
"trezor2": { "trezor2": {
"supported": { "supported": {
"coin:BCH": "2.0.7", "bitcoin:BCH": "2.0.7",
"coin:BTC": "2.0.5", "bitcoin:BTC": "2.0.5",
"coin:BTCP": "2.0.7", "bitcoin:BTCP": "2.0.7",
"coin:BTG": "2.0.7", "bitcoin:BTG": "2.0.7",
"coin:DASH": "2.0.5", "bitcoin:DASH": "2.0.5",
"coin:DGB": "2.0.5", "bitcoin:DGB": "2.0.5",
"coin:DNR": "soon", "bitcoin:DNR": "soon",
"coin:DOGE": "2.0.5", "bitcoin:DOGE": "2.0.5",
"coin:FJC": "2.0.5", "bitcoin:FJC": "2.0.5",
"coin:FLASH": "soon", "bitcoin:FLASH": "soon",
"coin:FTC": "soon", "bitcoin:FTC": "soon",
"coin:GRS": "2.0.8", "bitcoin:GRS": "2.0.8",
"coin:KOTO": "soon", "bitcoin:KOTO": "soon",
"coin:LTC": "2.0.5", "bitcoin:LTC": "2.0.5",
"coin:MONA": "2.0.5", "bitcoin:MONA": "2.0.5",
"coin:MUE": "soon", "bitcoin:MUE": "soon",
"coin:NMC": "2.0.5", "bitcoin:NMC": "2.0.5",
"coin:PTC": "soon", "bitcoin:PTC": "soon",
"coin:SMART": "soon", "bitcoin:SMART": "soon",
"coin:TAZ": "2.0.7", "bitcoin:TAZ": "2.0.7",
"coin:TBCH": "2.0.7", "bitcoin:TBCH": "2.0.7",
"coin:TBTG": "soon", "bitcoin:TBTG": "soon",
"coin:TEST": "2.0.5", "bitcoin:TEST": "2.0.5",
"coin:TLTC": "2.0.7", "bitcoin:TLTC": "2.0.7",
"coin:VIA": "2.0.7", "bitcoin:VIA": "2.0.7",
"coin:VTC": "2.0.5", "bitcoin:VTC": "2.0.5",
"coin:XMY": "soon", "bitcoin:XMY": "soon",
"coin:XZC": "2.0.7", "bitcoin:XZC": "2.0.7",
"coin:ZEC": "2.0.7", "bitcoin:ZEC": "2.0.7",
"coin:ZEN": "2.0.8", "bitcoin:ZEN": "2.0.8",
"coin:tDASH": "soon", "bitcoin:tDASH": "soon",
"coin:tGRS": "2.0.8", "bitcoin:tGRS": "2.0.8",
"coin:tSMART": "soon", "bitcoin:tSMART": "soon",
"coin:tXZC": "2.0.7", "bitcoin:tXZC": "2.0.7",
"erc20:ella:MINING": "2.0.7", "erc20:ella:MINING": "2.0.7",
"erc20:etc:BEC": "2.0.7", "erc20:etc:BEC": "2.0.7",
"erc20:eth:$FFC": "2.0.7", "erc20:eth:$FFC": "2.0.7",
@ -1521,11 +1521,11 @@
"nem:XEM": "2.0.7" "nem:XEM": "2.0.7"
}, },
"unsupported": { "unsupported": {
"coin:BTX": "address_type collides with Bitcoin", "bitcoin:BTX": "address_type collides with Bitcoin",
"coin:CRW": "address_type collides with Bitcoin", "bitcoin:CRW": "address_type collides with Bitcoin",
"coin:DCR": "not implemented on Trezor T", "bitcoin:DCR": "not implemented on Trezor T",
"coin:TDCR": "not implemented on Trezor T", "bitcoin:TDCR": "not implemented on Trezor T",
"coin:TRC": "address_type collides with Bitcoin", "bitcoin:TRC": "address_type collides with Bitcoin",
"erc20:etc:PLAY": "(AUTO) duplicate key", "erc20:etc:PLAY": "(AUTO) duplicate key",
"erc20:eth:ATH": "(AUTO) duplicate key", "erc20:eth:ATH": "(AUTO) duplicate key",
"erc20:eth:ATH (AIgatha Token)": "(AUTO) duplicate key", "erc20:eth:ATH (AIgatha Token)": "(AUTO) duplicate key",
@ -1635,27 +1635,27 @@
}, },
"webwallet": { "webwallet": {
"supported": { "supported": {
"coin:BCH": true, "bitcoin:BCH": true,
"coin:BTC": true, "bitcoin:BTC": true,
"coin:BTCP": true, "bitcoin:BTCP": true,
"coin:BTG": true, "bitcoin:BTG": true,
"coin:DASH": true, "bitcoin:DASH": true,
"coin:DCR": true, "bitcoin:DCR": true,
"coin:DGB": true, "bitcoin:DGB": true,
"coin:DOGE": true, "bitcoin:DOGE": true,
"coin:FJC": true, "bitcoin:FJC": true,
"coin:GRS": true, "bitcoin:GRS": true,
"coin:LTC": true, "bitcoin:LTC": true,
"coin:MONA": true, "bitcoin:MONA": true,
"coin:TAZ": true, "bitcoin:TAZ": true,
"coin:TDCR": true, "bitcoin:TDCR": true,
"coin:TEST": true, "bitcoin:TEST": true,
"coin:TLTC": true, "bitcoin:TLTC": true,
"coin:VIA": true, "bitcoin:VIA": true,
"coin:VTC": true, "bitcoin:VTC": true,
"coin:XZC": true, "bitcoin:XZC": true,
"coin:ZEC": true, "bitcoin:ZEC": true,
"coin:tGRS": true "bitcoin:tGRS": true
}, },
"unsupported": {} "unsupported": {}
} }

View File

@ -37,13 +37,13 @@ class CoinsInfo(dict):
"""Collection of information about all known kinds of coins. """Collection of information about all known kinds of coins.
It contains the following lists: It contains the following lists:
`coins` for btc-like coins, `bitcoin` for btc-like coins,
`eth` for ethereum networks, `eth` for ethereum networks,
`erc20` for ERC20 tokens, `erc20` for ERC20 tokens,
`nem` for NEM mosaics, `nem` for NEM mosaics,
`misc` for other networks. `misc` for other networks.
Accessible as a dict or by attribute: `info["coins"] == info.coins` Accessible as a dict or by attribute: `info["misc"] == info.misc`
""" """
def as_list(self): def as_list(self):
@ -196,7 +196,7 @@ def _load_btc_coins():
coin.update( coin.update(
name=coin["coin_name"], name=coin["coin_name"],
shortcut=coin["coin_shortcut"], shortcut=coin["coin_shortcut"],
key="coin:{}".format(coin["coin_shortcut"]), key="bitcoin:{}".format(coin["coin_shortcut"]),
icon=filename.replace(".json", ".png"), icon=filename.replace(".json", ".png"),
) )
coins.append(coin) coins.append(coin)
@ -450,7 +450,7 @@ def collect_coin_info():
Automatically removes duplicate symbols from the result. Automatically removes duplicate symbols from the result.
""" """
all_coins = CoinsInfo( all_coins = CoinsInfo(
coins=_load_btc_coins(), bitcoin=_load_btc_coins(),
eth=_load_ethereum_networks(), eth=_load_ethereum_networks(),
erc20=_load_erc20_tokens(), erc20=_load_erc20_tokens(),
nem=_load_nem_mosaics(), nem=_load_nem_mosaics(),
@ -458,7 +458,7 @@ def collect_coin_info():
) )
for k, coins in all_coins.items(): for k, coins in all_coins.items():
if k == "coins": if k == "bitcoin":
coins.sort(key=_btc_sort_key) coins.sort(key=_btc_sort_key)
elif k == "nem": elif k == "nem":
# do not sort nem # do not sort nem

View File

@ -165,7 +165,7 @@ def update_simple(coins, support_info, type):
return res return res
def update_coins(coins, support_info): def update_bitcoin(coins, support_info):
res = update_simple(coins, support_info, "coin") res = update_simple(coins, support_info, "coin")
for coin in coins: for coin in coins:
key = coin["key"] key = coin["key"]
@ -298,7 +298,7 @@ if __name__ == "__main__":
support_info = coin_info.support_info(defs) support_info = coin_info.support_info(defs)
coins = {} coins = {}
coins.update(update_coins(defs.coins, support_info)) coins.update(update_bitcoin(defs.bitcoin, support_info))
coins.update(update_erc20(defs.erc20, support_info)) coins.update(update_erc20(defs.erc20, support_info))
coins.update(update_ethereum_networks(defs.eth, support_info)) coins.update(update_ethereum_networks(defs.eth, support_info))
coins.update(update_simple(defs.nem, support_info, "mosaic")) coins.update(update_simple(defs.nem, support_info, "mosaic"))

View File

@ -502,7 +502,7 @@ def check(backend, icons, show_duplicates):
all_checks_passed = True all_checks_passed = True
print("Checking BTC-like coins...") print("Checking BTC-like coins...")
if not check_btc(defs.coins): if not check_btc(defs.bitcoin):
all_checks_passed = False all_checks_passed = False
if show_duplicates == "all": if show_duplicates == "all":
@ -517,12 +517,12 @@ def check(backend, icons, show_duplicates):
if icons: if icons:
print("Checking icon files...") print("Checking icon files...")
if not check_icons(defs.coins): if not check_icons(defs.bitcoin):
all_checks_passed = False all_checks_passed = False
if backend: if backend:
print("Checking backend responses...") print("Checking backend responses...")
if not check_backends(defs.coins): if not check_backends(defs.bitcoin):
all_checks_passed = False all_checks_passed = False
print("Checking key uniformity...") print("Checking key uniformity...")
@ -543,7 +543,7 @@ def check(backend, icons, show_duplicates):
@click.option("-o", "--outfile", type=click.File(mode="w"), default="./coins.json") @click.option("-o", "--outfile", type=click.File(mode="w"), default="./coins.json")
def coins_json(outfile): def coins_json(outfile):
"""Generate coins.json for consumption in python-trezor and Connect/Wallet""" """Generate coins.json for consumption in python-trezor and Connect/Wallet"""
coins = coin_info.coin_info().coins coins = coin_info.coin_info().bitcoin
support_info = coin_info.support_info(coins) support_info = coin_info.support_info(coins)
by_name = {} by_name = {}
for coin in coins: for coin in coins:
@ -563,7 +563,7 @@ def coindefs(outfile):
This is currently unused but should enable us to add new coins without having to This is currently unused but should enable us to add new coins without having to
update firmware. update firmware.
""" """
coins = coin_info.coin_info().coins coins = coin_info.coin_info().bitcoin
coindefs = {} coindefs = {}
for coin in coins: for coin in coins:
key = coin["key"] key = coin["key"]