Add 'sender' field to review screens

This commit is contained in:
Charles-Edouard de la Vergne
2024-03-11 16:14:31 +01:00
parent 76e8690a68
commit 273dd95937
13 changed files with 66 additions and 32 deletions

View File

@@ -19,10 +19,10 @@ bool copy_transaction_parameters(create_transaction_parameters_t* sign_transacti
// We need this "trick" as the input data position can overlap with app-ethereum globals
txStringProperties_t stack_data;
memset(&stack_data, 0, sizeof(stack_data));
strlcpy(stack_data.fullAddress,
strlcpy(stack_data.toAddress,
sign_transaction_params->destination_address,
sizeof(stack_data.fullAddress));
if ((stack_data.fullAddress[sizeof(stack_data.fullAddress) - 1] != '\0') ||
sizeof(stack_data.toAddress));
if ((stack_data.toAddress[sizeof(stack_data.toAddress) - 1] != '\0') ||
(sign_transaction_params->amount_length > 32) ||
(sign_transaction_params->fee_amount_length > 8)) {
return false;

View File

@@ -4,8 +4,8 @@
void plugin_ui_get_id(void) {
ethQueryContractID_t pluginQueryContractID;
eth_plugin_prepare_query_contract_ID(&pluginQueryContractID,
strings.common.fullAddress,
sizeof(strings.common.fullAddress),
strings.common.toAddress,
sizeof(strings.common.toAddress),
strings.common.fullAmount,
sizeof(strings.common.fullAmount));
// Query the original contract for ID if it's not an internal alias
@@ -33,8 +33,8 @@ void plugin_ui_get_item_internal(char *title_buffer,
}
void plugin_ui_get_item(void) {
plugin_ui_get_item_internal(strings.common.fullAddress,
sizeof(strings.common.fullAddress),
plugin_ui_get_item_internal(strings.common.toAddress,
sizeof(strings.common.toAddress),
strings.common.fullAmount,
sizeof(strings.common.fullAmount));
}

View File

@@ -127,7 +127,8 @@ typedef enum {
#define NETWORK_STRING_MAX_SIZE 19
typedef struct txStringProperties_s {
char fullAddress[43];
char fromAddress[43];
char toAddress[43];
char fullAmount[79]; // 2^256 is 78 digits long
char maxFee[50];
char nonce[8]; // 10M tx per account ought to be enough for everybody