diff --git a/app/Makefile.version b/app/Makefile.version index f86d41b..9f35a33 100644 --- a/app/Makefile.version +++ b/app/Makefile.version @@ -3,4 +3,4 @@ APPVERSION_M=0 # This is the minor version APPVERSION_N=0 # This is the patch version -APPVERSION_P=8 +APPVERSION_P=9 diff --git a/app/src/addr.h b/app/src/addr.h index 2245856..eb61650 100644 --- a/app/src/addr.h +++ b/app/src/addr.h @@ -19,6 +19,9 @@ #ifdef __cplusplus extern "C" { #endif +#include + +#include "zxerror.h" // Return the number of items in the address view zxerr_t addr_getNumItems(uint8_t *num_items); diff --git a/app/src/apdu_handler.c b/app/src/apdu_handler.c index dca0f62..d9b9942 100644 --- a/app/src/apdu_handler.c +++ b/app/src/apdu_handler.c @@ -45,12 +45,10 @@ void extractHDPath(uint32_t rx, uint32_t offset) { memcpy(hdPath, G_io_apdu_buffer + offset, sizeof(uint32_t) * HDPATH_LEN_DEFAULT); - const bool mainnet = hdPath[0] == HDPATH_0_DEFAULT && hdPath[1] == HDPATH_1_DEFAULT; - - hdPath_len = HDPATH_LEN_DEFAULT; - if (!mainnet) { + if (hdPath[0] != HDPATH_0_DEFAULT || ((hdPath[1] != HDPATH_1_DEFAULT) && (hdPath[1] != HDPATH_ETH_1_DEFAULT))) { THROW(APDU_CODE_DATA_INVALID); } + hdPath_len = HDPATH_LEN_DEFAULT; } uint8_t extractHRP(uint32_t rx, uint32_t offset) { diff --git a/app/src/eth_addr.h b/app/src/eth_addr.h index 9b9f0aa..20e7e2d 100644 --- a/app/src/eth_addr.h +++ b/app/src/eth_addr.h @@ -19,6 +19,9 @@ #ifdef __cplusplus extern "C" { #endif +#include + +#include "zxerror.h" /// Return the number of items in the address view zxerr_t eth_addr_getNumItems(uint8_t *num_items); diff --git a/app/src/eth_erc20.h b/app/src/eth_erc20.h index 2fe18e6..ba53731 100644 --- a/app/src/eth_erc20.h +++ b/app/src/eth_erc20.h @@ -1,25 +1,25 @@ /******************************************************************************* -* (c) 2018 - 2023 Zondax AG -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -********************************************************************************/ + * (c) 2018 - 2023 Zondax AG + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ********************************************************************************/ #pragma once #include + +#include "coin.h" #include "parser_common.h" #include "rlp.h" -#include "coin.h" - #ifdef __cplusplus extern "C" { @@ -34,8 +34,7 @@ typedef struct { bool validateERC20(rlp_t data); parser_error_t getERC20Token(const rlp_t *data, char tokenSymbol[MAX_SYMBOL_LEN], uint8_t *decimals); -parser_error_t printERC20Value(const rlp_t *data, char *outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount); +parser_error_t printERC20Value(const rlp_t *data, char *outVal, uint16_t outValLen, uint8_t pageIdx, uint8_t *pageCount); #ifdef __cplusplus } diff --git a/app/src/eth_utils.h b/app/src/eth_utils.h index d511863..8debb44 100644 --- a/app/src/eth_utils.h +++ b/app/src/eth_utils.h @@ -1,23 +1,24 @@ /******************************************************************************* -* (c) 2018 - 2023 Zondax AG -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -********************************************************************************/ + * (c) 2018 - 2023 Zondax AG + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ********************************************************************************/ #pragma once #include #include + #include "parser_common.h" #include "rlp.h" @@ -26,12 +27,11 @@ extern "C" { #endif typedef enum RlpError { - rlp_ok = 0, - rlp_no_data, - rlp_invalid_data, + rlp_ok = 0, + rlp_no_data, + rlp_invalid_data, } rlp_error_t; - // Add two numbers returning UINT64_MAX if overflows uint64_t saturating_add(uint64_t a, uint64_t b); @@ -42,8 +42,7 @@ uint32_t saturating_add_u32(uint32_t a, uint32_t b); // Gets the number of bytes read and the number of bytes to read // // Returns false if there is a error in the rlp encoded data, true otherwise. -rlp_error_t get_tx_rlp_len(const uint8_t *buffer, uint32_t len, uint64_t *read, - uint64_t *to_read); +rlp_error_t get_tx_rlp_len(const uint8_t *buffer, uint32_t len, uint64_t *read, uint64_t *to_read); // Use to decode rlp data pointed by data. // sets itemOffset to point to encoded data like item = data[itemOffset], and sets its len. @@ -54,11 +53,9 @@ rlp_error_t parse_rlp_item(const uint8_t *data, uint32_t dataLen, uint32_t *read // returns 0 on success, a negative number otherwise parser_error_t be_bytes_to_u64(const uint8_t *bytes, uint8_t len, uint64_t *num); -parser_error_t printRLPNumber(const rlp_t *num, char* outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount); +parser_error_t printRLPNumber(const rlp_t *num, char *outVal, uint16_t outValLen, uint8_t pageIdx, uint8_t *pageCount); -parser_error_t printEVMAddress(const rlp_t *address, char* outVal, uint16_t outValLen, - uint8_t pageIdx, uint8_t *pageCount); +parser_error_t printEVMAddress(const rlp_t *address, char *outVal, uint16_t outValLen, uint8_t pageIdx, uint8_t *pageCount); #ifdef __cplusplus } #endif diff --git a/app/src/hash.h b/app/src/hash.h index c040d60..c8289c7 100644 --- a/app/src/hash.h +++ b/app/src/hash.h @@ -19,6 +19,8 @@ #ifdef __cplusplus extern "C" { #endif +#include + #include "zxerror.h" const char *hash_parse(); diff --git a/app/src/parser_impl.c b/app/src/parser_impl.c index ea2b6d8..b753443 100644 --- a/app/src/parser_impl.c +++ b/app/src/parser_impl.c @@ -159,20 +159,17 @@ parser_error_t getNumItems(const parser_context_t *ctx, uint8_t *numItems) { switch (ctx->tx_obj->tx_type) { case p_export_tx: // Tx + fee + Amounts(= n_outs) + Addresses - *numItems = 2 + ctx->tx_obj->tx.p_export_tx.secp_outs.n_addrs + - parser_get_renderable_outputs_number(ctx->tx_obj->tx.p_export_tx.secp_outs.out_render_mask) + + *numItems = 2 + ctx->tx_obj->tx.p_export_tx.secp_outs.n_addrs + ctx->tx_obj->tx.p_export_tx.secp_outs.n_outs + expertModeHashField; break; case p_import_tx: // Tx + fee + Amounts(= n_outs) + Addresses *numItems = 2 + ctx->tx_obj->tx.p_import_tx.base_secp_outs.n_addrs + - parser_get_renderable_outputs_number(ctx->tx_obj->tx.p_import_tx.base_secp_outs.out_render_mask) + - expertModeHashField; + ctx->tx_obj->tx.p_import_tx.base_secp_outs.n_outs + expertModeHashField; break; case c_export_tx: // Tx + fee + Amounts(= n_outs) + Addresses - *numItems = 2 + ctx->tx_obj->tx.c_export_tx.secp_outs.n_addrs + - parser_get_renderable_outputs_number(ctx->tx_obj->tx.c_export_tx.secp_outs.out_render_mask) + + *numItems = 2 + ctx->tx_obj->tx.c_export_tx.secp_outs.n_addrs + ctx->tx_obj->tx.c_export_tx.secp_outs.n_outs + expertModeHashField; break; case c_import_tx: diff --git a/app/src/parser_impl_common.c b/app/src/parser_impl_common.c index c289ee6..a4d9d76 100644 --- a/app/src/parser_impl_common.c +++ b/app/src/parser_impl_common.c @@ -193,36 +193,11 @@ parser_error_t parse_evm_inputs(parser_context_t *c, evm_inputs_t *evm) { return parser_ok; } -bool parser_output_contains_change_address(parser_context_t *c) { - bool contains = false; - // verify address is renderable compare with CHANGE ADDRESS -#if defined(TARGET_NANOS) || defined(TARGET_NANOS2) || defined(TARGET_NANOX) || defined(TARGET_STAX) - CTX_CHECK_AVAIL(c, ADDRESS_LEN) - if (MEMCMP(c->buffer + c->offset, change_address, ADDRESS_LEN) == 0) { - contains = false; - } else { - contains = true; - } -#else - uint8_t test_change_address[ADDRESS_LEN] = {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa}; - - CTX_CHECK_AVAIL(c, ADDRESS_LEN) - if (MEMCMP(c->buffer + c->offset, test_change_address, ADDRESS_LEN) == 0) { - contains = false; - } else { - contains = true; - } -#endif - return contains; -} - parser_error_t parse_transferable_secp_output(parser_context_t *c, transferable_out_secp_t *outputs, bool verify_locktime) { if (outputs == NULL) { return parser_unexpected_error; } outputs->out_sum = 0; - bool is_renderable = false; for (uint32_t i = 0; i < outputs->n_outs; i++) { // skip assetId @@ -259,19 +234,9 @@ parser_error_t parse_transferable_secp_output(parser_context_t *c, transferable_ return parser_unexpected_threshold; } - // Following AVAX logic 99.99% of tx have only one address, so we should test if it matches the change_address, in - // case the output has more then one address then the output should be rendered with all its addresses - if (tmp_n_adresses == 1) { - is_renderable = parser_output_contains_change_address(c); - outputs->out_render_mask |= (is_renderable ? 1 : 0) << i; + for (uint32_t j = 0; j < tmp_n_adresses; j++) { verifyBytes(c, ADDRESS_LEN); - outputs->n_addrs = is_renderable ? (outputs->n_addrs + 1) : outputs->n_addrs; - } else { - outputs->out_render_mask |= 1 << i; - for (uint32_t j = 0; j < tmp_n_adresses; j++) { - verifyBytes(c, ADDRESS_LEN); - outputs->n_addrs++; - } + outputs->n_addrs++; } } @@ -283,11 +248,9 @@ parser_error_t parse_evm_output(parser_context_t *c, evm_outs_t *outputs) { return parser_unexpected_error; } outputs->out_sum = 0; - uint8_t is_renderable = 0; + for (uint32_t i = 0; i < outputs->n_outs; i++) { // Check address is renderable - is_renderable = parser_output_contains_change_address(c); - outputs->out_render_mask |= (is_renderable ? 1 : 0) << i; verifyBytes(c, ADDRESS_LEN); // Save amount to total @@ -399,31 +362,27 @@ parser_error_t parser_get_secp_output_for_index(parser_context_t *out_ctx, trans uint64_t count = 0; uint32_t out_n_addr = 0; for (uint32_t i = 0; i < secp_outs.n_outs; i++) { - if ((secp_outs.out_render_mask & (1 << i)) == 0) { - CHECK_ERROR(parser_go_to_next_transferable_output(out_ctx)); - } else { - // read amount and check if its the index we are looking for return element 0 for amount print - CHECK_ERROR(verifyBytes(out_ctx, AMOUNT_OFFSET)); - CHECK_ERROR(read_u64(out_ctx, amount)); + // read amount and check if its the index we are looking for return element 0 for amount print + CHECK_ERROR(verifyBytes(out_ctx, AMOUNT_OFFSET)); + CHECK_ERROR(read_u64(out_ctx, amount)); + if (count == inner_displayIdx) { + *element_idx = 0; + return parser_ok; + } + + CHECK_ERROR(verifyBytes(out_ctx, N_ADDRESS_OFFSET)); + CHECK_ERROR(read_u32(out_ctx, &out_n_addr)); + // Go through output addresses and check if its the index we are looking for return element >0 for address print + for (uint32_t j = 1; j <= out_n_addr; j++) { + CHECK_ERROR(readBytes(out_ctx, address, ADDRESS_LEN)); + count++; if (count == inner_displayIdx) { - *element_idx = 0; + *element_idx = j; return parser_ok; } - - CHECK_ERROR(verifyBytes(out_ctx, N_ADDRESS_OFFSET)); - CHECK_ERROR(read_u32(out_ctx, &out_n_addr)); - // Go through output addresses and check if its the index we are looking for return element >0 for address print - for (uint32_t j = 1; j <= out_n_addr; j++) { - CHECK_ERROR(readBytes(out_ctx, address, ADDRESS_LEN)); - count++; - if (count == inner_displayIdx) { - *element_idx = j; - return parser_ok; - } - } - // We did not find the index in the address add one for the next amoount we are about to read - count++; } + // We did not find the index in the address add one for the next amoount we are about to read + count++; } return parser_unexpected_number_items; } @@ -436,18 +395,14 @@ parser_error_t parser_get_evm_output_index(parser_context_t *out_ctx, evm_outs_t uint64_t count = 0; for (uint32_t i = 0; i < evm_outs.n_outs; i++) { - if ((evm_outs.out_render_mask & (1 << i)) == 0) { - CHECK_ERROR(parser_go_to_next_transferable_output(out_ctx)); - } else { - CHECK_ERROR(readBytes(out_ctx, address, ADDRESS_LEN)); - CHECK_ERROR(read_u64(out_ctx, amount)); - CHECK_ERROR(verifyBytes(out_ctx, ASSET_ID_LEN)); + CHECK_ERROR(readBytes(out_ctx, address, ADDRESS_LEN)); + CHECK_ERROR(read_u64(out_ctx, amount)); + CHECK_ERROR(verifyBytes(out_ctx, ASSET_ID_LEN)); - if (count == out_index) { - return parser_ok; - } - count++; + if (count == out_index) { + return parser_ok; } + count++; } return parser_unexpected_number_items; } diff --git a/app/src/parser_impl_eth.c b/app/src/parser_impl_eth.c index 48f7684..e13e2e3 100644 --- a/app/src/parser_impl_eth.c +++ b/app/src/parser_impl_eth.c @@ -31,6 +31,8 @@ eth_tx_t eth_tx_obj; #define FLARE_MAINNET_CHAINID 14 +#define SONG_BIRD_CHAINID 19 +#define COSTON2_CHAINID 114 static parser_error_t readChainID(parser_context_t *ctx, rlp_t *chainId) { if (ctx == NULL || chainId == NULL) { @@ -49,7 +51,7 @@ static parser_error_t readChainID(parser_context_t *ctx, rlp_t *chainId) { } // Check allowed values for chain id - if (tmpChainId != FLARE_MAINNET_CHAINID) { + if (tmpChainId != FLARE_MAINNET_CHAINID && tmpChainId != SONG_BIRD_CHAINID && tmpChainId != COSTON2_CHAINID) { return parser_invalid_chain_id; } diff --git a/app/src/parser_txdef.h b/app/src/parser_txdef.h index 697f18d..0c5f7dd 100644 --- a/app/src/parser_txdef.h +++ b/app/src/parser_txdef.h @@ -105,7 +105,6 @@ typedef struct { const uint8_t *outs; uint16_t outs_offset; uint64_t out_sum; - uint64_t out_render_mask; uint32_t n_addrs; } transferable_out_secp_t; @@ -132,7 +131,6 @@ typedef struct { const uint8_t *outs; uint16_t outs_offset; uint64_t out_sum; - uint64_t out_render_mask; } evm_outs_t; typedef struct { diff --git a/app/src/rlp_def.h b/app/src/rlp_def.h index 2667518..2be33fb 100644 --- a/app/src/rlp_def.h +++ b/app/src/rlp_def.h @@ -1,18 +1,18 @@ /******************************************************************************* -* (c) 2018 - 2023 ZondaX AG -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -********************************************************************************/ + * (c) 2018 - 2023 ZondaX AG + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ********************************************************************************/ #pragma once @@ -20,8 +20,8 @@ extern "C" { #endif -#include #include +#include typedef enum { RLP_KIND_BYTE = 0, @@ -29,19 +29,19 @@ typedef enum { RLP_KIND_LIST, } rlp_kind_e; -#define RLP_KIND_BYTE_PREFIX 0x7F +#define RLP_KIND_BYTE_PREFIX 0x7F -#define RLP_KIND_STRING_SHORT_MIN 0x80 -#define RLP_KIND_STRING_SHORT_MAX 0xB7 +#define RLP_KIND_STRING_SHORT_MIN 0x80 +#define RLP_KIND_STRING_SHORT_MAX 0xB7 -#define RLP_KIND_STRING_LONG_MIN 0x80 -#define RLP_KIND_STRING_LONG_MAX 0xBF +#define RLP_KIND_STRING_LONG_MIN 0x80 +#define RLP_KIND_STRING_LONG_MAX 0xBF -#define RLP_KIND_LIST_SHORT_MIN 0xC0 -#define RLP_KIND_LIST_SHORT_MAX 0xF7 +#define RLP_KIND_LIST_SHORT_MIN 0xC0 +#define RLP_KIND_LIST_SHORT_MAX 0xF7 -#define RLP_KIND_LIST_LONG_MIN 0xF8 -#define RLP_KIND_LIST_LONG_MAX 0xFF +#define RLP_KIND_LIST_LONG_MIN 0xF8 +#define RLP_KIND_LIST_LONG_MAX 0xFF typedef struct { uint8_t kind; diff --git a/app/src/tx_cchain.c b/app/src/tx_cchain.c index 7d04224..1b5c9df 100644 --- a/app/src/tx_cchain.c +++ b/app/src/tx_cchain.c @@ -121,8 +121,7 @@ parser_error_t print_c_export_tx(const parser_context_t *ctx, uint8_t displayIdx } // print ampount and addresses - if (displayIdx <= ctx->tx_obj->tx.c_export_tx.secp_outs.n_addrs + - parser_get_renderable_outputs_number(ctx->tx_obj->tx.c_export_tx.secp_outs.out_render_mask)) { + if (displayIdx <= ctx->tx_obj->tx.c_export_tx.secp_outs.n_addrs + ctx->tx_obj->tx.c_export_tx.secp_outs.n_outs) { parser_context_t output_ctx = {.buffer = ctx->tx_obj->tx.c_export_tx.secp_outs.outs, .bufferLen = ctx->bufferLen - ctx->tx_obj->tx.c_export_tx.secp_outs.outs_offset + 1, .offset = 0, @@ -147,8 +146,7 @@ parser_error_t print_c_export_tx(const parser_context_t *ctx, uint8_t displayIdx return parser_ok; } - if (displayIdx == ctx->tx_obj->tx.c_export_tx.secp_outs.n_addrs + - parser_get_renderable_outputs_number(ctx->tx_obj->tx.c_export_tx.secp_outs.out_render_mask) + 1) { + if (displayIdx == ctx->tx_obj->tx.c_export_tx.secp_outs.n_addrs + ctx->tx_obj->tx.c_export_tx.secp_outs.n_outs + 1) { snprintf(outKey, outKeyLen, "Fee"); uint64_t fee = ctx->tx_obj->tx.c_export_tx.evm_inputs.in_sum - ctx->tx_obj->tx.c_export_tx.secp_outs.out_sum; CHECK_ERROR( @@ -156,9 +154,7 @@ parser_error_t print_c_export_tx(const parser_context_t *ctx, uint8_t displayIdx return parser_ok; } - if (displayIdx == ctx->tx_obj->tx.c_export_tx.secp_outs.n_addrs + - parser_get_renderable_outputs_number(ctx->tx_obj->tx.c_export_tx.secp_outs.out_render_mask) + 1 + - 1) { + if (displayIdx == ctx->tx_obj->tx.c_export_tx.secp_outs.n_addrs + ctx->tx_obj->tx.c_export_tx.secp_outs.n_outs + 1 + 1) { snprintf(outKey, outKeyLen, "Hash"); printHash(ctx, outVal, outValLen, pageIdx, pageCount); return parser_ok; diff --git a/app/src/tx_pchain.c b/app/src/tx_pchain.c index e643437..91fc493 100644 --- a/app/src/tx_pchain.c +++ b/app/src/tx_pchain.c @@ -246,8 +246,7 @@ parser_error_t print_p_export_tx(const parser_context_t *ctx, uint8_t displayIdx } // print ampount and addresses - if (displayIdx <= ctx->tx_obj->tx.p_export_tx.secp_outs.n_addrs + - parser_get_renderable_outputs_number(ctx->tx_obj->tx.p_export_tx.secp_outs.out_render_mask)) { + if (displayIdx <= ctx->tx_obj->tx.p_export_tx.secp_outs.n_addrs + ctx->tx_obj->tx.p_export_tx.secp_outs.n_outs) { // Create new context parser for outputs parser_context_t output_ctx = {.buffer = ctx->tx_obj->tx.p_export_tx.secp_outs.outs, .bufferLen = ctx->bufferLen - ctx->tx_obj->tx.p_export_tx.secp_outs.outs_offset + 1, @@ -273,8 +272,7 @@ parser_error_t print_p_export_tx(const parser_context_t *ctx, uint8_t displayIdx return parser_ok; } - if (displayIdx == ctx->tx_obj->tx.p_export_tx.secp_outs.n_addrs + - parser_get_renderable_outputs_number(ctx->tx_obj->tx.p_export_tx.secp_outs.out_render_mask) + 1) { + if (displayIdx == ctx->tx_obj->tx.p_export_tx.secp_outs.n_addrs + ctx->tx_obj->tx.p_export_tx.secp_outs.n_outs + 1) { snprintf(outKey, outKeyLen, "Fee"); uint64_t fee = ctx->tx_obj->tx.p_export_tx.base_secp_ins.in_sum - (ctx->tx_obj->tx.p_export_tx.base_secp_outs.out_sum + ctx->tx_obj->tx.p_export_tx.secp_outs.out_sum); @@ -283,9 +281,7 @@ parser_error_t print_p_export_tx(const parser_context_t *ctx, uint8_t displayIdx return parser_ok; } - if (displayIdx == ctx->tx_obj->tx.p_export_tx.secp_outs.n_addrs + - parser_get_renderable_outputs_number(ctx->tx_obj->tx.p_export_tx.secp_outs.out_render_mask) + 1 + - 1) { + if (displayIdx == ctx->tx_obj->tx.p_export_tx.secp_outs.n_addrs + ctx->tx_obj->tx.p_export_tx.secp_outs.n_outs + 1 + 1) { snprintf(outKey, outKeyLen, "Hash"); printHash(ctx, outVal, outValLen, pageIdx, pageCount); return parser_ok; diff --git a/deps/ledger-zxlib b/deps/ledger-zxlib index df81cb7..f19112b 160000 --- a/deps/ledger-zxlib +++ b/deps/ledger-zxlib @@ -1 +1 @@ -Subproject commit df81cb767d464995327218f0fb92eaa2dd3b4db3 +Subproject commit f19112bb6340721c276af459924b3c4261c0291a diff --git a/deps/nanos-secure-sdk b/deps/nanos-secure-sdk index 0532bf2..62dd047 160000 --- a/deps/nanos-secure-sdk +++ b/deps/nanos-secure-sdk @@ -1 +1 @@ -Subproject commit 0532bf20fbbb11dd08dada62060f8337097b6078 +Subproject commit 62dd047774b5e8a6b4e6158b493ee029453b5bae diff --git a/deps/nanosplus-secure-sdk b/deps/nanosplus-secure-sdk index a01a99c..276361f 160000 --- a/deps/nanosplus-secure-sdk +++ b/deps/nanosplus-secure-sdk @@ -1 +1 @@ -Subproject commit a01a99cf008672556991c4126066531024ce48df +Subproject commit 276361fa25b4a1781b732567b557dcbc4f99ebf2 diff --git a/deps/nanox-secure-sdk b/deps/nanox-secure-sdk index a01a99c..276361f 160000 --- a/deps/nanox-secure-sdk +++ b/deps/nanox-secure-sdk @@ -1 +1 @@ -Subproject commit a01a99cf008672556991c4126066531024ce48df +Subproject commit 276361fa25b4a1781b732567b557dcbc4f99ebf2 diff --git a/docs/APDUSPEC.md b/docs/APDUSPEC.md index ab492a2..2f572f4 100644 --- a/docs/APDUSPEC.md +++ b/docs/APDUSPEC.md @@ -72,7 +72,6 @@ The general structure of commands and responses is as follows: ### INS_GET_ADDR -Derivation Path can #### Command | Field | Type | Content | Expected | @@ -106,7 +105,7 @@ Derivation Path can | Field | Type | Content | Expected | | ----- | -------- | ---------------------- | --------- | -| CLA | byte (1) | Application Identifier | 0x98 | +| CLA | byte (1) | Application Identifier | 0x58 | | INS | byte (1) | Instruction ID | 0x02 | | P1 | byte (1) | Payload desc | 0 = init | | | | | 1 = add | @@ -123,7 +122,120 @@ All other packets/chunks contain data chunks that are described below | Field | Type | Content | Expected | | ------- | -------- | -------------------- | -------- | | Path[0] | byte (4) | Derivation Path Data | 44 | -| Path[1] | byte (4) | Derivation Path Data | 9000 | +| Path[1] | byte (4) | Derivation Path Data | 9000 or 60| +| Path[2] | byte (4) | Derivation Path Data | ? | +| Path[3] | byte (4) | Derivation Path Data | ? | +| Path[4] | byte (4) | Derivation Path Data | ? | + +##### Other Chunks/Packets + +| Field | Type | Content | Expected | +| ------- | -------- | --------------- | -------- | +| Message | bytes... | Message to Sign | | + +#### Response + +| Field | Type | Content | Note | +| ------- | --------- | ----------- | ------------------------ | +| SIG | byte (65) | Signature | | +| SW1-SW2 | byte (2) | Return code | see list of return codes | + +--- + +### INS_SIGN_HASH + +#### Command + +| Field | Type | Content | Expected | +| ----- | -------- | ---------------------- | --------- | +| CLA | byte (1) | Application Identifier | 0x58 | +| INS | byte (1) | Instruction ID | 0x03 | +| P1 | byte (1) | Payload desc | 0 = init | +| | | | 1 = add | +| | | | 2 = last | +| P2 | byte (1) | ---- | not used | +| L | byte (1) | Bytes in payload | (depends) | + +The first packet/chunk includes only the derivation path + +All other packets/chunks contain data chunks that are described below + +##### First Packet + +| Field | Type | Content | Expected | +| ------- | -------- | -------------------- | -------- | +| Path[0] | byte (4) | Derivation Path Data | 44 | +| Path[1] | byte (4) | Derivation Path Data | 9000 or 60 | +| Path[2] | byte (4) | Derivation Path Data | ? | +| Path[3] | byte (4) | Derivation Path Data | ? | +| Path[4] | byte (4) | Derivation Path Data | ? | + +##### Other Chunks/Packets + +| Field | Type | Content | Expected | +| ------- | -------- | --------------- | -------- | +| Message | bytes... | Hash to Sign | | + +#### Response + +| Field | Type | Content | Note | +| ------- | --------- | ----------- | ------------------------ | +| SIG | byte (65) | Signature | | +| SW1-SW2 | byte (2) | Return code | see list of return codes | + +--- + +### INS_GET_ADDR_ETH + +#### Command + +| Field | Type | Content | Expected | +| ------- | --------------- | ------------------------- | ----------------- | +| CLA | byte (1) | Application Identifier | 0xE0 | +| INS | byte (1) | Instruction ID | 0x02 | +| P1 | byte (1) | Request User confirmation | No = 0 | +| P2 | byte (1) | Parameter 2 | ignored | +| L | byte (1) | Bytes in payload | (depends) | +| Path[0] | byte (4) | Derivation Path Data | 0x8000002c | +| Path[1] | byte (4) | Derivation Path Data | 0x8000003c | +| Path[2] | byte (4) | Derivation Path Data | ? | +| Path[3] | byte (4) | Derivation Path Data | ? | +| Path[4] | byte (4) | Derivation Path Data | ? | + +#### Response + +| Field | Type | Content | Note | +| ------- | --------- | ----------- | ------------------------ | +| PK | byte (33) | Public Key | Compressed public key | +| ADDR | byte (??) | address | Bech32 encoded address | +| SW1-SW2 | byte (2) | Return code | see list of return codes | + +--- + +### INS_SIGN_ETH + +#### Command + +| Field | Type | Content | Expected | +| ----- | -------- | ---------------------- | --------- | +| CLA | byte (1) | Application Identifier | 0xE0 | +| INS | byte (1) | Instruction ID | 0x04 | +| P1 | byte (1) | Payload desc | 0 = init | +| | | | 1 = add | +| | | | 2 = last | +| P2 | byte (1) | ---- | not used | +| L | byte (1) | Bytes in payload | (depends) | + +The first packet/chunk includes only the derivation path + +All other packets/chunks contain data chunks that are described below + +##### First Packet + +| Field | Type | Content | Expected | +| ------- | -------- | -------------------- | -------- | +| Path[0] | byte (4) | Derivation Path Data | 44 | +| Path[1] | byte (4) | Derivation Path Data | 60 | | Path[2] | byte (4) | Derivation Path Data | ? | | Path[3] | byte (4) | Derivation Path Data | ? | | Path[4] | byte (4) | Derivation Path Data | ? | diff --git a/tests/testvectors/testcases.json b/tests/testvectors/testcases.json index 3c23229..c999f39 100644 --- a/tests/testvectors/testcases.json +++ b/tests/testvectors/testcases.json @@ -1,23 +1,29 @@ [ { "index": 1, - "name": "Export_Tx_with_change_address", + "name": "Export_Tx_2_address", "blob": "0000000000010000007278db5c30bed04c05ce209179812850bbb3fe6d46d7eef3744d814c0da55524790000000000000000000000000000000000000000000000000000000000000000000000015a6a8c28a2fc040df3b7490440c50f00099c957a000000028fb5f04058734f94af871c3d131b56131b6fb7a0291eacadd261e69dfb42a9cdf6f7fddd000000000000001c0000000258734f94af871c3d131b56131b6fb7a0291eacadd261e69dfb42a9cdf6f7fddd0000000700000002541b264000000000000000000000000100000001db89a2339639a5f3fa183258cfea265e4d1cce6c58734f94af871c3d131b56131b6fb7a0291eacadd261e69dfb42a9cdf6f7fddd00000007000000000000000000000000000000000000000100000001aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "output": [ "0 | Export : C to P chain", "1 | Amount : 10.001 C2FLR", "2 | Address [1/2] : costwo1mwy6yvuk8xjl87scxfvvl63xtex3enn", "2 | Address [2/2] : vwcckmr", - "3 | Fee : 1 C2FLR" + "3 | Amount : 0 C2FLR", + "4 | Address [1/2] : costwo14242424242424242424242424242424", + "4 | Address [2/2] : 28ew7nj", + "5 | Fee : 1 C2FLR" ], "output_expert": [ "0 | Export : C to P chain", "1 | Amount : 10.001 C2FLR", "2 | Address [1/2] : costwo1mwy6yvuk8xjl87scxfvvl63xtex3enn", "2 | Address [2/2] : vwcckmr", - "3 | Fee : 1 C2FLR", - "4 | Hash [1/2] : fca356a36fa8ab1b3b6a6a7e5ff58cc7dc82bb", - "4 | Hash [2/2] : 09110093c93820fc45d72c776e" + "3 | Amount : 0 C2FLR", + "4 | Address [1/2] : costwo14242424242424242424242424242424", + "4 | Address [2/2] : 28ew7nj", + "5 | Fee : 1 C2FLR", + "6 | Hash [1/2] : fca356a36fa8ab1b3b6a6a7e5ff58cc7dc82bb", + "6 | Hash [2/2] : 09110093c93820fc45d72c776e" ] }, { diff --git a/tests_zemu/package.json b/tests_zemu/package.json index 4959f10..b66bb6a 100644 --- a/tests_zemu/package.json +++ b/tests_zemu/package.json @@ -19,13 +19,13 @@ }, "dependencies": { "@zondax/ledger-flare": "../js", - "@zondax/zemu": "^0.46.1" + "@zondax/zemu": "^0.47.0" }, "devDependencies": { "@ethereumjs/common": "^2.4.0", "@ethereumjs/tx": "^3.2.0", "@types/elliptic": "^6.4.14", - "@types/jest": "^29.5.11", + "@types/jest": "^29.5.12", "@types/ledgerhq__hw-transport": "^4.21.4", "@types/secp256k1": "^4.0.6", "@typescript-eslint/eslint-plugin": "^6.19.0", @@ -33,17 +33,17 @@ "blakejs": "^1.1.1", "crypto-js": "4.2.0", "ed25519-supercop": "^2.0.1", - "eslint": "^8.55.0", + "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.24.2", - "eslint-plugin-jest": "^27.6.3", + "eslint-plugin-jest": "^27.9.0", "eslint-plugin-prettier": "^5.1.3", "jest": "29.7.0", "js-sha256": "0.9.0", "jssha": "^3.2.0", - "prettier": "^3.2.2", + "prettier": "^3.2.5", "secp256k1": "^5.0.0", - "ts-jest": "^29.0.3", + "ts-jest": "^29.1.2", "ts-node": "^10.9.2", "typescript": "^5.3.3" } diff --git a/tests_zemu/snapshots/s-mainmenu/00004.png b/tests_zemu/snapshots/s-mainmenu/00004.png index 0a43213..d9de24d 100644 Binary files a/tests_zemu/snapshots/s-mainmenu/00004.png and b/tests_zemu/snapshots/s-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/s-mainmenu/00010.png b/tests_zemu/snapshots/s-mainmenu/00010.png index 0a43213..d9de24d 100644 Binary files a/tests_zemu/snapshots/s-mainmenu/00010.png and b/tests_zemu/snapshots/s-mainmenu/00010.png differ diff --git a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00005.png b/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00005.png deleted file mode 100644 index c4aabdc..0000000 Binary files a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00006.png b/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00006.png deleted file mode 100644 index 2a4d0dc..0000000 Binary files a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00007.png b/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00007.png deleted file mode 100644 index 006c26a..0000000 Binary files a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00008.png b/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00008.png deleted file mode 100644 index a0d6c57..0000000 Binary files a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00008.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00000.png b/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00000.png deleted file mode 100644 index 21ca4e3..0000000 Binary files a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00001.png b/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00001.png deleted file mode 100644 index b0a05f9..0000000 Binary files a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00002.png b/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00002.png deleted file mode 100644 index f8af9d1..0000000 Binary files a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00003.png b/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00003.png deleted file mode 100644 index db28995..0000000 Binary files a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00004.png b/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00004.png deleted file mode 100644 index 3a29a41..0000000 Binary files a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00000.png b/tests_zemu/snapshots/s-sign-tx-eth-path/00000.png similarity index 100% rename from tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00000.png rename to tests_zemu/snapshots/s-sign-tx-eth-path/00000.png diff --git a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00001.png b/tests_zemu/snapshots/s-sign-tx-eth-path/00001.png similarity index 100% rename from tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00001.png rename to tests_zemu/snapshots/s-sign-tx-eth-path/00001.png diff --git a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00002.png b/tests_zemu/snapshots/s-sign-tx-eth-path/00002.png similarity index 100% rename from tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00002.png rename to tests_zemu/snapshots/s-sign-tx-eth-path/00002.png diff --git a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00003.png b/tests_zemu/snapshots/s-sign-tx-eth-path/00003.png similarity index 100% rename from tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00003.png rename to tests_zemu/snapshots/s-sign-tx-eth-path/00003.png diff --git a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00004.png b/tests_zemu/snapshots/s-sign-tx-eth-path/00004.png similarity index 100% rename from tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr-expert/00004.png rename to tests_zemu/snapshots/s-sign-tx-eth-path/00004.png diff --git a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00005.png b/tests_zemu/snapshots/s-sign-tx-eth-path/00005.png similarity index 100% rename from tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00005.png rename to tests_zemu/snapshots/s-sign-tx-eth-path/00005.png diff --git a/tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00006.png b/tests_zemu/snapshots/s-sign-tx-eth-path/00006.png similarity index 100% rename from tests_zemu/snapshots/s-sign-flare_c_export_p_change_addr/00006.png rename to tests_zemu/snapshots/s-sign-tx-eth-path/00006.png diff --git a/tests_zemu/snapshots/sp-eth-asset_deposit/00001.png b/tests_zemu/snapshots/sp-eth-asset_deposit/00001.png index e642da4..3abb523 100644 Binary files a/tests_zemu/snapshots/sp-eth-asset_deposit/00001.png and b/tests_zemu/snapshots/sp-eth-asset_deposit/00001.png differ diff --git a/tests_zemu/snapshots/sp-eth-asset_deposit/00002.png b/tests_zemu/snapshots/sp-eth-asset_deposit/00002.png index 6f53271..1affffc 100644 Binary files a/tests_zemu/snapshots/sp-eth-asset_deposit/00002.png and b/tests_zemu/snapshots/sp-eth-asset_deposit/00002.png differ diff --git a/tests_zemu/snapshots/sp-eth-asset_deposit/00003.png b/tests_zemu/snapshots/sp-eth-asset_deposit/00003.png index f85aaf0..ddc733d 100644 Binary files a/tests_zemu/snapshots/sp-eth-asset_deposit/00003.png and b/tests_zemu/snapshots/sp-eth-asset_deposit/00003.png differ diff --git a/tests_zemu/snapshots/sp-eth-asset_transfer/00001.png b/tests_zemu/snapshots/sp-eth-asset_transfer/00001.png index e642da4..3abb523 100644 Binary files a/tests_zemu/snapshots/sp-eth-asset_transfer/00001.png and b/tests_zemu/snapshots/sp-eth-asset_transfer/00001.png differ diff --git a/tests_zemu/snapshots/sp-eth-asset_transfer/00002.png b/tests_zemu/snapshots/sp-eth-asset_transfer/00002.png index 6f53271..1affffc 100644 Binary files a/tests_zemu/snapshots/sp-eth-asset_transfer/00002.png and b/tests_zemu/snapshots/sp-eth-asset_transfer/00002.png differ diff --git a/tests_zemu/snapshots/sp-eth-asset_transfer/00003.png b/tests_zemu/snapshots/sp-eth-asset_transfer/00003.png index f85aaf0..ddc733d 100644 Binary files a/tests_zemu/snapshots/sp-eth-asset_transfer/00003.png and b/tests_zemu/snapshots/sp-eth-asset_transfer/00003.png differ diff --git a/tests_zemu/snapshots/sp-eth-basic_transfer/00001.png b/tests_zemu/snapshots/sp-eth-basic_transfer/00001.png index e642da4..3abb523 100644 Binary files a/tests_zemu/snapshots/sp-eth-basic_transfer/00001.png and b/tests_zemu/snapshots/sp-eth-basic_transfer/00001.png differ diff --git a/tests_zemu/snapshots/sp-eth-basic_transfer/00002.png b/tests_zemu/snapshots/sp-eth-basic_transfer/00002.png index 69a0b3c..e22fe60 100644 Binary files a/tests_zemu/snapshots/sp-eth-basic_transfer/00002.png and b/tests_zemu/snapshots/sp-eth-basic_transfer/00002.png differ diff --git a/tests_zemu/snapshots/sp-eth-basic_transfer/00003.png b/tests_zemu/snapshots/sp-eth-basic_transfer/00003.png index 82949e5..6a81290 100644 Binary files a/tests_zemu/snapshots/sp-eth-basic_transfer/00003.png and b/tests_zemu/snapshots/sp-eth-basic_transfer/00003.png differ diff --git a/tests_zemu/snapshots/sp-eth-basic_transfer_no_eip155/00001.png b/tests_zemu/snapshots/sp-eth-basic_transfer_no_eip155/00001.png index e642da4..3abb523 100644 Binary files a/tests_zemu/snapshots/sp-eth-basic_transfer_no_eip155/00001.png and b/tests_zemu/snapshots/sp-eth-basic_transfer_no_eip155/00001.png differ diff --git a/tests_zemu/snapshots/sp-eth-basic_transfer_no_eip155/00002.png b/tests_zemu/snapshots/sp-eth-basic_transfer_no_eip155/00002.png index a1d3ec5..74c8f1d 100644 Binary files a/tests_zemu/snapshots/sp-eth-basic_transfer_no_eip155/00002.png and b/tests_zemu/snapshots/sp-eth-basic_transfer_no_eip155/00002.png differ diff --git a/tests_zemu/snapshots/sp-eth-basic_transfer_no_eip155/00003.png b/tests_zemu/snapshots/sp-eth-basic_transfer_no_eip155/00003.png index 81b3302..de352b4 100644 Binary files a/tests_zemu/snapshots/sp-eth-basic_transfer_no_eip155/00003.png and b/tests_zemu/snapshots/sp-eth-basic_transfer_no_eip155/00003.png differ diff --git a/tests_zemu/snapshots/sp-eth-contract_deploy_no_eip155/00001.png b/tests_zemu/snapshots/sp-eth-contract_deploy_no_eip155/00001.png index e642da4..3abb523 100644 Binary files a/tests_zemu/snapshots/sp-eth-contract_deploy_no_eip155/00001.png and b/tests_zemu/snapshots/sp-eth-contract_deploy_no_eip155/00001.png differ diff --git a/tests_zemu/snapshots/sp-eth-contract_deploy_no_eip155/00002.png b/tests_zemu/snapshots/sp-eth-contract_deploy_no_eip155/00002.png index a358496..d1846b4 100644 Binary files a/tests_zemu/snapshots/sp-eth-contract_deploy_no_eip155/00002.png and b/tests_zemu/snapshots/sp-eth-contract_deploy_no_eip155/00002.png differ diff --git a/tests_zemu/snapshots/sp-eth-contract_deploy_no_eip155/00003.png b/tests_zemu/snapshots/sp-eth-contract_deploy_no_eip155/00003.png index 7e95c9b..b4f186f 100644 Binary files a/tests_zemu/snapshots/sp-eth-contract_deploy_no_eip155/00003.png and b/tests_zemu/snapshots/sp-eth-contract_deploy_no_eip155/00003.png differ diff --git a/tests_zemu/snapshots/sp-eth-erc20_transfer/00004.png b/tests_zemu/snapshots/sp-eth-erc20_transfer/00004.png index 2348ba0..e25bff1 100644 Binary files a/tests_zemu/snapshots/sp-eth-erc20_transfer/00004.png and b/tests_zemu/snapshots/sp-eth-erc20_transfer/00004.png differ diff --git a/tests_zemu/snapshots/sp-eth-erc20_transfer/00005.png b/tests_zemu/snapshots/sp-eth-erc20_transfer/00005.png index 05e0b94..fd51cc1 100644 Binary files a/tests_zemu/snapshots/sp-eth-erc20_transfer/00005.png and b/tests_zemu/snapshots/sp-eth-erc20_transfer/00005.png differ diff --git a/tests_zemu/snapshots/sp-eth-erc721_approve_for_all/00001.png b/tests_zemu/snapshots/sp-eth-erc721_approve_for_all/00001.png index e642da4..3abb523 100644 Binary files a/tests_zemu/snapshots/sp-eth-erc721_approve_for_all/00001.png and b/tests_zemu/snapshots/sp-eth-erc721_approve_for_all/00001.png differ diff --git a/tests_zemu/snapshots/sp-eth-erc721_approve_for_all/00002.png b/tests_zemu/snapshots/sp-eth-erc721_approve_for_all/00002.png index 5c624aa..b6a7ade 100644 Binary files a/tests_zemu/snapshots/sp-eth-erc721_approve_for_all/00002.png and b/tests_zemu/snapshots/sp-eth-erc721_approve_for_all/00002.png differ diff --git a/tests_zemu/snapshots/sp-eth-erc721_approve_for_all/00003.png b/tests_zemu/snapshots/sp-eth-erc721_approve_for_all/00003.png index 1c2ba34..960df6b 100644 Binary files a/tests_zemu/snapshots/sp-eth-erc721_approve_for_all/00003.png and b/tests_zemu/snapshots/sp-eth-erc721_approve_for_all/00003.png differ diff --git a/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from/00001.png b/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from/00001.png index e642da4..3abb523 100644 Binary files a/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from/00001.png and b/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from/00001.png differ diff --git a/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from/00002.png b/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from/00002.png index 8fe9804..6519b9a 100644 Binary files a/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from/00002.png and b/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from/00002.png differ diff --git a/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from/00003.png b/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from/00003.png index b8a4795..01d4a60 100644 Binary files a/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from/00003.png and b/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from/00003.png differ diff --git a/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from_data/00001.png b/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from_data/00001.png index e642da4..3abb523 100644 Binary files a/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from_data/00001.png and b/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from_data/00001.png differ diff --git a/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from_data/00002.png b/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from_data/00002.png index 602beee..63bea66 100644 Binary files a/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from_data/00002.png and b/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from_data/00002.png differ diff --git a/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from_data/00003.png b/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from_data/00003.png index f03b47c..2ebbaaa 100644 Binary files a/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from_data/00003.png and b/tests_zemu/snapshots/sp-eth-erc721_safe_transfer_from_data/00003.png differ diff --git a/tests_zemu/snapshots/sp-eth-legacy_contract_call/00001.png b/tests_zemu/snapshots/sp-eth-legacy_contract_call/00001.png index e642da4..3abb523 100644 Binary files a/tests_zemu/snapshots/sp-eth-legacy_contract_call/00001.png and b/tests_zemu/snapshots/sp-eth-legacy_contract_call/00001.png differ diff --git a/tests_zemu/snapshots/sp-eth-legacy_contract_call/00002.png b/tests_zemu/snapshots/sp-eth-legacy_contract_call/00002.png index 8e057e8..ea9d3a0 100644 Binary files a/tests_zemu/snapshots/sp-eth-legacy_contract_call/00002.png and b/tests_zemu/snapshots/sp-eth-legacy_contract_call/00002.png differ diff --git a/tests_zemu/snapshots/sp-eth-legacy_contract_call/00003.png b/tests_zemu/snapshots/sp-eth-legacy_contract_call/00003.png index 17f541c..087dd8b 100644 Binary files a/tests_zemu/snapshots/sp-eth-legacy_contract_call/00003.png and b/tests_zemu/snapshots/sp-eth-legacy_contract_call/00003.png differ diff --git a/tests_zemu/snapshots/sp-eth-legacy_contract_deploy/00001.png b/tests_zemu/snapshots/sp-eth-legacy_contract_deploy/00001.png index e642da4..3abb523 100644 Binary files a/tests_zemu/snapshots/sp-eth-legacy_contract_deploy/00001.png and b/tests_zemu/snapshots/sp-eth-legacy_contract_deploy/00001.png differ diff --git a/tests_zemu/snapshots/sp-eth-legacy_contract_deploy/00002.png b/tests_zemu/snapshots/sp-eth-legacy_contract_deploy/00002.png index bf0a105..ef8139f 100644 Binary files a/tests_zemu/snapshots/sp-eth-legacy_contract_deploy/00002.png and b/tests_zemu/snapshots/sp-eth-legacy_contract_deploy/00002.png differ diff --git a/tests_zemu/snapshots/sp-eth-legacy_contract_deploy/00003.png b/tests_zemu/snapshots/sp-eth-legacy_contract_deploy/00003.png index 6a687fa..840ab0c 100644 Binary files a/tests_zemu/snapshots/sp-eth-legacy_contract_deploy/00003.png and b/tests_zemu/snapshots/sp-eth-legacy_contract_deploy/00003.png differ diff --git a/tests_zemu/snapshots/sp-eth-legacy_transfer/00001.png b/tests_zemu/snapshots/sp-eth-legacy_transfer/00001.png index e642da4..3abb523 100644 Binary files a/tests_zemu/snapshots/sp-eth-legacy_transfer/00001.png and b/tests_zemu/snapshots/sp-eth-legacy_transfer/00001.png differ diff --git a/tests_zemu/snapshots/sp-eth-legacy_transfer/00002.png b/tests_zemu/snapshots/sp-eth-legacy_transfer/00002.png index e90dcb6..91a6d0a 100644 Binary files a/tests_zemu/snapshots/sp-eth-legacy_transfer/00002.png and b/tests_zemu/snapshots/sp-eth-legacy_transfer/00002.png differ diff --git a/tests_zemu/snapshots/sp-eth-legacy_transfer/00003.png b/tests_zemu/snapshots/sp-eth-legacy_transfer/00003.png index aa55800..639d8eb 100644 Binary files a/tests_zemu/snapshots/sp-eth-legacy_transfer/00003.png and b/tests_zemu/snapshots/sp-eth-legacy_transfer/00003.png differ diff --git a/tests_zemu/snapshots/sp-eth-transfer/00001.png b/tests_zemu/snapshots/sp-eth-transfer/00001.png index e642da4..3abb523 100644 Binary files a/tests_zemu/snapshots/sp-eth-transfer/00001.png and b/tests_zemu/snapshots/sp-eth-transfer/00001.png differ diff --git a/tests_zemu/snapshots/sp-eth-transfer/00002.png b/tests_zemu/snapshots/sp-eth-transfer/00002.png index c399f6b..7c1fc11 100644 Binary files a/tests_zemu/snapshots/sp-eth-transfer/00002.png and b/tests_zemu/snapshots/sp-eth-transfer/00002.png differ diff --git a/tests_zemu/snapshots/sp-eth-transfer/00003.png b/tests_zemu/snapshots/sp-eth-transfer/00003.png index 65f9877..24b2f0b 100644 Binary files a/tests_zemu/snapshots/sp-eth-transfer/00003.png and b/tests_zemu/snapshots/sp-eth-transfer/00003.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00001.png b/tests_zemu/snapshots/sp-mainmenu/00001.png index e10e004..8472e5d 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00001.png and b/tests_zemu/snapshots/sp-mainmenu/00001.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00002.png b/tests_zemu/snapshots/sp-mainmenu/00002.png index 7e236da..f792167 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00002.png and b/tests_zemu/snapshots/sp-mainmenu/00002.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00003.png b/tests_zemu/snapshots/sp-mainmenu/00003.png index e10e004..8472e5d 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00003.png and b/tests_zemu/snapshots/sp-mainmenu/00003.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00004.png b/tests_zemu/snapshots/sp-mainmenu/00004.png index 0e0c3d0..e1aee92 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00004.png and b/tests_zemu/snapshots/sp-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00010.png b/tests_zemu/snapshots/sp-mainmenu/00010.png index 0e0c3d0..e1aee92 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00010.png and b/tests_zemu/snapshots/sp-mainmenu/00010.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00011.png b/tests_zemu/snapshots/sp-mainmenu/00011.png index e10e004..8472e5d 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00011.png and b/tests_zemu/snapshots/sp-mainmenu/00011.png differ diff --git a/tests_zemu/snapshots/sp-show_address/00001.png b/tests_zemu/snapshots/sp-show_address/00001.png index bad0ee7..58718da 100644 Binary files a/tests_zemu/snapshots/sp-show_address/00001.png and b/tests_zemu/snapshots/sp-show_address/00001.png differ diff --git a/tests_zemu/snapshots/sp-show_address_reject/00001.png b/tests_zemu/snapshots/sp-show_address_reject/00001.png index bad0ee7..58718da 100644 Binary files a/tests_zemu/snapshots/sp-show_address_reject/00001.png and b/tests_zemu/snapshots/sp-show_address_reject/00001.png differ diff --git a/tests_zemu/snapshots/sp-show_address_reject/00003.png b/tests_zemu/snapshots/sp-show_address_reject/00003.png index d9b5efc..de8a291 100644 Binary files a/tests_zemu/snapshots/sp-show_address_reject/00003.png and b/tests_zemu/snapshots/sp-show_address_reject/00003.png differ diff --git a/tests_zemu/snapshots/sp-sign-add_delegator-expert/00001.png b/tests_zemu/snapshots/sp-sign-add_delegator-expert/00001.png index ba14ce7..914e0a2 100644 Binary files a/tests_zemu/snapshots/sp-sign-add_delegator-expert/00001.png and b/tests_zemu/snapshots/sp-sign-add_delegator-expert/00001.png differ diff --git a/tests_zemu/snapshots/sp-sign-add_delegator-expert/00002.png b/tests_zemu/snapshots/sp-sign-add_delegator-expert/00002.png index 3030cd3..6c64955 100644 Binary files a/tests_zemu/snapshots/sp-sign-add_delegator-expert/00002.png and b/tests_zemu/snapshots/sp-sign-add_delegator-expert/00002.png differ diff --git a/tests_zemu/snapshots/sp-sign-add_delegator-expert/00005.png b/tests_zemu/snapshots/sp-sign-add_delegator-expert/00005.png index 08270ed..9a37b22 100644 Binary files a/tests_zemu/snapshots/sp-sign-add_delegator-expert/00005.png and b/tests_zemu/snapshots/sp-sign-add_delegator-expert/00005.png differ diff --git a/tests_zemu/snapshots/sp-sign-add_delegator/00001.png b/tests_zemu/snapshots/sp-sign-add_delegator/00001.png index ba14ce7..914e0a2 100644 Binary files a/tests_zemu/snapshots/sp-sign-add_delegator/00001.png and b/tests_zemu/snapshots/sp-sign-add_delegator/00001.png differ diff --git a/tests_zemu/snapshots/sp-sign-add_delegator/00002.png b/tests_zemu/snapshots/sp-sign-add_delegator/00002.png index 3030cd3..6c64955 100644 Binary files a/tests_zemu/snapshots/sp-sign-add_delegator/00002.png and b/tests_zemu/snapshots/sp-sign-add_delegator/00002.png differ diff --git a/tests_zemu/snapshots/sp-sign-add_delegator/00005.png b/tests_zemu/snapshots/sp-sign-add_delegator/00005.png index 08270ed..9a37b22 100644 Binary files a/tests_zemu/snapshots/sp-sign-add_delegator/00005.png and b/tests_zemu/snapshots/sp-sign-add_delegator/00005.png differ diff --git a/tests_zemu/snapshots/sp-sign-add_validator-expert/00001.png b/tests_zemu/snapshots/sp-sign-add_validator-expert/00001.png index ba14ce7..914e0a2 100644 Binary files a/tests_zemu/snapshots/sp-sign-add_validator-expert/00001.png and b/tests_zemu/snapshots/sp-sign-add_validator-expert/00001.png differ diff --git a/tests_zemu/snapshots/sp-sign-add_validator-expert/00002.png b/tests_zemu/snapshots/sp-sign-add_validator-expert/00002.png index 3030cd3..6c64955 100644 Binary files a/tests_zemu/snapshots/sp-sign-add_validator-expert/00002.png and b/tests_zemu/snapshots/sp-sign-add_validator-expert/00002.png differ diff --git a/tests_zemu/snapshots/sp-sign-add_validator-expert/00005.png b/tests_zemu/snapshots/sp-sign-add_validator-expert/00005.png index 08270ed..9a37b22 100644 Binary files a/tests_zemu/snapshots/sp-sign-add_validator-expert/00005.png and b/tests_zemu/snapshots/sp-sign-add_validator-expert/00005.png differ diff --git a/tests_zemu/snapshots/sp-sign-add_validator/00001.png b/tests_zemu/snapshots/sp-sign-add_validator/00001.png index ba14ce7..914e0a2 100644 Binary files a/tests_zemu/snapshots/sp-sign-add_validator/00001.png and b/tests_zemu/snapshots/sp-sign-add_validator/00001.png differ diff --git a/tests_zemu/snapshots/sp-sign-add_validator/00002.png b/tests_zemu/snapshots/sp-sign-add_validator/00002.png index 3030cd3..6c64955 100644 Binary files a/tests_zemu/snapshots/sp-sign-add_validator/00002.png and b/tests_zemu/snapshots/sp-sign-add_validator/00002.png differ diff --git a/tests_zemu/snapshots/sp-sign-add_validator/00005.png b/tests_zemu/snapshots/sp-sign-add_validator/00005.png index 08270ed..9a37b22 100644 Binary files a/tests_zemu/snapshots/sp-sign-add_validator/00005.png and b/tests_zemu/snapshots/sp-sign-add_validator/00005.png differ diff --git a/tests_zemu/snapshots/sp-sign-coston_export_c_to_p-expert/00003.png b/tests_zemu/snapshots/sp-sign-coston_export_c_to_p-expert/00003.png index 564da30..b7972ac 100644 Binary files a/tests_zemu/snapshots/sp-sign-coston_export_c_to_p-expert/00003.png and b/tests_zemu/snapshots/sp-sign-coston_export_c_to_p-expert/00003.png differ diff --git a/tests_zemu/snapshots/sp-sign-coston_export_c_to_p/00003.png b/tests_zemu/snapshots/sp-sign-coston_export_c_to_p/00003.png index 564da30..b7972ac 100644 Binary files a/tests_zemu/snapshots/sp-sign-coston_export_c_to_p/00003.png and b/tests_zemu/snapshots/sp-sign-coston_export_c_to_p/00003.png differ diff --git a/tests_zemu/snapshots/sp-sign-coston_export_p_to_c-expert/00003.png b/tests_zemu/snapshots/sp-sign-coston_export_p_to_c-expert/00003.png index 564da30..b7972ac 100644 Binary files a/tests_zemu/snapshots/sp-sign-coston_export_p_to_c-expert/00003.png and b/tests_zemu/snapshots/sp-sign-coston_export_p_to_c-expert/00003.png differ diff --git a/tests_zemu/snapshots/sp-sign-coston_export_p_to_c/00003.png b/tests_zemu/snapshots/sp-sign-coston_export_p_to_c/00003.png index 564da30..b7972ac 100644 Binary files a/tests_zemu/snapshots/sp-sign-coston_export_p_to_c/00003.png and b/tests_zemu/snapshots/sp-sign-coston_export_p_to_c/00003.png differ diff --git a/tests_zemu/snapshots/sp-sign-coston_import_p_from_c-expert/00003.png b/tests_zemu/snapshots/sp-sign-coston_import_p_from_c-expert/00003.png index 564da30..b7972ac 100644 Binary files a/tests_zemu/snapshots/sp-sign-coston_import_p_from_c-expert/00003.png and b/tests_zemu/snapshots/sp-sign-coston_import_p_from_c-expert/00003.png differ diff --git a/tests_zemu/snapshots/sp-sign-coston_import_p_from_c/00003.png b/tests_zemu/snapshots/sp-sign-coston_import_p_from_c/00003.png index 564da30..b7972ac 100644 Binary files a/tests_zemu/snapshots/sp-sign-coston_import_p_from_c/00003.png and b/tests_zemu/snapshots/sp-sign-coston_import_p_from_c/00003.png differ diff --git a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00003.png b/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00003.png deleted file mode 100644 index 564da30..0000000 Binary files a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00005.png b/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00005.png deleted file mode 100644 index b80926a..0000000 Binary files a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00006.png b/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00006.png deleted file mode 100644 index 2c60451..0000000 Binary files a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00007.png b/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00007.png deleted file mode 100644 index 1e4be69..0000000 Binary files a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00008.png b/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00008.png deleted file mode 100644 index 1a4c3b9..0000000 Binary files a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00008.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr/00003.png b/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr/00003.png deleted file mode 100644 index 564da30..0000000 Binary files a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign-flare_export_c_to_p-expert/00003.png b/tests_zemu/snapshots/sp-sign-flare_export_c_to_p-expert/00003.png index aca34f3..ae481d8 100644 Binary files a/tests_zemu/snapshots/sp-sign-flare_export_c_to_p-expert/00003.png and b/tests_zemu/snapshots/sp-sign-flare_export_c_to_p-expert/00003.png differ diff --git a/tests_zemu/snapshots/sp-sign-flare_export_c_to_p/00003.png b/tests_zemu/snapshots/sp-sign-flare_export_c_to_p/00003.png index aca34f3..ae481d8 100644 Binary files a/tests_zemu/snapshots/sp-sign-flare_export_c_to_p/00003.png and b/tests_zemu/snapshots/sp-sign-flare_export_c_to_p/00003.png differ diff --git a/tests_zemu/snapshots/sp-sign-flare_export_p_to_c-expert/00003.png b/tests_zemu/snapshots/sp-sign-flare_export_p_to_c-expert/00003.png index aca34f3..ae481d8 100644 Binary files a/tests_zemu/snapshots/sp-sign-flare_export_p_to_c-expert/00003.png and b/tests_zemu/snapshots/sp-sign-flare_export_p_to_c-expert/00003.png differ diff --git a/tests_zemu/snapshots/sp-sign-flare_export_p_to_c/00003.png b/tests_zemu/snapshots/sp-sign-flare_export_p_to_c/00003.png index aca34f3..ae481d8 100644 Binary files a/tests_zemu/snapshots/sp-sign-flare_export_p_to_c/00003.png and b/tests_zemu/snapshots/sp-sign-flare_export_p_to_c/00003.png differ diff --git a/tests_zemu/snapshots/sp-sign-flare_import_p_from_c-expert/00003.png b/tests_zemu/snapshots/sp-sign-flare_import_p_from_c-expert/00003.png index aca34f3..ae481d8 100644 Binary files a/tests_zemu/snapshots/sp-sign-flare_import_p_from_c-expert/00003.png and b/tests_zemu/snapshots/sp-sign-flare_import_p_from_c-expert/00003.png differ diff --git a/tests_zemu/snapshots/sp-sign-flare_import_p_from_c/00003.png b/tests_zemu/snapshots/sp-sign-flare_import_p_from_c/00003.png index aca34f3..ae481d8 100644 Binary files a/tests_zemu/snapshots/sp-sign-flare_import_p_from_c/00003.png and b/tests_zemu/snapshots/sp-sign-flare_import_p_from_c/00003.png differ diff --git a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00000.png b/tests_zemu/snapshots/sp-sign-tx-eth-path/00000.png similarity index 100% rename from tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00000.png rename to tests_zemu/snapshots/sp-sign-tx-eth-path/00000.png diff --git a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00001.png b/tests_zemu/snapshots/sp-sign-tx-eth-path/00001.png similarity index 100% rename from tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00001.png rename to tests_zemu/snapshots/sp-sign-tx-eth-path/00001.png diff --git a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00002.png b/tests_zemu/snapshots/sp-sign-tx-eth-path/00002.png similarity index 100% rename from tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00002.png rename to tests_zemu/snapshots/sp-sign-tx-eth-path/00002.png diff --git a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00003.png b/tests_zemu/snapshots/sp-sign-tx-eth-path/00003.png similarity index 100% rename from tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00003.png rename to tests_zemu/snapshots/sp-sign-tx-eth-path/00003.png diff --git a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00004.png b/tests_zemu/snapshots/sp-sign-tx-eth-path/00004.png similarity index 100% rename from tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr-expert/00004.png rename to tests_zemu/snapshots/sp-sign-tx-eth-path/00004.png diff --git a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr/00005.png b/tests_zemu/snapshots/sp-sign-tx-eth-path/00005.png similarity index 100% rename from tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr/00005.png rename to tests_zemu/snapshots/sp-sign-tx-eth-path/00005.png diff --git a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr/00006.png b/tests_zemu/snapshots/sp-sign-tx-eth-path/00006.png similarity index 100% rename from tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr/00006.png rename to tests_zemu/snapshots/sp-sign-tx-eth-path/00006.png diff --git a/tests_zemu/snapshots/st-mainmenu/00001.png b/tests_zemu/snapshots/st-mainmenu/00001.png index 37dc858..3948400 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00001.png and b/tests_zemu/snapshots/st-mainmenu/00001.png differ diff --git a/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr-expert/00002.png b/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr-expert/00002.png deleted file mode 100644 index c515dc9..0000000 Binary files a/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr-expert/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr/00000.png b/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr/00000.png deleted file mode 100644 index a044689..0000000 Binary files a/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr/00001.png b/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr/00001.png deleted file mode 100644 index 222330e..0000000 Binary files a/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr/00003.png b/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr/00003.png deleted file mode 100644 index 4cbcef1..0000000 Binary files a/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr/00003.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr/00004.png b/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr/00004.png deleted file mode 100644 index dacc7cd..0000000 Binary files a/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr-expert/00000.png b/tests_zemu/snapshots/st-sign-tx-eth-path/00000.png similarity index 100% rename from tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr-expert/00000.png rename to tests_zemu/snapshots/st-sign-tx-eth-path/00000.png diff --git a/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr-expert/00001.png b/tests_zemu/snapshots/st-sign-tx-eth-path/00001.png similarity index 100% rename from tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr-expert/00001.png rename to tests_zemu/snapshots/st-sign-tx-eth-path/00001.png diff --git a/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr/00002.png b/tests_zemu/snapshots/st-sign-tx-eth-path/00002.png similarity index 100% rename from tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr/00002.png rename to tests_zemu/snapshots/st-sign-tx-eth-path/00002.png diff --git a/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr-expert/00003.png b/tests_zemu/snapshots/st-sign-tx-eth-path/00003.png similarity index 100% rename from tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr-expert/00003.png rename to tests_zemu/snapshots/st-sign-tx-eth-path/00003.png diff --git a/tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr-expert/00004.png b/tests_zemu/snapshots/st-sign-tx-eth-path/00004.png similarity index 100% rename from tests_zemu/snapshots/st-sign-flare_c_export_p_change_addr-expert/00004.png rename to tests_zemu/snapshots/st-sign-tx-eth-path/00004.png diff --git a/tests_zemu/snapshots/x-mainmenu/00004.png b/tests_zemu/snapshots/x-mainmenu/00004.png index 0e0c3d0..e1aee92 100644 Binary files a/tests_zemu/snapshots/x-mainmenu/00004.png and b/tests_zemu/snapshots/x-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/x-mainmenu/00010.png b/tests_zemu/snapshots/x-mainmenu/00010.png index 0e0c3d0..e1aee92 100644 Binary files a/tests_zemu/snapshots/x-mainmenu/00010.png and b/tests_zemu/snapshots/x-mainmenu/00010.png differ diff --git a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00000.png b/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00000.png deleted file mode 100644 index fe99275..0000000 Binary files a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00001.png b/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00001.png deleted file mode 100644 index eb9d49b..0000000 Binary files a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00002.png b/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00002.png deleted file mode 100644 index 3dbb87f..0000000 Binary files a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00004.png b/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00004.png deleted file mode 100644 index f2c38f6..0000000 Binary files a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00005.png b/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00005.png deleted file mode 100644 index b80926a..0000000 Binary files a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00005.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00006.png b/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00006.png deleted file mode 100644 index 2c60451..0000000 Binary files a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00007.png b/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00007.png deleted file mode 100644 index 1e4be69..0000000 Binary files a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00007.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00008.png b/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00008.png deleted file mode 100644 index 1a4c3b9..0000000 Binary files a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr-expert/00008.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00000.png b/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00000.png deleted file mode 100644 index fe99275..0000000 Binary files a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00000.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00001.png b/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00001.png deleted file mode 100644 index eb9d49b..0000000 Binary files a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00001.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00002.png b/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00002.png deleted file mode 100644 index 3dbb87f..0000000 Binary files a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00002.png and /dev/null differ diff --git a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00004.png b/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00004.png deleted file mode 100644 index f2c38f6..0000000 Binary files a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00004.png and /dev/null differ diff --git a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr/00000.png b/tests_zemu/snapshots/x-sign-tx-eth-path/00000.png similarity index 100% rename from tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr/00000.png rename to tests_zemu/snapshots/x-sign-tx-eth-path/00000.png diff --git a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr/00001.png b/tests_zemu/snapshots/x-sign-tx-eth-path/00001.png similarity index 100% rename from tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr/00001.png rename to tests_zemu/snapshots/x-sign-tx-eth-path/00001.png diff --git a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr/00002.png b/tests_zemu/snapshots/x-sign-tx-eth-path/00002.png similarity index 100% rename from tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr/00002.png rename to tests_zemu/snapshots/x-sign-tx-eth-path/00002.png diff --git a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00003.png b/tests_zemu/snapshots/x-sign-tx-eth-path/00003.png similarity index 100% rename from tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00003.png rename to tests_zemu/snapshots/x-sign-tx-eth-path/00003.png diff --git a/tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr/00004.png b/tests_zemu/snapshots/x-sign-tx-eth-path/00004.png similarity index 100% rename from tests_zemu/snapshots/sp-sign-flare_c_export_p_change_addr/00004.png rename to tests_zemu/snapshots/x-sign-tx-eth-path/00004.png diff --git a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00005.png b/tests_zemu/snapshots/x-sign-tx-eth-path/00005.png similarity index 100% rename from tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00005.png rename to tests_zemu/snapshots/x-sign-tx-eth-path/00005.png diff --git a/tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00006.png b/tests_zemu/snapshots/x-sign-tx-eth-path/00006.png similarity index 100% rename from tests_zemu/snapshots/x-sign-flare_c_export_p_change_addr/00006.png rename to tests_zemu/snapshots/x-sign-tx-eth-path/00006.png diff --git a/tests_zemu/tests/transactions.test.ts b/tests_zemu/tests/transactions.test.ts index 264bafd..e2731b4 100644 --- a/tests_zemu/tests/transactions.test.ts +++ b/tests_zemu/tests/transactions.test.ts @@ -16,7 +16,7 @@ import Zemu from '@zondax/zemu' import FlareApp from '@zondax/ledger-flare' -import { models, hdpath, defaultOptions } from './common' +import { models, hdpath, defaultOptions, ETH_PATH } from './common' import secp256k1 from 'secp256k1' import { createHash } from 'crypto' import { sha256 } from 'js-sha256' @@ -93,13 +93,6 @@ const TEST_DATA = [ 'hex', ), }, - { - name: 'flare_c_export_p_change_addr', - blob: Buffer.from( - '0000000000010000007278db5c30bed04c05ce209179812850bbb3fe6d46d7eef3744d814c0da55524790000000000000000000000000000000000000000000000000000000000000000000000015a6a8c28a2fc040df3b7490440c50f00099c957a000000028fb5f04058734f94af871c3d131b56131b6fb7a0291eacadd261e69dfb42a9cdf6f7fddd000000000000001c0000000258734f94af871c3d131b56131b6fb7a0291eacadd261e69dfb42a9cdf6f7fddd0000000700000002541b264000000000000000000000000100000001db89a2339639a5f3fa183258cfea265e4d1cce6c58734f94af871c3d131b56131b6fb7a0291eacadd261e69dfb42a9cdf6f7fddd0000000700000000000000000000000000000000000000010000000125f4a6d0cd20b9472a78d002426e121031400bbc', - 'hex', - ), - }, ] jest.setTimeout(120000) @@ -235,4 +228,45 @@ describe.each(models)('Transactions', function (m) { await sim.close() } }) + + test.concurrent('sign tx with 44/60', async function () { + const sim = new Zemu(m.path) + try { + await sim.start({ ...defaultOptions, model: m.name }) + const app = new FlareApp(sim.getTransport()) + + const responseAddr = await app.getAddressAndPubKey(ETH_PATH) + expect(responseAddr.returnCode).toEqual(0x9000) + console.log(responseAddr) + + const pubKeyRaw = new Uint8Array(responseAddr.compressed_pk!) + const pubKey = secp256k1.publicKeyConvert(pubKeyRaw, true) + + const signatureRequest = app.sign(ETH_PATH, TEST_DATA[0].blob) + + await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot()) + await sim.compareSnapshotsAndApprove('.', `${m.prefix.toLowerCase()}-sign-tx-eth-path`) + + const signatureResponse = await signatureRequest + console.log(signatureResponse) + + expect(signatureResponse).toHaveProperty('s') + expect(signatureResponse).toHaveProperty('r') + expect(signatureResponse).toHaveProperty('v') + expect(signatureResponse.returnCode).toEqual(0x9000) + expect(signatureResponse.errorMessage).toEqual('No errors') + + const EC = new ec('secp256k1') + const signature_obj = { + r: signatureResponse.r!, + s: signatureResponse.s!, + } + // Now verify the signature + const message = createHash('sha256').update(TEST_DATA[0].blob).digest() + const valid = EC.verify(message, signature_obj, Buffer.from(pubKey), 'hex') + expect(valid).toEqual(true) + } finally { + await sim.close() + } + }) })