Minimize includes in header files to what they depend on
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <string.h>
|
||||
#include "eth_plugin_internal.h"
|
||||
|
||||
bool erc20_plugin_available_check(void);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef _ETH_PLUGIN_INTERNAL_H_
|
||||
#define _ETH_PLUGIN_INTERNAL_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "eth_plugin_interface.h"
|
||||
|
||||
#define SELECTOR_SIZE 4
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "handle_swap_sign_transaction.h"
|
||||
#include "usbd_core.h"
|
||||
#include "os_io_seproxyhal.h"
|
||||
#include "ux.h"
|
||||
#include "handle_swap_sign_transaction.h"
|
||||
#include "shared_context.h"
|
||||
#include "utils.h"
|
||||
|
||||
@@ -79,4 +79,4 @@ void handle_swap_sign_transaction(chain_config_t* config) {
|
||||
BLE_power(1, "Nano X");
|
||||
#endif // HAVE_BLE
|
||||
app_main();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef _NFT_H_
|
||||
#define _NFT_H_
|
||||
|
||||
#include "tokens.h"
|
||||
|
||||
#define COLLECTION_NAME_MAX_LEN 70
|
||||
|
||||
typedef struct nftInfo_t {
|
||||
|
||||
@@ -3,13 +3,7 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "os.h"
|
||||
#include "cx.h"
|
||||
#include "os_io_seproxyhal.h"
|
||||
#include "ethUstream.h"
|
||||
#include "uint256.h"
|
||||
#include "tokens.h"
|
||||
#include "chainConfig.h"
|
||||
#include "nft.h"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#ifdef HAVE_ETH2
|
||||
|
||||
#include <string.h>
|
||||
#include "shared_context.h"
|
||||
|
||||
uint32_t set_result_get_eth2_publicKey() {
|
||||
@@ -9,4 +10,4 @@ uint32_t set_result_get_eth2_publicKey() {
|
||||
return tx;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // HAVE_ETH2
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <string.h>
|
||||
#include "shared_context.h"
|
||||
|
||||
uint32_t set_result_get_publicKey() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "os_io_seproxyhal.h"
|
||||
#include "shared_context.h"
|
||||
#include "ui_callbacks.h"
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "os_io_seproxyhal.h"
|
||||
#include "shared_context.h"
|
||||
#include "ui_callbacks.h"
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "os_io_seproxyhal.h"
|
||||
#include "shared_context.h"
|
||||
#include "utils.h"
|
||||
#include "ui_callbacks.h"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#ifdef HAVE_STARKWARE
|
||||
|
||||
#include <string.h>
|
||||
#include "shared_context.h"
|
||||
#include "feature_stark_getPublicKey.h"
|
||||
|
||||
@@ -10,4 +11,4 @@ uint32_t set_result_get_stark_publicKey() {
|
||||
return tx;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // HAVE_STARKWARE
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#ifdef HAVE_STARKWARE
|
||||
|
||||
#include "os_io_seproxyhal.h"
|
||||
#include "shared_context.h"
|
||||
#include "stark_utils.h"
|
||||
#include "ui_callbacks.h"
|
||||
@@ -32,4 +33,4 @@ unsigned int io_seproxyhal_touch_stark_ok(__attribute__((unused)) const bagl_ele
|
||||
return 0; // do not redraw the widget
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // HAVE_STARKWARE
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#ifdef HAVE_STARKWARE
|
||||
|
||||
#include "os_io_seproxyhal.h"
|
||||
#include "shared_context.h"
|
||||
#include "stark_utils.h"
|
||||
#include "ui_callbacks.h"
|
||||
@@ -38,4 +39,4 @@ unsigned int io_seproxyhal_touch_stark_unsafe_sign_ok(__attribute__((unused))
|
||||
return 0; // do not redraw the widget
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // HAVE_STARKWARE
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#ifdef HAVE_NFT_SUPPORT
|
||||
|
||||
#include <string.h>
|
||||
#include "erc1155_plugin.h"
|
||||
#include "eth_plugin_internal.h"
|
||||
#include "ethUtils.h"
|
||||
|
||||
static const uint8_t ERC1155_APPROVE_FOR_ALL_SELECTOR[SELECTOR_SIZE] = {0xa2, 0x2c, 0xb4, 0x65};
|
||||
static const uint8_t ERC1155_SAFE_TRANSFER_SELECTOR[SELECTOR_SIZE] = {0xf2, 0x42, 0x43, 0x2a};
|
||||
|
||||
@@ -3,12 +3,11 @@
|
||||
|
||||
#ifdef HAVE_NFT_SUPPORT
|
||||
|
||||
#include <string.h>
|
||||
#include "eth_plugin_handler.h"
|
||||
#include "shared_context.h"
|
||||
#include "ethUtils.h"
|
||||
#include "utils.h"
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "ethUstream.h"
|
||||
#include "uint256.h"
|
||||
#include "nft.h"
|
||||
|
||||
// Internal plugin for EIP 1155: https://eips.ethereum.org/EIPS/eip-1155
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#ifdef HAVE_NFT_SUPPORT
|
||||
|
||||
#include <string.h>
|
||||
#include "erc1155_plugin.h"
|
||||
#include "eth_plugin_internal.h"
|
||||
#include "utils.h"
|
||||
#include "ethUtils.h"
|
||||
|
||||
static void handle_safe_transfer(ethPluginProvideParameter_t *msg, erc1155_context_t *context) {
|
||||
uint8_t new_value[INT256_LENGTH];
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#ifdef HAVE_NFT_SUPPORT
|
||||
|
||||
#include <string.h>
|
||||
#include "erc1155_plugin.h"
|
||||
#include "eth_plugin_interface.h"
|
||||
#include "ethUtils.h"
|
||||
#include "utils.h"
|
||||
|
||||
static void set_approval_for_all_ui(ethQueryContractUI_t *msg, erc1155_context_t *context) {
|
||||
switch (msg->screenIndex) {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#ifdef HAVE_NFT_SUPPORT
|
||||
|
||||
#include <string.h>
|
||||
#include "erc721_plugin.h"
|
||||
#include "eth_plugin_internal.h"
|
||||
#include "eth_plugin_interface.h"
|
||||
#include "ethUtils.h"
|
||||
|
||||
static const uint8_t ERC721_APPROVE_SELECTOR[SELECTOR_SIZE] = {0x09, 0x5e, 0xa7, 0xb3};
|
||||
static const uint8_t ERC721_APPROVE_FOR_ALL_SELECTOR[SELECTOR_SIZE] = {0xa2, 0x2c, 0xb4, 0x65};
|
||||
|
||||
@@ -3,11 +3,10 @@
|
||||
|
||||
#ifdef HAVE_NFT_SUPPORT
|
||||
|
||||
#include <string.h>
|
||||
#include "eth_plugin_handler.h"
|
||||
#include "shared_context.h"
|
||||
#include "ethUtils.h"
|
||||
#include "utils.h"
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "ethUstream.h"
|
||||
#include "nft.h"
|
||||
|
||||
// Internal plugin for EIP 721: https://eips.ethereum.org/EIPS/eip-721
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#ifdef HAVE_NFT_SUPPORT
|
||||
|
||||
#include <string.h>
|
||||
#include "erc721_plugin.h"
|
||||
#include "eth_plugin_interface.h"
|
||||
#include "ethUtils.h"
|
||||
#include "utils.h"
|
||||
|
||||
static void set_approval_ui(ethQueryContractUI_t *msg, erc721_context_t *context) {
|
||||
switch (msg->screenIndex) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <string.h>
|
||||
#include "os_io_seproxyhal.h"
|
||||
#include "eth_plugin_interface.h"
|
||||
#include "shared_context.h" // TODO : rewrite as independant code
|
||||
#include "eth_plugin_internal.h" // TODO : rewrite as independant code
|
||||
|
||||
Reference in New Issue
Block a user