Merge remote-tracking branch 'origin/develop' into HEAD
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
#define MAX_NETWORK_TICKER_LEN 8
|
||||
|
||||
typedef struct network_info_s {
|
||||
const char name[NETWORK_STRING_MAX_SIZE];
|
||||
const char ticker[MAX_NETWORK_TICKER_LEN];
|
||||
const char *name;
|
||||
const char *ticker;
|
||||
uint64_t chain_id;
|
||||
} network_info_t;
|
||||
|
||||
|
||||
40
src_common/plugins.c
Normal file
40
src_common/plugins.c
Normal file
@@ -0,0 +1,40 @@
|
||||
#include "eth_plugin_handler.h"
|
||||
#include "ui_callbacks.h"
|
||||
|
||||
void plugin_ui_get_id(void) {
|
||||
ethQueryContractID_t pluginQueryContractID;
|
||||
eth_plugin_prepare_query_contract_ID(&pluginQueryContractID,
|
||||
strings.common.fullAddress,
|
||||
sizeof(strings.common.fullAddress),
|
||||
strings.common.fullAmount,
|
||||
sizeof(strings.common.fullAmount));
|
||||
// Query the original contract for ID if it's not an internal alias
|
||||
if (!eth_plugin_call(ETH_PLUGIN_QUERY_CONTRACT_ID, (void *) &pluginQueryContractID)) {
|
||||
PRINTF("Plugin query contract ID call failed\n");
|
||||
io_seproxyhal_touch_tx_cancel(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void plugin_ui_get_item_internal(char *title_buffer,
|
||||
size_t title_buffer_size,
|
||||
char *msg_buffer,
|
||||
size_t msg_buffer_size) {
|
||||
ethQueryContractUI_t pluginQueryContractUI;
|
||||
eth_plugin_prepare_query_contract_UI(&pluginQueryContractUI,
|
||||
dataContext.tokenContext.pluginUiCurrentItem,
|
||||
title_buffer,
|
||||
title_buffer_size,
|
||||
msg_buffer,
|
||||
msg_buffer_size);
|
||||
if (!eth_plugin_call(ETH_PLUGIN_QUERY_CONTRACT_UI, (void *) &pluginQueryContractUI)) {
|
||||
PRINTF("Plugin query contract UI call failed\n");
|
||||
io_seproxyhal_touch_tx_cancel(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void plugin_ui_get_item(void) {
|
||||
plugin_ui_get_item_internal(strings.common.fullAddress,
|
||||
sizeof(strings.common.fullAddress),
|
||||
strings.common.fullAmount,
|
||||
sizeof(strings.common.fullAmount));
|
||||
}
|
||||
11
src_common/plugins.h
Normal file
11
src_common/plugins.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef _PLUGIN_H_
|
||||
#define _PLUGIN_H_
|
||||
|
||||
void plugin_ui_get_id();
|
||||
void plugin_ui_get_item();
|
||||
void plugin_ui_get_item_internal(uint8_t *title_buffer,
|
||||
size_t title_buffer_size,
|
||||
uint8_t *msg_buffer,
|
||||
size_t msg_buffer_size);
|
||||
|
||||
#endif // _PLUGIN_H_
|
||||
17
src_common/starkDisplayUtils.c
Normal file
17
src_common/starkDisplayUtils.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifdef HAVE_STARKWARE
|
||||
|
||||
#include "shared_context.h"
|
||||
|
||||
void stark_sign_display_master_account() {
|
||||
snprintf(strings.tmp.tmp,
|
||||
sizeof(strings.tmp.tmp),
|
||||
"0x%.*H",
|
||||
32,
|
||||
dataContext.starkContext.transferDestination);
|
||||
}
|
||||
|
||||
void stark_sign_display_condition_fact() {
|
||||
snprintf(strings.tmp.tmp, sizeof(strings.tmp.tmp), "0x%.*H", 32, dataContext.starkContext.fact);
|
||||
}
|
||||
|
||||
#endif
|
||||
6
src_common/starkDisplayUtils.h
Normal file
6
src_common/starkDisplayUtils.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifdef HAVE_STARKWARE
|
||||
|
||||
void stark_sign_display_master_account();
|
||||
void stark_sign_display_condition_fact();
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user