ETH plugin SDK : Move some parts from plugin boilerplate to Eth plugin SDK to ease the plugins development, remove throw and fix the CI issues

This commit is contained in:
tdejoigny-ledger
2023-07-11 17:23:49 +02:00
committed by Alexandre Paillier
parent 03c43f73da
commit eeb52344df
8 changed files with 192 additions and 40 deletions

View File

@@ -463,12 +463,16 @@ void finalizeParsing(bool direct) {
// Format the amount in a temporary buffer, if in swap case compare it with validated
// amount, else commit it
amountToString(tmpContent.txContent.value.value,
tmpContent.txContent.value.length,
decimals,
ticker,
displayBuffer,
sizeof(displayBuffer));
if (!amountToString(tmpContent.txContent.value.value,
tmpContent.txContent.value.length,
decimals,
ticker,
displayBuffer,
sizeof(displayBuffer))) {
PRINTF("OVERFLOW, amount to string failed\n");
THROW(EXCEPTION_OVERFLOW);
}
if (G_called_from_swap) {
// Ensure the values are the same that the ones that have been previously validated
if (strcmp(strings.common.fullAmount, displayBuffer) != 0) {