Renamed get_asset_info to get_asset_info_by_addr
This commit is contained in:
@@ -4,7 +4,7 @@ void reset_known_tokens(void) {
|
||||
memset(tmpCtx.transactionContext.tokenSet, 0, MAX_ITEMS);
|
||||
}
|
||||
|
||||
extraInfo_t *get_asset_info(const uint8_t *contractAddress) {
|
||||
extraInfo_t *get_asset_info_by_addr(const uint8_t *contractAddress) {
|
||||
// Works for ERC-20 & NFT tokens since both structs in the union have the
|
||||
// contract address aligned
|
||||
for (uint8_t i = 0; i < MAX_ITEMS; i++) {
|
||||
|
||||
@@ -3,5 +3,4 @@
|
||||
#include "asset_info.h"
|
||||
|
||||
void reset_known_tokens(void);
|
||||
|
||||
extraInfo_t *get_asset_info(const uint8_t *contractAddress);
|
||||
extraInfo_t *get_asset_info_by_addr(const uint8_t *contractAddress);
|
||||
|
||||
@@ -193,7 +193,7 @@ 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) {
|
||||
extraInfo_t *extra_info = get_asset_info(addr);
|
||||
extraInfo_t *extra_info = get_asset_info_by_addr(addr);
|
||||
if (extra_info != NULL) {
|
||||
return extra_info->token.ticker;
|
||||
}
|
||||
|
||||
@@ -367,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 = get_asset_info(pluginFinalize.tokenLookup1);
|
||||
pluginProvideInfo.item1 = get_asset_info_by_addr(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 = get_asset_info(pluginFinalize.tokenLookup2);
|
||||
pluginProvideInfo.item2 = get_asset_info_by_addr(pluginFinalize.tokenLookup2);
|
||||
if (pluginProvideInfo.item2 != NULL) {
|
||||
PRINTF("Token2 ticker: %s\n", pluginProvideInfo.item2->token.ticker);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user