Add additionalScreens field

This commit is contained in:
pscott
2021-05-20 14:34:32 +02:00
parent bff623645c
commit a61a155d0b
5 changed files with 10 additions and 5 deletions

View File

@@ -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)

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;