1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-24 15:28:10 +00:00

fix(legacy): wrap long Ethereum fees (fixes #2373)

This commit is contained in:
matejcik 2022-09-26 15:26:48 +02:00 committed by matejcik
parent 6e957a8a92
commit 3b2d7115cb
6 changed files with 37 additions and 3 deletions

View File

@ -139,6 +139,25 @@
"sig_r": "3a5e8fa47bfdb758837643485b2951f6c54894996f124dce6282662289ebcf79",
"sig_s": "5b5b9e0f9af273466cc1e991cb86fadb2abedeb4de150163a8dbf348422b5fe2"
}
},
{
"name": "long_fees",
"parameters": {
"data": "",
"path": "m/44'/60'/0'/0/0",
"to_address": "0x1d1c328764a41bda0492b66baa30c4a339ff85ef",
"chain_id": 1,
"nonce": "0x0",
"gas_limit": "0x141414141414141414",
"max_gas_fee": "0x14141414141414141414",
"max_priority_fee": "0x11111111111111111",
"value": "0xa"
},
"result": {
"sig_v": 0,
"sig_r": "3f3bfa6762b33819f268a98744803e1876aa440a6fd2ebef90cfd606bb893429",
"sig_s": "241e1128a715a5386c3b6d0998f9f42c21ee080568fbf2c642a05916c30737e2"
}
}
]
}

View File

@ -0,0 +1 @@
Wrap long Ethereum fee to next line if it does not fit.

View File

@ -477,9 +477,8 @@ static void layoutEthereumFeeEIP1559(const char *description,
ethereumFormatAmount(&amount_val, NULL, amount_str, sizeof(amount_str));
layoutDialogSwipe(&bmp_icon_question, _("Cancel"), _("Confirm"), NULL,
_("Confirm fee"), description, amount_str, NULL, NULL,
NULL);
layoutDialogSwipeWrapping(&bmp_icon_question, _("Cancel"), _("Confirm"),
_("Confirm fee"), description, amount_str);
}
/*

View File

@ -260,6 +260,16 @@ const char **split_message_hex(const uint8_t *msg, uint32_t len) {
void *layoutLast = NULL;
void layoutDialogSwipeWrapping(const BITMAP *icon, const char *btnNo,
const char *btnYes, const char *heading,
const char *description, const char *wrap_text) {
const uint32_t row_len = 20;
const char **str =
split_message((const uint8_t *)wrap_text, strlen(wrap_text), row_len);
layoutDialogSwipe(icon, btnNo, btnYes, NULL, heading, description, str[0],
str[1], str[2], str[3]);
}
void layoutDialogSwipe(const BITMAP *icon, const char *btnNo,
const char *btnYes, const char *desc, const char *line1,
const char *line2, const char *line3, const char *line4,

View File

@ -48,6 +48,9 @@ void layoutDialogSwipeEx(const BITMAP *icon, const char *btnNo,
const char *line1, const char *line2,
const char *line3, const char *line4,
const char *line5, const char *line6, uint8_t font);
void layoutDialogSwipeWrapping(const BITMAP *icon, const char *btnNo,
const char *btnYes, const char *heading,
const char *description, const char *wrap_text);
void layoutProgressSwipe(const char *desc, int permil);
void layoutScreensaver(void);

View File

@ -427,6 +427,7 @@
"T1_ethereum-test_signtx.py::test_signtx_eip1559[data_2_bigdata]": "28d2a0d397b4e9865ca8286cc1a3669c3a7d34bb31b430662354bf3ec69d1cc5",
"T1_ethereum-test_signtx.py::test_signtx_eip1559[known_erc20]": "b8e205a40711e377f2185cec6e085fa2f6a4d5bbc6a03d9cf2758058b6c1e17b",
"T1_ethereum-test_signtx.py::test_signtx_eip1559[large_chainid]": "5b008a081b4ef9e7b47c9d0c1fc4bb24d729d77841193694232bd2da4a386515",
"T1_ethereum-test_signtx.py::test_signtx_eip1559[long_fees]": "ae698173acb069ced4d987735e53f8d46197dedb3d4b215c0dc02023ce8e986d",
"T1_ethereum-test_signtx.py::test_signtx_eip1559[nodata]": "5b008a081b4ef9e7b47c9d0c1fc4bb24d729d77841193694232bd2da4a386515",
"T1_ethereum-test_signtx.py::test_signtx_eip1559[unknown_erc20]": "548c1f22918351e9cbcc1e16d8ba67bc2e7460b9a92cfc6c8bfa0a2b063e68da",
"T1_ethereum-test_signtx.py::test_signtx_eip1559_access_list": "f6c5f398d4e80fc8f93cf70e9b10de24b9a968db04dc6ea21b28d1a273f04ca1",
@ -1461,6 +1462,7 @@
"TT_ethereum-test_signtx.py::test_signtx_eip1559[data_2_bigdata]": "1da940fdb1d80374ebb1eb3922ab15bccf54eaec6ed40ce83834a93695fa1311",
"TT_ethereum-test_signtx.py::test_signtx_eip1559[known_erc20]": "0e43071011c080f3a64130113914a03285f35c0e9c69379f6c94eda48dc9816f",
"TT_ethereum-test_signtx.py::test_signtx_eip1559[large_chainid]": "c2fa2b3fe49f369b7cf1da456cdd08fc56d232155aa48232ef5ba965df9cafaa",
"TT_ethereum-test_signtx.py::test_signtx_eip1559[long_fees]": "dd272effd96a8ba69c2ef4ae3369963d03de957830e61de2a3f00e8ca7ba1f42",
"TT_ethereum-test_signtx.py::test_signtx_eip1559[nodata]": "66b381da23a9f31f962115de7a8ae95d575eda72f665d2d65f00bead78cdab48",
"TT_ethereum-test_signtx.py::test_signtx_eip1559[unknown_erc20]": "541822da15b3d11952c9329092d38ba363ca021a0193967e441a2feb59b771fb",
"TT_ethereum-test_signtx.py::test_signtx_eip1559_access_list": "e32e0029dedc39857f3d8eb31ce8cf7a06d32e6ca81df7d67586fce123df4f7d",