1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-15 10:58:09 +00:00
trezor-firmware/legacy/firmware/ethereum_networks.c.mako
grdddj 76c6e9cd9d feat(all): implement support information for T2B1
WIP - change trezor{1,2} to their internal names, add support for model R

WIP - add EOS and NEM features Capability only for TT

WIP - not include EOS and NEM into TR

WIP - choose between device models when generating coininfo

WIP - regenerate coininfo.py

WIP - skip NEM, EOS, Dash, BGold and Decred device tests for TR

WIP - fix python support

WIP - fix unit tests

WIP - import bitcoin-like code only when needed

WIP - remove ignored coins for TR in fixtures.json

WIP - make all the external references to models UPPERCASE

WIP - do the model separation in mako script also for tokens and networks

WIP - hot-fixing non-supporting RELEASES_URL for new model names

WIP - support.py releases CLI command takes a list of -r key-value pairs DEVICE=VERSION

WIP - run `python support.py release`

WIP - use utils.MODEL_IS_T2B1 to ignore NEM and EOS

WIP - change all the docs and commands to have UPPERCASE model names

[no changelog]
2023-09-14 13:54:09 +02:00

49 lines
1.2 KiB
Mako

<% networks = list(supported_on("T1B1", eth)) %>\
// This file is automatically generated from ethereum_networks.c.mako
// DO NOT EDIT
#include "ethereum.h"
#include "ethereum_networks.h"
#define NETWORKS_COUNT ${len(networks)}
static const EthereumNetworkInfo networks[NETWORKS_COUNT] = {
% for n in networks:
{
.chain_id = ${n.chain_id},
.slip44 = ${n.slip44},
.symbol = ${c_str(n.shortcut)}, /* ${n.name} */
.name = "",
},
% endfor
};
const EthereumNetworkInfo UNKNOWN_NETWORK = {
.chain_id = CHAIN_ID_UNKNOWN,
.slip44 = SLIP44_UNKNOWN,
.symbol = "UNKN",
.name = "",
};
const EthereumNetworkInfo *ethereum_get_network_by_chain_id(uint64_t chain_id) {
for (size_t i = 0; i < NETWORKS_COUNT; i++) {
if (networks[i].chain_id == chain_id) {
return &networks[i];
}
}
return &UNKNOWN_NETWORK;
}
const EthereumNetworkInfo *ethereum_get_network_by_slip44(uint32_t slip44) {
for (size_t i = 0; i < NETWORKS_COUNT; i++) {
if (networks[i].slip44 == slip44) {
return &networks[i];
}
}
return &UNKNOWN_NETWORK;
}
bool is_unknown_network(const EthereumNetworkInfo *network) {
return network->chain_id == CHAIN_ID_UNKNOWN;
}