From a61a155d0b643a713121ccfb8e327223ec71816e Mon Sep 17 00:00:00 2001 From: pscott Date: Thu, 20 May 2021 14:34:32 +0200 Subject: [PATCH] Add additionalScreens field --- Makefile | 2 +- doc/ethapp_plugins.asc | 2 ++ ethereum-plugin-sdk | 2 +- src/eth_plugin_interface.h | 2 ++ src_features/signTx/logic_signTx.c | 7 ++++--- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0e7be90..d237de7 100755 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ APP_LOAD_PARAMS += --path "1517992542'/1101353413'" APPVERSION_M=1 APPVERSION_N=8 -APPVERSION_P=2 +APPVERSION_P=3 APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P) APP_LOAD_FLAGS= --appFlags 0x240 --dep Ethereum:$(APPVERSION) diff --git a/doc/ethapp_plugins.asc b/doc/ethapp_plugins.asc index 64cc1ae..0c320d6 100644 --- a/doc/ethapp_plugins.asc +++ b/doc/ethapp_plugins.asc @@ -190,6 +190,8 @@ typedef struct ethPluginProvideToken_t { tokenDefinition_t *token1; // set by the ETH application, to be saved by the plugin tokenDefinition_t *token2; + uint8_t additionalScreens; // Used by the plugin if it needs to display additional screens based on the information received from the token definitions. + uint8_t result; } ethPluginProvideToken_t; diff --git a/ethereum-plugin-sdk b/ethereum-plugin-sdk index 8ed5066..9de21dd 160000 --- a/ethereum-plugin-sdk +++ b/ethereum-plugin-sdk @@ -1 +1 @@ -Subproject commit 8ed5066fb4e83a481ed2903deff013754fae8939 +Subproject commit 9de21dd3a93ae0025a55d0738482ce04f1d315b0 diff --git a/src/eth_plugin_interface.h b/src/eth_plugin_interface.h index 3da6444..0ea618e 100644 --- a/src/eth_plugin_interface.h +++ b/src/eth_plugin_interface.h @@ -130,6 +130,8 @@ typedef struct ethPluginProvideToken_t { tokenDefinition_t *token1; // set by the ETH application, to be saved by the plugin tokenDefinition_t *token2; + uint8_t additionalScreens; // Used by the plugin if it needs to display additional screens based on the information received from the token definitions. + uint8_t result; } ethPluginProvideToken_t; diff --git a/src_features/signTx/logic_signTx.c b/src_features/signTx/logic_signTx.c index d7f3680..a5c9328 100644 --- a/src_features/signTx/logic_signTx.c +++ b/src_features/signTx/logic_signTx.c @@ -289,8 +289,8 @@ void finalizeParsing(bool direct) { } } // Lookup tokens if requested + ethPluginProvideToken_t pluginProvideToken; if ((pluginFinalize.tokenLookup1 != NULL) || (pluginFinalize.tokenLookup2 != NULL)) { - ethPluginProvideToken_t pluginProvideToken; if (pluginFinalize.tokenLookup1 != NULL) { PRINTF("Lookup1: %.*H\n", ADDRESS_LENGTH, pluginFinalize.tokenLookup1); token1 = getKnownToken(pluginFinalize.tokenLookup1); @@ -321,7 +321,8 @@ void finalizeParsing(bool direct) { switch (pluginFinalize.uiType) { case ETH_UI_TYPE_GENERIC: dataPresent = false; - dataContext.tokenContext.pluginUiMaxItems = pluginFinalize.numScreens; + // Add the number of screens + the number of additional screens to get the total number of screens needed. + dataContext.tokenContext.pluginUiMaxItems = pluginFinalize.numScreens + pluginProvideToken.additionalScreens; break; case ETH_UI_TYPE_AMOUNT_ADDRESS: genericUI = true; @@ -424,7 +425,7 @@ void finalizeParsing(bool direct) { } } - bool no_consent = false; + bool no_consent; no_consent = called_from_swap;