1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-27 16:48:09 +00:00

ethereum: add new chain_ids

This commit is contained in:
Pavol Rusnak 2017-05-04 15:12:24 +02:00
parent 13f03d3880
commit cb14b98213
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -242,10 +242,31 @@ static void ethereumFormatAmount(bignum256 *val, char buffer[25])
// remove trailing dot.
if (value_ptr[-1] == '.')
value_ptr--;
if (chain_id == 61 || chain_id == 62) {
strcpy(value_ptr, " ETC");
} else {
strcpy(value_ptr, " ETH");
switch (chain_id) {
case 61:
strcpy(value_ptr, " ETC"); // Ethereum Classic Mainnet
break;
case 62:
strcpy(value_ptr, " tETC"); // Ethereum Classic Testnet
break;
case 30:
strcpy(value_ptr, " RSK"); // Rootstock Mainnet
break;
case 31:
strcpy(value_ptr, " tRSK"); // Rootstock Testnet
break;
case 3:
strcpy(value_ptr, " tETH"); // Ethereum Testnet: Ropsten
break;
case 4:
strcpy(value_ptr, " tETH"); // Ethereum Testnet: Rinkeby
break;
case 42:
strcpy(value_ptr, " tETH"); // Ethereum Testnet: Kovan
break;
default:
strcpy(value_ptr, " ETH"); // Ethereum Mainnet
break;
}
// value is at most 16 + 4 + 1 characters long
} else {