From a0551e822621ce1f2b8ac371e8a24d35a7e7a87d Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Mon, 16 May 2022 15:15:00 +0200 Subject: [PATCH] Added a function to check if we are in the domain or the message struct --- src_features/signMessageEIP712/path.c | 9 +++++++++ src_features/signMessageEIP712/path.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src_features/signMessageEIP712/path.c b/src_features/signMessageEIP712/path.c index 28fd41b..1b199a2 100644 --- a/src_features/signMessageEIP712/path.c +++ b/src_features/signMessageEIP712/path.c @@ -598,6 +598,15 @@ bool path_advance(void) return true; } +e_root_type path_get_root_type(void) +{ + if (path_struct == NULL) + { + return ROOT_DOMAIN; + } + return path_struct->root_type; +} + /** * Allocates the path indexes in memory and sets it with a depth of 0. * diff --git a/src_features/signMessageEIP712/path.h b/src_features/signMessageEIP712/path.h index b8e0ad6..e5a05c1 100644 --- a/src_features/signMessageEIP712/path.h +++ b/src_features/signMessageEIP712/path.h @@ -37,6 +37,7 @@ bool path_advance(void); bool path_init(void); void path_deinit(void); bool path_new_array_depth(uint8_t size); +e_root_type path_get_root_type(void); #endif // HAVE_EIP712_FULL_SUPPORT