Fix warnings for nanox sdk
This commit is contained in:
@@ -54,8 +54,10 @@ bool called_from_swap;
|
|||||||
#ifdef HAVE_STARKWARE
|
#ifdef HAVE_STARKWARE
|
||||||
bool quantumSet;
|
bool quantumSet;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_ETH2
|
#ifdef HAVE_ETH2
|
||||||
uint32_t eth2WithdrawalIndex;
|
uint32_t eth2WithdrawalIndex;
|
||||||
|
#include "withdrawal_index.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "ux.h"
|
#include "ux.h"
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "ethUstream.h"
|
#include "ethUstream.h"
|
||||||
#include "ethUtils.h"
|
#include "ethUtils.h"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
// Adapted from https://github.com/calccrypto/uint256_t
|
// Adapted from https://github.com/calccrypto/uint256_t
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "uint256.h"
|
#include "uint256.h"
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ void getEth2PublicKey(uint32_t *bip32Path, uint8_t bip32PathLength, uint8_t *out
|
|||||||
io_seproxyhal_io_heartbeat();
|
io_seproxyhal_io_heartbeat();
|
||||||
memset(tmp, 0, 48);
|
memset(tmp, 0, 48);
|
||||||
memmove(tmp + 16, privateKeyData, 32);
|
memmove(tmp + 16, privateKeyData, 32);
|
||||||
cx_ecfp_init_private_key(CX_CURVE_BLS12_381_G1, tmp, 48, &privateKey);
|
cx_ecfp_init_private_key(CX_CURVE_BLS12_381_G1, tmp, 48, (cx_ecfp_private_key_t *)&privateKey);
|
||||||
cx_ecfp_generate_pair(CX_CURVE_BLS12_381_G1, &publicKey, &privateKey, 1);
|
cx_ecfp_generate_pair(CX_CURVE_BLS12_381_G1, (cx_ecfp_public_key_t *)&publicKey, (cx_ecfp_private_key_t *)&privateKey, 1);
|
||||||
explicit_bzero(tmp, 96);
|
explicit_bzero(tmp, 96);
|
||||||
explicit_bzero((void *) &privateKey, sizeof(cx_ecfp_256_extended_private_key_t));
|
explicit_bzero((void *) &privateKey, sizeof(cx_ecfp_256_extended_private_key_t));
|
||||||
tmp[47] = 2;
|
tmp[47] = 2;
|
||||||
|
|||||||
8
src_features/setEth2WithdrawalIndex/withdrawal_index.h
Normal file
8
src_features/setEth2WithdrawalIndex/withdrawal_index.h
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#include "stdint.h"
|
||||||
|
|
||||||
|
void handleSetEth2WithdrawalIndex(uint8_t p1,
|
||||||
|
uint8_t p2,
|
||||||
|
uint8_t *dataBuffer,
|
||||||
|
uint16_t dataLength,
|
||||||
|
unsigned int *flags,
|
||||||
|
unsigned int *tx);
|
||||||
@@ -3,10 +3,6 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "ui_flow.h"
|
#include "ui_flow.h"
|
||||||
|
|
||||||
static const char const SIGN_MAGIC[] =
|
|
||||||
"\x19"
|
|
||||||
"Ethereum Signed Message:\n";
|
|
||||||
|
|
||||||
void handleSignEIP712Message(uint8_t p1,
|
void handleSignEIP712Message(uint8_t p1,
|
||||||
uint8_t p2,
|
uint8_t p2,
|
||||||
uint8_t *workBuffer,
|
uint8_t *workBuffer,
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ void compound_plugin_call(int message, void *parameters) {
|
|||||||
case COMPOUND_MINT:
|
case COMPOUND_MINT:
|
||||||
case CETH_MINT:
|
case CETH_MINT:
|
||||||
msg->result =
|
msg->result =
|
||||||
get_underlying_asset_decimals(context->ticker_1, &context->decimals)
|
get_underlying_asset_decimals((char *)&context->ticker_1, &context->decimals)
|
||||||
? ETH_PLUGIN_RESULT_OK
|
? ETH_PLUGIN_RESULT_OK
|
||||||
: ETH_PLUGIN_RESULT_FALLBACK;
|
: ETH_PLUGIN_RESULT_FALLBACK;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -98,7 +98,6 @@ void erc721_plugin_call(int message, void *parameters) {
|
|||||||
|
|
||||||
case ETH_PLUGIN_PROVIDE_TOKEN: {
|
case ETH_PLUGIN_PROVIDE_TOKEN: {
|
||||||
ethPluginProvideToken_t *msg = (ethPluginProvideToken_t *) parameters;
|
ethPluginProvideToken_t *msg = (ethPluginProvideToken_t *) parameters;
|
||||||
erc721_parameters_t *context = (erc721_parameters_t *) msg->pluginContext;
|
|
||||||
PRINTF("erc721 plugin provide token dest: %d - address: %d\n",
|
PRINTF("erc721 plugin provide token dest: %d - address: %d\n",
|
||||||
(msg->token1 != NULL),
|
(msg->token1 != NULL),
|
||||||
(msg->token2 != NULL));
|
(msg->token2 != NULL));
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
#include "eth_plugin_interface.h"
|
#include "eth_plugin_interface.h"
|
||||||
#include "shared_context.h" // TODO : rewrite as independant code
|
#include "shared_context.h" // TODO : rewrite as independant code
|
||||||
#include "eth_plugin_internal.h" // TODO : rewrite as independant code
|
#include "eth_plugin_internal.h" // TODO : rewrite as independant code
|
||||||
|
#include "stark_utils.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
#ifdef HAVE_STARKWARE
|
#ifdef HAVE_STARKWARE
|
||||||
|
|
||||||
@@ -156,7 +158,6 @@ typedef struct starkware_parameters_t {
|
|||||||
|
|
||||||
bool is_deversify_contract(const uint8_t *address) {
|
bool is_deversify_contract(const uint8_t *address) {
|
||||||
uint32_t offset = 0;
|
uint32_t offset = 0;
|
||||||
uint8_t size = DEVERSIFI_CONTRACT[0];
|
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
for (i = 0; i < DEVERSIFI_CONTRACT[0]; i++) {
|
for (i = 0; i < DEVERSIFI_CONTRACT[0]; i++) {
|
||||||
@@ -231,7 +232,7 @@ void starkware_print_stark_key(uint8_t *starkKey, char *destination) {
|
|||||||
void starkware_print_eth_address(uint8_t *address, char *destination) {
|
void starkware_print_eth_address(uint8_t *address, char *destination) {
|
||||||
destination[0] = '0';
|
destination[0] = '0';
|
||||||
destination[1] = 'x';
|
destination[1] = 'x';
|
||||||
getEthAddressStringFromBinary(address, destination + 2, &global_sha3, chainConfig);
|
getEthAddressStringFromBinary(address, (uint8_t *)(destination + 2), &global_sha3, chainConfig);
|
||||||
destination[42] = '\0';
|
destination[42] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,7 +314,7 @@ void starkware_get_source_address(char *destination) {
|
|||||||
io_seproxyhal_io_heartbeat();
|
io_seproxyhal_io_heartbeat();
|
||||||
destination[0] = '0';
|
destination[0] = '0';
|
||||||
destination[1] = 'x';
|
destination[1] = 'x';
|
||||||
getEthAddressStringFromKey(&publicKey, destination + 2, &global_sha3, chainConfig);
|
getEthAddressStringFromKey(&publicKey, (uint8_t *)(destination + 2), &global_sha3, chainConfig);
|
||||||
destination[42] = '\0';
|
destination[42] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,7 +326,7 @@ void starkware_plugin_call(int message, void *parameters) {
|
|||||||
starkware_parameters_t *context = (starkware_parameters_t *) msg->pluginContext;
|
starkware_parameters_t *context = (starkware_parameters_t *) msg->pluginContext;
|
||||||
PRINTF("starkware plugin init\n");
|
PRINTF("starkware plugin init\n");
|
||||||
for (i = 0; i < NUM_STARKWARE_SELECTORS; i++) {
|
for (i = 0; i < NUM_STARKWARE_SELECTORS; i++) {
|
||||||
if (memcmp(PIC(STARKWARE_SELECTORS[i]), msg->selector, SELECTOR_SIZE) == 0) {
|
if (memcmp((const void *)PIC(STARKWARE_SELECTORS[i]), msg->selector, SELECTOR_SIZE) == 0) {
|
||||||
context->selectorIndex = i;
|
context->selectorIndex = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user