Remove token management from main
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "apdu_constants.h" // APDU response codes
|
||||
#include "typed_data.h"
|
||||
#include "commands_712.h"
|
||||
#include "manage_asset_info.h"
|
||||
#include "common_ui.h"
|
||||
#include "domain_name.h"
|
||||
#include "uint_common.h"
|
||||
@@ -192,16 +193,9 @@ static void ui_712_format_str(const uint8_t *const data, uint8_t length) {
|
||||
* @return the ticker name if found, \ref NULL otherwise
|
||||
*/
|
||||
static const char *get_address_token_ticker(const uint8_t *addr) {
|
||||
tokenDefinition_t *token;
|
||||
|
||||
// Loop over the received token information
|
||||
for (uint8_t token_idx = 0; token_idx < MAX_ITEMS; ++token_idx) {
|
||||
if (tmpCtx.transactionContext.tokenSet[token_idx] == 1) {
|
||||
token = &tmpCtx.transactionContext.extraInfo[token_idx].token;
|
||||
if (memcmp(token->address, addr, ADDRESS_LENGTH) == 0) {
|
||||
return token->ticker;
|
||||
}
|
||||
}
|
||||
extraInfo_t *extra_info = get_asset_info(addr);
|
||||
if (extra_info != NULL) {
|
||||
return extra_info->token.ticker;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "apdu_constants.h"
|
||||
#include "crypto_helpers.h"
|
||||
#include "format.h"
|
||||
#include "manage_asset_info.h"
|
||||
|
||||
#define ERR_SILENT_MODE_CHECK_FAILED 0x6001
|
||||
|
||||
@@ -366,14 +367,14 @@ __attribute__((noinline)) static bool finalize_parsing_helper(bool direct, bool
|
||||
if ((pluginFinalize.tokenLookup1 != NULL) || (pluginFinalize.tokenLookup2 != NULL)) {
|
||||
if (pluginFinalize.tokenLookup1 != NULL) {
|
||||
PRINTF("Lookup1: %.*H\n", ADDRESS_LENGTH, pluginFinalize.tokenLookup1);
|
||||
pluginProvideInfo.item1 = getKnownToken(pluginFinalize.tokenLookup1);
|
||||
pluginProvideInfo.item1 = get_asset_info(pluginFinalize.tokenLookup1);
|
||||
if (pluginProvideInfo.item1 != NULL) {
|
||||
PRINTF("Token1 ticker: %s\n", pluginProvideInfo.item1->token.ticker);
|
||||
}
|
||||
}
|
||||
if (pluginFinalize.tokenLookup2 != NULL) {
|
||||
PRINTF("Lookup2: %.*H\n", ADDRESS_LENGTH, pluginFinalize.tokenLookup2);
|
||||
pluginProvideInfo.item2 = getKnownToken(pluginFinalize.tokenLookup2);
|
||||
pluginProvideInfo.item2 = get_asset_info(pluginFinalize.tokenLookup2);
|
||||
if (pluginProvideInfo.item2 != NULL) {
|
||||
PRINTF("Token2 ticker: %s\n", pluginProvideInfo.item2->token.ticker);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user