From e2917a861c1ccf745a196217e66a8577cbd2b0fd Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Fri, 13 Sep 2024 10:50:57 +0200 Subject: [PATCH 1/2] Use dedicated ethereum sdk branch fbe/give_derivation_path_to_plugin --- ethereum-plugin-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum-plugin-sdk b/ethereum-plugin-sdk index d993caa73..26662539b 160000 --- a/ethereum-plugin-sdk +++ b/ethereum-plugin-sdk @@ -1 +1 @@ -Subproject commit d993caa737b35555b361a644e387c2ee3e845adb +Subproject commit 26662539b1cd62ae7ef4826d66690dad80cb9bab From a8dbb38b448a6c9f16c7470b17831d393a02c37c Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Mon, 9 Sep 2024 17:47:04 +0200 Subject: [PATCH 2/2] Give knowledge of derivation path from eth to plugin --- src/eth_plugin_handler.c | 1 + src/shared_context.h | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/eth_plugin_handler.c b/src/eth_plugin_handler.c index 1d92ab631..8150eb730 100644 --- a/src/eth_plugin_handler.c +++ b/src/eth_plugin_handler.c @@ -211,6 +211,7 @@ eth_plugin_result_t eth_plugin_call(int method, void *parameter) { (uint8_t *) &dataContext.tokenContext.pluginContext; ((ethPluginInitContract_t *) parameter)->pluginContextLength = sizeof(dataContext.tokenContext.pluginContext); + ((ethPluginInitContract_t *) parameter)->bip32 = &tmpCtx.transactionContext.bip32; break; case ETH_PLUGIN_PROVIDE_PARAMETER: PRINTF("-- PLUGIN PROVIDE PARAMETER --\n"); diff --git a/src/shared_context.h b/src/shared_context.h index 323ffd177..94a23fcec 100644 --- a/src/shared_context.h +++ b/src/shared_context.h @@ -7,6 +7,7 @@ #include "os.h" #include "cx.h" #include "bip32.h" +#include "bip32_utils.h" #include "ethUstream.h" #include "tx_content.h" #include "chainConfig.h" @@ -26,11 +27,6 @@ extern void common_app_init(void); #define MAX_ASSETS 5 -typedef struct bip32_path_t { - uint8_t length; - uint32_t path[MAX_BIP32_PATH]; -} bip32_path_t; - typedef struct internalStorage_t { bool dataAllowed; bool contractDetails;