1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-05-29 12:18:51 +00:00

feat(common): let's work with Trezor Suite instead of the web wallet

This commit is contained in:
Pavol Rusnak 2021-03-17 15:31:14 +01:00
parent 6676352070
commit cc9dd66729
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
8 changed files with 554 additions and 559 deletions

View File

@ -134,8 +134,8 @@ External contributors should not touch this file unless asked to.
We keep track of support status of each coin over our devices. That is We keep track of support status of each coin over our devices. That is
`trezor1` for Trezor One, `trezor2` for Trezor T, `connect` for [Connect](https://github.com/trezor/connect) `trezor1` for Trezor One, `trezor2` for Trezor T, `connect` for [Connect](https://github.com/trezor/connect)
and `webwallet` for [Trezor Wallet](https://wallet.trezor.io/). In further description, the word "device" and `suite` for [Trezor Suite](https://suite.trezor.io/). In further description, the word "device"
applies to Connect and webwallet as well. applies to Connect and Suite as well.
This information is stored in [`support.json`](support.json). This information is stored in [`support.json`](support.json).
External contributors should not touch this file unless asked to. External contributors should not touch this file unless asked to.
@ -144,10 +144,10 @@ Each coin on each device can be in one of four support states:
* **supported** explicitly: coin's key is listed in the device's `supported` * **supported** explicitly: coin's key is listed in the device's `supported`
dictionary. If it's a Trezor device, it contains the firmware version from which dictionary. If it's a Trezor device, it contains the firmware version from which
it is supported. For connect and webwallet, the value is simply `true`. it is supported. For connect and suite, the value is simply `true`.
* **unsupported** explicitly: coin's key is listed in the device's `unsupported` * **unsupported** explicitly: coin's key is listed in the device's `unsupported`
dictionary. The value is a string with reason for not supporting. dictionary. The value is a string with reason for not supporting.
For connect and webwallet, if the key is not listed at all, it is also considered unsupported. For connect and suite, if the key is not listed at all, it is also considered unsupported.
ERC20 tokens detected as duplicates are also considered unsupported. ERC20 tokens detected as duplicates are also considered unsupported.
* **soon**: coin's key is listed in the device's `supported` dictionary, with * **soon**: coin's key is listed in the device's `supported` dictionary, with
the value `"soon"`. the value `"soon"`.

File diff suppressed because it is too large Load Diff

View File

@ -5,10 +5,6 @@
"erc20:eth:LINK (Chainlink)": { "erc20:eth:LINK (Chainlink)": {
"name": "Chainlink" "name": "Chainlink"
}, },
"erc20:eth:YUPIE": {
"hidden": 1,
"notes": "Replaced by YUP"
},
"eth:CLO": { "eth:CLO": {
"coinmarketcap_alias": "callisto-network" "coinmarketcap_alias": "callisto-network"
}, },

View File

@ -4523,7 +4523,7 @@
"eth:ATH:43110": "duplicate key" "eth:ATH:43110": "duplicate key"
} }
}, },
"webwallet": { "suite": {
"supported": { "supported": {
"bitcoin:ACM": true, "bitcoin:ACM": true,
"bitcoin:BCH": true, "bitcoin:BCH": true,

View File

@ -113,14 +113,14 @@ misc:ONT - Ontology (ONT)
* connect : NO * connect : NO
* trezor1 : support info missing * trezor1 : support info missing
* trezor2 : support info missing * trezor2 : support info missing
* webwallet : NO * suite : NO
$ ./support.py set misc:ONT trezor1=no -r "not planned on T1" trezor2=soon $ ./support.py set misc:ONT trezor1=no -r "not planned on T1" trezor2=soon
misc:ONT - Ontology (ONT) misc:ONT - Ontology (ONT)
* connect : NO * connect : NO
* trezor1 : NO (reason: not planned on T1) * trezor1 : NO (reason: not planned on T1)
* trezor2 : SOON * trezor2 : SOON
* webwallet : NO * suite : NO
``` ```
Afterwards, review and commit changes to `defs/support.json`, and update the `trezor-common` Afterwards, review and commit changes to `defs/support.json`, and update the `trezor-common`

View File

@ -327,7 +327,7 @@ def _load_fido_apps():
# ====== support info ====== # ====== support info ======
RELEASES_URL = "https://data.trezor.io/firmware/{}/releases.json" RELEASES_URL = "https://data.trezor.io/firmware/{}/releases.json"
MISSING_SUPPORT_MEANS_NO = ("connect", "webwallet") MISSING_SUPPORT_MEANS_NO = ("connect", "suite")
VERSIONED_SUPPORT_INFO = ("trezor1", "trezor2") VERSIONED_SUPPORT_INFO = ("trezor1", "trezor2")
@ -362,7 +362,7 @@ def support_info_single(support_data, coin):
* if the coin is a duplicate ERC20 token, all support values are `None` * if the coin is a duplicate ERC20 token, all support values are `None`
* if the coin has an entry in `unsupported`, its support is `None` * if the coin has an entry in `unsupported`, its support is `None`
* if the coin has an entry in `supported` its support is that entry * if the coin has an entry in `supported` its support is that entry
(usually a version string, or `True` for connect/webwallet) (usually a version string, or `True` for connect/suite)
* otherwise support is presumed "soon" * otherwise support is presumed "soon"
""" """
support_info = {} support_info = {}
@ -393,7 +393,7 @@ def support_info(coins):
Takes a collection of coins and generates a support-info entry for each. Takes a collection of coins and generates a support-info entry for each.
The support-info is a dict with keys based on `support.json` keys. The support-info is a dict with keys based on `support.json` keys.
These are usually: "trezor1", "trezor2", "connect" and "webwallet". These are usually: "trezor1", "trezor2", "connect" and "suite".
The `coins` argument can be a `CoinsInfo` object, a list or a dict of The `coins` argument can be a `CoinsInfo` object, a list or a dict of
coin items. coin items.

View File

@ -21,8 +21,7 @@ OVERRIDES = coin_info.load_json("coins_details.override.json")
VERSIONS = coin_info.latest_releases() VERSIONS = coin_info.latest_releases()
# automatic wallet entries # automatic wallet entries
WALLET_TREZOR = {"Trezor Wallet": "https://wallet.trezor.io"} WALLET_SUITE = {"Trezor Suite": "https://suite.trezor.io"}
WALLET_ETH_TREZOR = {"Trezor Suite": "https://suite.trezor.io"}
WALLET_NEM = { WALLET_NEM = {
"Nano Wallet": "https://nem.io/downloads/", "Nano Wallet": "https://nem.io/downloads/",
"Magnum": "https://magnumwallet.co", "Magnum": "https://magnumwallet.co",
@ -96,14 +95,14 @@ def _is_supported(support, trezor_version):
return nominal return nominal
def _webwallet_support(coin, support): def _suite_support(coin, support):
"""Check the "webwallet" support property. """Check the "suite" support property.
If set, check that at least one of the backends run on trezor.io. If set, check that at least one of the backends run on trezor.io.
If yes, assume we support the coin in our wallet. If yes, assume we support the coin in our wallet.
Otherwise it's probably working with a custom backend, which means don't Otherwise it's probably working with a custom backend, which means don't
link to our wallet. link to our wallet.
""" """
if not support.get("webwallet"): if not support.get("suite"):
return False return False
return any(".trezor.io" in url for url in coin["blockbook"]) return any(".trezor.io" in url for url in coin["blockbook"])
@ -150,7 +149,7 @@ def update_bitcoin(coins, support_info):
details = dict( details = dict(
name=coin["coin_label"], name=coin["coin_label"],
links=dict(Homepage=coin["website"], Github=coin["github"]), links=dict(Homepage=coin["website"], Github=coin["github"]),
wallet=WALLET_TREZOR if _webwallet_support(coin, support) else {}, wallet=WALLET_SUITE if _suite_support(coin, support) else {},
) )
dict_merge(res[key], details) dict_merge(res[key], details)
@ -172,8 +171,8 @@ def update_erc20(coins, networks, support_info):
if "deprecation" in coin: if "deprecation" in coin:
hidden = True hidden = True
if network_support.get(chain, {}).get("webwallet"): if network_support.get(chain, {}).get("suite"):
wallets = WALLET_ETH_TREZOR wallets = WALLET_SUITE
else: else:
wallets = WALLETS_ETH_3RDPARTY wallets = WALLETS_ETH_3RDPARTY
@ -200,8 +199,8 @@ def update_ethereum_networks(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"]
if support_info[key].get("webwallet"): if support_info[key].get("suite"):
wallets = WALLET_ETH_TREZOR wallets = WALLET_SUITE
else: else:
wallets = WALLETS_ETH_3RDPARTY wallets = WALLETS_ETH_3RDPARTY
details = dict(links=dict(Homepage=coin.get("url")), wallet=wallets) details = dict(links=dict(Homepage=coin.get("url")), wallet=wallets)

View File

@ -464,7 +464,7 @@ def set_support_value(key, entries, reason):
"""Set a support info variable. """Set a support info variable.
Examples: Examples:
support.py set coin:BTC trezor1=soon trezor2=2.0.7 webwallet=yes connect=no support.py set coin:BTC trezor1=soon trezor2=2.0.7 suite=yes connect=no
support.py set coin:LTC trezor1=yes connect= support.py set coin:LTC trezor1=yes connect=
Setting a variable to "yes", "true" or "1" sets support to true. Setting a variable to "yes", "true" or "1" sets support to true.