From 847db91cfb03b59c6888463bad45ee1f2dbb32ba Mon Sep 17 00:00:00 2001 From: pscott Date: Fri, 27 Aug 2021 17:28:24 +0200 Subject: [PATCH] Remove debugging statements --- src_common/network.c | 9 --------- src_features/signTx/logic_signTx.c | 4 ---- src_features/signTx/ui_common_signTx.c | 7 +++++-- src_features/signTx/ui_flow_signTx.c | 1 - 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src_common/network.c b/src_common/network.c index 23872ea..4ebdb74 100644 --- a/src_common/network.c +++ b/src_common/network.c @@ -24,7 +24,6 @@ const network_info_t NETWORK_MAPPING[] = { uint64_t get_chain_id(void) { uint64_t chain_id = 0; - char tmp[16] = {0}; switch (txContext.txType) { case LEGACY: @@ -39,24 +38,16 @@ uint64_t get_chain_id(void) { PRINTF("Txtype `%d` not supported while generating chainID\n", txContext.txType); break; } - u64_to_string(chain_id, tmp, sizeof(tmp)); - PRINTF("\n\nTMP: %s\n", tmp); return chain_id; } network_info_t *get_network(void) { uint64_t chain_id = get_chain_id(); - char tmp1[16]; - char tmp2[16]; for (uint8_t i = 0; i < sizeof(NETWORK_MAPPING) / sizeof(*NETWORK_MAPPING); i++) { - u64_to_string(NETWORK_MAPPING[i].chain_id, tmp1, sizeof(tmp1)); - u64_to_string(chain_id, tmp2, sizeof(tmp2)); - PRINTF("Comparing %s but wanted %s\n", tmp1, tmp2); if (NETWORK_MAPPING[i].chain_id == chain_id) { return (network_info_t *) PIC(&NETWORK_MAPPING[i]); } } - PRINTF("RETURNING NULL\n"); return NULL; } diff --git a/src_features/signTx/logic_signTx.c b/src_features/signTx/logic_signTx.c index 8e291cc..ece60ed 100644 --- a/src_features/signTx/logic_signTx.c +++ b/src_features/signTx/logic_signTx.c @@ -267,7 +267,6 @@ void prepareNetworkDisplay() { } else { // Network name found, simply copy it. strlcpy(strings.common.network_name, name, sizeof(strings.common.network_name)); - PRINTF("COPIED\n"); } } @@ -457,9 +456,6 @@ void finalizeParsing(bool direct) { // Prepare chainID field prepareNetworkDisplay(); - PRINTF("Network bytes: %.*H\n", - sizeof(strings.common.network_name), - strings.common.network_name); PRINTF("Network: %s\n", strings.common.network_name); bool no_consent; diff --git a/src_features/signTx/ui_common_signTx.c b/src_features/signTx/ui_common_signTx.c index e535410..dc7e3d8 100644 --- a/src_features/signTx/ui_common_signTx.c +++ b/src_features/signTx/ui_common_signTx.c @@ -39,8 +39,11 @@ unsigned int io_seproxyhal_touch_tx_ok(__attribute__((unused)) const bagl_elemen G_io_apdu_buffer[0] = 27; } else { // New API - // Note that this is wrong for a large v, but the client can always recover - uint64_t v = u64_from_BE(tmpContent.txContent.v, tmpContent.txContent.vLength); + // Note that this is wrong for a large v, but ledgerjs will recover. + + // Casting to u32 not to introduce breaking changes. In the future, this should be + // updated. + uint32_t v = U4BE(tmpContent.txContent.v, 0); G_io_apdu_buffer[0] = (v * 2) + 35; } if (info & CX_ECCINFO_PARITY_ODD) { diff --git a/src_features/signTx/ui_flow_signTx.c b/src_features/signTx/ui_flow_signTx.c index 7b47212..b508ee5 100644 --- a/src_features/signTx/ui_flow_signTx.c +++ b/src_features/signTx/ui_flow_signTx.c @@ -224,7 +224,6 @@ void ux_approve_tx(bool fromPlugin) { uint64_t chain_id = get_chain_id(); if (chainConfig->chainId == ETHEREUM_MAINNET_CHAINID && chain_id != chainConfig->chainId) { - PRINTF("ADDED GET CHAIN ID\n"); ux_approval_tx_flow[step++] = &ux_approval_network_step; }