mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-08 15:48:08 +00:00
fixup! feat(common): added built-in Ethereum definitions
This commit is contained in:
parent
7bf1c85897
commit
62324c2de9
@ -1,2 +1,29 @@
|
||||
[
|
||||
{
|
||||
"chain": "eth",
|
||||
"chain_id": 1,
|
||||
"name": "Ethereum",
|
||||
"rskip60": false,
|
||||
"shortcut": "ETH",
|
||||
"slip44": 60,
|
||||
"url": "https://ethereum.org"
|
||||
},
|
||||
{
|
||||
"chain": "rop",
|
||||
"chain_id": 3,
|
||||
"name": "Ropsten",
|
||||
"rskip60": false,
|
||||
"shortcut": "tROP",
|
||||
"slip44": 1,
|
||||
"url": "https://github.com/ethereum/ropsten"
|
||||
},
|
||||
{
|
||||
"chain": "tubq",
|
||||
"chain_id": 9,
|
||||
"name": "Ubiq Network Testnet",
|
||||
"rskip60": false,
|
||||
"shortcut": "TUBQ",
|
||||
"slip44": 1,
|
||||
"url": "https://ethersocial.org"
|
||||
}
|
||||
]
|
||||
|
@ -1,2 +1,30 @@
|
||||
{
|
||||
"1;eth": [
|
||||
{
|
||||
"address": "0x00000000000045166c45af0fc6e4cf31d9e14b9a",
|
||||
"decimals": 18,
|
||||
"name": "TopBidder",
|
||||
"shortcut": "BID"
|
||||
},
|
||||
{
|
||||
"address": "0x0000000000085d4780b73119b644ae5ecd22b376",
|
||||
"decimals": 18,
|
||||
"name": "TrueUSD",
|
||||
"shortcut": "TUSD"
|
||||
}
|
||||
],
|
||||
"56;bnb": [
|
||||
{
|
||||
"address": "0xfe19f0b51438fd612f6fd59c1dbb3ea319f433ba",
|
||||
"decimals": 18,
|
||||
"name": "Magic Internet Money",
|
||||
"shortcut": "MIM"
|
||||
},
|
||||
{
|
||||
"address": "0xfe1d7f7a8f0bda6e415593a2e4f82c64b446d404",
|
||||
"decimals": 18,
|
||||
"name": "BullPerks",
|
||||
"shortcut": "BLP"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -53,8 +53,6 @@ def token_by_chain_address(chain_id: int, address: bytes) -> TokenInfo:
|
||||
|
||||
def _token_iterator(chain_id: int) -> Iterator[tuple[bytes, str, int]]:
|
||||
% for token_chain_id, tokens in group_tokens(supported_on("trezor2", erc20)).items():
|
||||
return UNKNOWN_TOKEN
|
||||
|
||||
if chain_id == ${token_chain_id}:
|
||||
% for t in tokens:
|
||||
yield ( # address, symbol, decimals
|
||||
|
@ -160,8 +160,8 @@ def download_from_url(url: str, error_msg: str = "") -> bytes:
|
||||
|
||||
|
||||
def download_network_definition(chain_id: Optional[int] = None, slip44_hardened: Optional[int] = None) -> Optional[bytes]:
|
||||
if chain_id is None != slip44_hardened is None: # XOR
|
||||
raise RuntimeError(f"Both/or neither of chain_id and slip44_hardened parameters are needed to download network definition.")
|
||||
if not ((chain_id is None) != (slip44_hardened is None)): # not XOR
|
||||
raise RuntimeError(f"Exactly one of chain_id or slip44_hardened parameters are needed to load network definition from directory.")
|
||||
|
||||
if chain_id is not None:
|
||||
url = DEFS_BASE_URL.format(
|
||||
@ -195,8 +195,8 @@ def download_token_definition(chain_id: Optional[int] = None, token_address: Opt
|
||||
|
||||
|
||||
def network_definition_from_dir(path: pathlib.Path, chain_id: Optional[int] = None, slip44_hardened: Optional[int] = None) -> Optional[bytes]:
|
||||
if chain_id is None != slip44_hardened is None: # XOR
|
||||
raise RuntimeError(f"Both/or neither of chain_id and slip44_hardened parameters are needed to load network definition from directory.")
|
||||
if not ((chain_id is None) != (slip44_hardened is None)): # not XOR
|
||||
raise RuntimeError(f"Exactly one of chain_id or slip44_hardened parameters are needed to load network definition from directory.")
|
||||
|
||||
def read_definition(path: pathlib.Path) -> Optional[bytes]:
|
||||
if not path.exists() or not path.is_file():
|
||||
|
Loading…
Reference in New Issue
Block a user