1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-30 03:18:20 +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. // remove trailing dot.
if (value_ptr[-1] == '.') if (value_ptr[-1] == '.')
value_ptr--; value_ptr--;
if (chain_id == 61 || chain_id == 62) { switch (chain_id) {
strcpy(value_ptr, " ETC"); case 61:
} else { strcpy(value_ptr, " ETC"); // Ethereum Classic Mainnet
strcpy(value_ptr, " ETH"); 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 // value is at most 16 + 4 + 1 characters long
} else { } else {