Changed how EIP-712 array progression is counted

This commit is contained in:
Alexandre Paillier
2024-03-25 18:16:23 +01:00
parent 04464c2f11
commit 3be9e1d197
2 changed files with 4 additions and 2 deletions

View File

@@ -255,6 +255,7 @@ static bool array_depth_list_push(uint8_t path_idx, uint8_t size) {
arr = &path_struct->array_depths[path_struct->array_depth_count];
arr->path_index = path_idx;
arr->size = size;
arr->index = 0;
path_struct->array_depth_count += 1;
return true;
}
@@ -559,8 +560,8 @@ static bool path_advance_in_array(void) {
if ((path_struct->array_depth_count > 0) &&
(arr_depth->path_index == (path_struct->depth_count - 1))) {
if (arr_depth->size > 0) arr_depth->size -= 1;
if (arr_depth->size == 0) {
arr_depth->index += 1;
if (arr_depth->index == arr_depth->size) {
array_depth_list_pop();
end_reached = true;
} else {

View File

@@ -12,6 +12,7 @@
typedef struct {
uint8_t path_index;
uint8_t size;
uint8_t index;
} s_array_depth;
typedef enum { ROOT_DOMAIN, ROOT_MESSAGE } e_root_type;