diff --git a/.github/workflows/check_version.yml b/.github/workflows/check_version.yml index d5430284..b0241a90 100644 --- a/.github/workflows/check_version.yml +++ b/.github/workflows/check_version.yml @@ -6,10 +6,12 @@ on: branches: - main - develop + - master # for safety reasons + - dev # for safety reasons jobs: configure: - runs-on: ubuntu-latest + runs-on: zondax-runners outputs: uid_gid: ${{ steps.get-user.outputs.uid_gid }} steps: @@ -18,15 +20,17 @@ jobs: get_version: needs: configure - runs-on: ubuntu-latest + runs-on: zondax-runners container: image: zondax/ledger-app-builder:latest options: --user ${{ needs.configure.outputs.uid_gid }} + env: + SDK_VARNAME: NANOSP_SDK outputs: version: ${{ steps.store-version.outputs.version }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - run: make version @@ -35,7 +39,7 @@ jobs: check_app_version: needs: get_version - runs-on: ubuntu-latest + runs-on: zondax-runners steps: - id: checkTag uses: mukunku/tag-exists-action@v1.0.0 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0b240304..f8a511d7 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -7,20 +7,23 @@ on: branches: - main - develop + - master # for safety reasons + - dev # for safety reasons jobs: analyse: name: Analyse + if: github.event.repository.private == false strategy: matrix: - sdk: ["$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK"] - runs-on: ubuntu-latest + sdk: ["$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK"] + runs-on: zondax-runners container: image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive diff --git a/.github/workflows/guidelines_enforcer.yml b/.github/workflows/guidelines_enforcer.yml index fdaf9f27..5b6fb339 100644 --- a/.github/workflows/guidelines_enforcer.yml +++ b/.github/workflows/guidelines_enforcer.yml @@ -12,12 +12,14 @@ on: workflow_dispatch: push: branches: - - master - main - develop + - master # for safety reasons + - dev # for safety reasons pull_request: jobs: guidelines_enforcer: + if: github.event.repository.private == false name: Call Ledger guidelines_enforcer uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index da6d771a..809edd61 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,10 +6,12 @@ on: branches: - main - develop + - master # for safety reasons + - dev # for safety reasons jobs: configure: - runs-on: ubuntu-latest + runs-on: zondax-runners outputs: uid_gid: ${{ steps.get-user.outputs.uid_gid }} steps: @@ -17,21 +19,38 @@ jobs: run: echo "uid_gid=$(id -u):$(id -g)" >> $GITHUB_OUTPUT build: - runs-on: ubuntu-latest + runs-on: zondax-runners steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y curl protobuf-compiler build-essential git wget unzip python3 python3-pip \ + libssl-dev libffi-dev libreadline-dev zlib1g-dev libbz2-dev libsqlite3-dev libncurses5-dev \ + libgdbm-dev libnss3-dev liblzma-dev libxml2-dev libxmlsec1-dev libffi-dev libyaml-dev - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true + - name: Install CMake 3.28 + run: | + wget https://github.com/Kitware/CMake/releases/download/v3.28.0/cmake-3.28.0-linux-x86_64.sh + sudo mkdir /opt/cmake + sudo sh cmake-3.28.0-linux-x86_64.sh --skip-license --prefix=/opt/cmake + sudo ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake + sudo ln -s /opt/cmake/bin/ctest /usr/local/bin/ctest + - name: Verify CMake version + run: cmake --version - name: Install deps run: | sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10 make deps + - name: Run CMake + run: mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make - run: make cpp_test build_ledger: needs: configure - runs-on: ubuntu-latest + runs-on: zondax-runners container: image: zondax/ledger-app-builder:latest options: --user ${{ needs.configure.outputs.uid_gid }} @@ -41,7 +60,7 @@ jobs: size: ${{steps.build.outputs.size}} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Build Standard app @@ -53,7 +72,7 @@ jobs: size_nano_s: needs: build_ledger - runs-on: ubuntu-latest + runs-on: zondax-runners env: NANOS_LIMIT_SIZE: 136 steps: @@ -62,29 +81,38 @@ jobs: [ ${{needs.build_ledger.outputs.size}} -le $NANOS_LIMIT_SIZE ] test_zemu: - runs-on: ubuntu-latest + runs-on: zondax-runners steps: - name: Test run: | id echo $HOME echo $DISPLAY + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y curl protobuf-compiler build-essential git wget unzip python3 python3-pip \ + libssl-dev libffi-dev libreadline-dev zlib1g-dev libbz2-dev libsqlite3-dev libncurses5-dev \ + libgdbm-dev libnss3-dev liblzma-dev libxml2-dev libxmlsec1-dev libffi-dev libyaml-dev - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev + - name: Install rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable - name: Install node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 + with: + node-version: 18 - name: Install yarn run: | npm install -g yarn - - name: Build Ledger app - run: make - - name: Build/Install build js deps - run: make zemu_install - - name: Run zemu tests - run: "cd tests_zemu; yarn test" + - name: Build and run zemu tests + run: | + make test_all - name: Upload Snapshots (only failure) if: ${{ failure() }} uses: actions/upload-artifact@v3 @@ -95,7 +123,7 @@ jobs: build_package_nanos: needs: [configure, build, build_ledger, test_zemu] if: ${{ github.ref == 'refs/heads/main' }} - runs-on: ubuntu-latest + runs-on: zondax-runners container: image: zondax/ledger-app-builder:latest options: --user ${{ needs.configure.outputs.uid_gid }} @@ -103,7 +131,7 @@ jobs: BOLOS_SDK: /opt/nanos-secure-sdk steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Install deps @@ -131,7 +159,7 @@ jobs: build_package_nanosp: needs: [configure, build, build_ledger, test_zemu] if: ${{ github.ref == 'refs/heads/main' }} - runs-on: ubuntu-latest + runs-on: zondax-runners container: image: zondax/ledger-app-builder:latest options: --user ${{ needs.configure.outputs.uid_gid }} @@ -139,7 +167,7 @@ jobs: BOLOS_SDK: /opt/nanosplus-secure-sdk steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Install deps @@ -163,3 +191,39 @@ jobs: tag_name: ${{ steps.nanosp.outputs.tag_name }} draft: false prerelease: false + + build_package_stax: + needs: [configure, build, build_ledger, test_zemu] + if: ${{ github.ref == 'refs/heads/main' }} + runs-on: zondax-runners + container: + image: zondax/ledger-app-builder:latest + options: --user ${{ needs.configure.outputs.uid_gid }} + env: + BOLOS_SDK: /opt/stax-secure-sdk + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + - name: Install deps + run: pip install ledgerblue + + - name: Build Stax + shell: bash -l {0} + run: | + make + - name: Set tag + id: stax + run: echo "tag_name=$(./app/pkg/installer_stax.sh version)" >> $GITHUB_OUTPUT + - name: Update Release + id: update_release_2 + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + files: | + ./app/pkg/installer_stax.sh + tag_name: ${{ steps.stax.outputs.tag_name }} + draft: false + prerelease: false diff --git a/.gitignore b/.gitignore index 8e9d7505..b59c810b 100644 --- a/.gitignore +++ b/.gitignore @@ -65,7 +65,6 @@ googletest-build/ CMakeFiles/ CMakeCache.txt unittests -*.cmake Testing/ cmake-build-fuzz/ diff --git a/CMakeLists.txt b/CMakeLists.txt index f713eb30..1b9da5fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,12 +13,31 @@ #* See the License for the specific language governing permissions and #* limitations under the License. #******************************************************************************** -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.28) +include("cmake/HunterGate.cmake") +HunterGate( + URL "https://github.com/cpp-pm/hunter/archive/v0.25.5.tar.gz" + SHA1 "a20151e4c0740ee7d0f9994476856d813cdead29" + LOCAL +) + +if(CMAKE_GENERATOR MATCHES "Ninja") + message(FATAL_ERROR "This project does not support the Ninja generator. " + "Please use Unix Makefiles or another supported generator. " + "This error is typical in CLion. In this case, switch to generator Unix Makefiles.") +endif() + +######################################################## project(ledger-filecoin VERSION 0.0.0) -enable_testing() -cmake_policy(SET CMP0025 NEW) set(CMAKE_CXX_STANDARD 20) +cmake_policy(SET CMP0025 NEW) +cmake_policy(SET CMP0144 NEW) + +set(HUNTER_STATUS_DEBUG ON) +set(HUNTER_TLS_VERIFY OFF) + +enable_testing() option(ENABLE_FUZZING "Build with fuzzing instrumentation and build fuzz targets" OFF) option(ENABLE_COVERAGE "Build with source code coverage instrumentation" OFF) @@ -28,7 +47,14 @@ string(APPEND CMAKE_C_FLAGS " -fno-omit-frame-pointer -g") string(APPEND CMAKE_CXX_FLAGS " -fno-omit-frame-pointer -g") string(APPEND CMAKE_LINKER_FLAGS " -fno-omit-frame-pointer -g") -add_definitions(-DAPP_STANDARD) +hunter_add_package(fmt) +find_package(fmt CONFIG REQUIRED) + +hunter_add_package(jsoncpp) +find_package(jsoncpp CONFIG REQUIRED) + +hunter_add_package(GTest) +find_package(GTest CONFIG REQUIRED) if (ENABLE_FUZZING) add_definitions(-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1) @@ -71,9 +97,6 @@ if (ENABLE_SANITIZERS) string(APPEND CMAKE_LINKER_FLAGS " -fsanitize=address,undefined -fsanitize-recover=address,undefined") endif () -include(cmake/conan/CMakeLists.txt) -add_subdirectory(cmake/gtest) - string(APPEND CMAKE_CXX_FLAGS " -fsanitize=address -fno-omit-frame-pointer") string(APPEND CMAKE_LINKER_FLAGS " -fsanitize=address -fno-omit-frame-pointer") @@ -144,13 +167,13 @@ target_include_directories(unittests PRIVATE target_link_libraries(unittests PRIVATE - gtest_main app_lib - CONAN_PKG::fmt - CONAN_PKG::jsoncpp) + GTest::gtest_main + fmt::fmt + JsonCpp::JsonCpp) add_compile_definitions(TESTVECTORS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/tests/") -add_test(unittests ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittests) +add_test(NAME unittests COMMAND unittests) set_tests_properties(unittests PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests) ############################################################## diff --git a/Makefile b/Makefile index 5f8c4744..5024ed20 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,7 @@ TESTS_JS_DIR = ifeq ($(BOLOS_SDK),) ZXLIB_COMPILE_STAX ?= 1 +PRODUCTION_BUILD ?= 0 include $(CURDIR)/deps/ledger-zxlib/dockerized_build.mk else default: @@ -33,6 +34,6 @@ default: endif test_all: - make + PRODUCTION_BUILD=1 make make zemu_install make zemu_test diff --git a/app/Makefile b/app/Makefile index fe073e2c..108bbdcb 100755 --- a/app/Makefile +++ b/app/Makefile @@ -26,6 +26,19 @@ include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.installer_script include $(BOLOS_SDK)/Makefile.defines +# Set the default value for PRODUCTION_BUILD to 0 if not already defined +PRODUCTION_BUILD ?= 0 + +# Display whether this is a production build or for internal use +ifeq ($(PRODUCTION_BUILD), 1) + $(info ************ PRODUCTION_BUILD = [PRODUCTION BUILD]) +else + $(info ************ PRODUCTION_BUILD = [INTERNAL USE]) +endif + +# Add the PRODUCTION_BUILD definition to the compiler flags +DEFINES += PRODUCTION_BUILD=$(PRODUCTION_BUILD) + include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.app_testing ifndef COIN diff --git a/app/Makefile.version b/app/Makefile.version index f9fd9ca8..a132885f 100644 --- a/app/Makefile.version +++ b/app/Makefile.version @@ -3,4 +3,4 @@ APPVERSION_M=0 # This is the minor version of this release APPVERSION_N=24 # This is the patch version of this release -APPVERSION_P=2 +APPVERSION_P=3 diff --git a/app/src/parser_impl.c b/app/src/parser_impl.c index 85d15d6f..9eaf38ce 100644 --- a/app/src/parser_impl.c +++ b/app/src/parser_impl.c @@ -23,7 +23,9 @@ #include "zxformat.h" #include #include "parser_invoke_evm.h" +#include "eth_erc20.h" +extern const uint8_t ERC20_TRANSFER_PREFIX[4]; parser_tx_t parser_tx_obj; const char *parser_getErrorDescription(parser_error_t err) { @@ -286,6 +288,14 @@ __Z_INLINE parser_error_t readMethod(fil_base_tx_t *tx, CborValue *value) { // Only one parameter is expected when ByteStringType is received. PARSER_ASSERT_OR_ERROR(itParams.remaining == 1, parser_value_out_of_range) tx->numparams = 1; + + // If Invoke + ERC20 Transfer discard encoded cbor bytes at the beginning + if (methodValue == INVOKE_EVM_METHOD + && tx->params[0] == 0x58 && tx->params[1] == ERC20_TRANSFER_DATA_LENGTH + && memcmp(tx->params+2, ERC20_TRANSFER_PREFIX, sizeof(ERC20_TRANSFER_PREFIX)) == 0) { + + MEMMOVE(tx->params, tx->params+2, ERC20_TRANSFER_DATA_LENGTH); + } break; } case CborInvalidType: diff --git a/app/src/parser_invoke_evm.c b/app/src/parser_invoke_evm.c index 05590769..3b8bf23f 100644 --- a/app/src/parser_invoke_evm.c +++ b/app/src/parser_invoke_evm.c @@ -79,6 +79,8 @@ parser_error_t printInvokeEVM(const fil_base_tx_t *txObj, return parser_value_out_of_range; } + *pageCount = 1; + const uint16_t addressIdentifier = txObj->to.buffer[0] << 8 | txObj->to.buffer[1]; if (txObj->value.len != 0 || txObj->to.len != F4_ETH_ADDRESS_BYTES_LEN || addressIdentifier != F4_ETH_ADDRESS_IDENTIFIER) { return parser_unexpected_error;; diff --git a/cmake/Hunter/config.cmake b/cmake/Hunter/config.cmake new file mode 100644 index 00000000..3bbc523d --- /dev/null +++ b/cmake/Hunter/config.cmake @@ -0,0 +1,3 @@ +hunter_config(jsoncpp VERSION 1.9.5-b1) +hunter_config(fmt VERSION 7.1.2) +hunter_config(GTest VERSION 1.14.0) diff --git a/cmake/HunterGate.cmake b/cmake/HunterGate.cmake new file mode 100644 index 00000000..17c6d380 --- /dev/null +++ b/cmake/HunterGate.cmake @@ -0,0 +1,543 @@ +# Copyright (c) 2013-2019, Ruslan Baratov +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# This is a gate file to Hunter package manager. +# Include this file using `include` command and add package you need, example: +# +# cmake_minimum_required(VERSION 3.5) +# +# include("cmake/HunterGate.cmake") +# HunterGate( +# URL "https://github.com/path/to/hunter/archive.tar.gz" +# SHA1 "798501e983f14b28b10cda16afa4de69eee1da1d" +# ) +# +# project(MyProject) +# +# hunter_add_package(Foo) +# hunter_add_package(Boo COMPONENTS Bar Baz) +# +# Projects: +# * https://github.com/cpp-pm/gate/ +# * https://github.com/cpp-pm/hunter + +option(HUNTER_ENABLED "Enable Hunter package manager support" ON) + +if(HUNTER_ENABLED) + if(CMAKE_VERSION VERSION_LESS "3.5") + message( + FATAL_ERROR + "At least CMake version 3.5 required for Hunter dependency management." + " Update CMake or set HUNTER_ENABLED to OFF." + ) + endif() +endif() + +include(CMakeParseArguments) # cmake_parse_arguments + +option(HUNTER_STATUS_PRINT "Print working status" ON) +option(HUNTER_STATUS_DEBUG "Print a lot info" OFF) +option(HUNTER_TLS_VERIFY "Enable/disable TLS certificate checking on downloads" ON) +set(HUNTER_ROOT "" CACHE FILEPATH "Override the HUNTER_ROOT.") + +set(HUNTER_ERROR_PAGE "https://hunter.readthedocs.io/en/latest/reference/errors") + +function(hunter_gate_status_print) + if(HUNTER_STATUS_PRINT OR HUNTER_STATUS_DEBUG) + foreach(print_message ${ARGV}) + message(STATUS "[hunter] ${print_message}") + endforeach() + endif() +endfunction() + +function(hunter_gate_status_debug) + if(HUNTER_STATUS_DEBUG) + foreach(print_message ${ARGV}) + string(TIMESTAMP timestamp) + message(STATUS "[hunter *** DEBUG *** ${timestamp}] ${print_message}") + endforeach() + endif() +endfunction() + +function(hunter_gate_error_page error_page) + message("------------------------------ ERROR ------------------------------") + message(" ${HUNTER_ERROR_PAGE}/${error_page}.html") + message("-------------------------------------------------------------------") + message("") + message(FATAL_ERROR "") +endfunction() + +function(hunter_gate_internal_error) + message("") + foreach(print_message ${ARGV}) + message("[hunter ** INTERNAL **] ${print_message}") + endforeach() + message("[hunter ** INTERNAL **] [Directory:${CMAKE_CURRENT_LIST_DIR}]") + message("") + hunter_gate_error_page("error.internal") +endfunction() + +function(hunter_gate_fatal_error) + cmake_parse_arguments(hunter "" "ERROR_PAGE" "" "${ARGV}") + if("${hunter_ERROR_PAGE}" STREQUAL "") + hunter_gate_internal_error("Expected ERROR_PAGE") + endif() + message("") + foreach(x ${hunter_UNPARSED_ARGUMENTS}) + message("[hunter ** FATAL ERROR **] ${x}") + endforeach() + message("[hunter ** FATAL ERROR **] [Directory:${CMAKE_CURRENT_LIST_DIR}]") + message("") + hunter_gate_error_page("${hunter_ERROR_PAGE}") +endfunction() + +function(hunter_gate_user_error) + hunter_gate_fatal_error(${ARGV} ERROR_PAGE "error.incorrect.input.data") +endfunction() + +function(hunter_gate_self root version sha1 result) + string(COMPARE EQUAL "${root}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("root is empty") + endif() + + string(COMPARE EQUAL "${version}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("version is empty") + endif() + + string(COMPARE EQUAL "${sha1}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("sha1 is empty") + endif() + + string(SUBSTRING "${sha1}" 0 7 archive_id) + + if(EXISTS "${root}/cmake/Hunter") + set(hunter_self "${root}") + else() + set( + hunter_self + "${root}/_Base/Download/Hunter/${version}/${archive_id}/Unpacked" + ) + endif() + + set("${result}" "${hunter_self}" PARENT_SCOPE) +endfunction() + +# Set HUNTER_GATE_ROOT cmake variable to suitable value. +function(hunter_gate_detect_root) + # Check CMake variable + if(HUNTER_ROOT) + set(HUNTER_GATE_ROOT "${HUNTER_ROOT}" PARENT_SCOPE) + hunter_gate_status_debug("HUNTER_ROOT detected by cmake variable") + return() + endif() + + # Check environment variable + if(DEFINED ENV{HUNTER_ROOT}) + set(HUNTER_GATE_ROOT "$ENV{HUNTER_ROOT}" PARENT_SCOPE) + hunter_gate_status_debug("HUNTER_ROOT detected by environment variable") + return() + endif() + + # Check HOME environment variable + if(DEFINED ENV{HOME}) + set(HUNTER_GATE_ROOT "$ENV{HOME}/.hunter" PARENT_SCOPE) + hunter_gate_status_debug("HUNTER_ROOT set using HOME environment variable") + return() + endif() + + # Check SYSTEMDRIVE and USERPROFILE environment variable (windows only) + if(WIN32) + if(DEFINED ENV{SYSTEMDRIVE}) + set(HUNTER_GATE_ROOT "$ENV{SYSTEMDRIVE}/.hunter" PARENT_SCOPE) + hunter_gate_status_debug( + "HUNTER_ROOT set using SYSTEMDRIVE environment variable" + ) + return() + endif() + + if(DEFINED ENV{USERPROFILE}) + set(HUNTER_GATE_ROOT "$ENV{USERPROFILE}/.hunter" PARENT_SCOPE) + hunter_gate_status_debug( + "HUNTER_ROOT set using USERPROFILE environment variable" + ) + return() + endif() + endif() + + hunter_gate_fatal_error( + "Can't detect HUNTER_ROOT" + ERROR_PAGE "error.detect.hunter.root" + ) +endfunction() + +function(hunter_gate_download dir) + string( + COMPARE + NOTEQUAL + "$ENV{HUNTER_DISABLE_AUTOINSTALL}" + "" + disable_autoinstall + ) + if(disable_autoinstall AND NOT HUNTER_RUN_INSTALL) + hunter_gate_fatal_error( + "Hunter not found in '${dir}'" + "Set HUNTER_RUN_INSTALL=ON to auto-install it from '${HUNTER_GATE_URL}'" + "Settings:" + " HUNTER_ROOT: ${HUNTER_GATE_ROOT}" + " HUNTER_SHA1: ${HUNTER_GATE_SHA1}" + ERROR_PAGE "error.run.install" + ) + endif() + string(COMPARE EQUAL "${dir}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("Empty 'dir' argument") + endif() + + string(COMPARE EQUAL "${HUNTER_GATE_SHA1}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("HUNTER_GATE_SHA1 empty") + endif() + + string(COMPARE EQUAL "${HUNTER_GATE_URL}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("HUNTER_GATE_URL empty") + endif() + + set(done_location "${dir}/DONE") + set(sha1_location "${dir}/SHA1") + + set(build_dir "${dir}/Build") + set(cmakelists "${dir}/CMakeLists.txt") + + hunter_gate_status_debug("Locking directory: ${dir}") + file(LOCK "${dir}" DIRECTORY GUARD FUNCTION) + hunter_gate_status_debug("Lock done") + + if(EXISTS "${done_location}") + # while waiting for lock other instance can do all the job + hunter_gate_status_debug("File '${done_location}' found, skip install") + return() + endif() + + file(REMOVE_RECURSE "${build_dir}") + file(REMOVE_RECURSE "${cmakelists}") + + file(MAKE_DIRECTORY "${build_dir}") # check directory permissions + + # Disabling languages speeds up a little bit, reduces noise in the output + # and avoids path too long windows error + file( + WRITE + "${cmakelists}" + "cmake_minimum_required(VERSION 3.5)\n" + "if(POLICY CMP0114)\n" + " cmake_policy(SET CMP0114 NEW)\n" + "endif()\n" + "if(POLICY CMP0135)\n" + " cmake_policy(SET CMP0135 NEW)\n" + "endif()\n" + "project(HunterDownload LANGUAGES NONE)\n" + "include(ExternalProject)\n" + "ExternalProject_Add(\n" + " Hunter\n" + " URL\n" + " \"${HUNTER_GATE_URL}\"\n" + " URL_HASH\n" + " SHA1=${HUNTER_GATE_SHA1}\n" + " DOWNLOAD_DIR\n" + " \"${dir}\"\n" + " TLS_VERIFY\n" + " ${HUNTER_TLS_VERIFY}\n" + " SOURCE_DIR\n" + " \"${dir}/Unpacked\"\n" + " CONFIGURE_COMMAND\n" + " \"\"\n" + " BUILD_COMMAND\n" + " \"\"\n" + " INSTALL_COMMAND\n" + " \"\"\n" + ")\n" + ) + + if(HUNTER_STATUS_DEBUG) + set(logging_params "") + else() + set(logging_params OUTPUT_QUIET) + endif() + + hunter_gate_status_debug("Run generate") + + # Need to add toolchain file too. + # Otherwise on Visual Studio + MDD this will fail with error: + # "Could not find an appropriate version of the Windows 10 SDK installed on this machine" + if(EXISTS "${CMAKE_TOOLCHAIN_FILE}") + get_filename_component(absolute_CMAKE_TOOLCHAIN_FILE "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE) + set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=${absolute_CMAKE_TOOLCHAIN_FILE}") + else() + # 'toolchain_arg' can't be empty + set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=") + endif() + + string(COMPARE EQUAL "${CMAKE_MAKE_PROGRAM}" "" no_make) + if(no_make) + set(make_arg "") + else() + # Test case: remove Ninja from PATH but set it via CMAKE_MAKE_PROGRAM + set(make_arg "-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}") + endif() + + execute_process( + COMMAND + "${CMAKE_COMMAND}" + "-H${dir}" + "-B${build_dir}" + "-G${CMAKE_GENERATOR}" + "${toolchain_arg}" + ${make_arg} + WORKING_DIRECTORY "${dir}" + RESULT_VARIABLE download_result + ${logging_params} + ) + + if(NOT download_result EQUAL 0) + hunter_gate_internal_error( + "Configure project failed." + "To reproduce the error run: ${CMAKE_COMMAND} -H${dir} -B${build_dir} -G${CMAKE_GENERATOR} ${toolchain_arg} ${make_arg}" + "In directory ${dir}" + ) + endif() + + hunter_gate_status_print( + "Initializing Hunter workspace (${HUNTER_GATE_SHA1})" + " ${HUNTER_GATE_URL}" + " -> ${dir}" + ) + execute_process( + COMMAND "${CMAKE_COMMAND}" --build "${build_dir}" + WORKING_DIRECTORY "${dir}" + RESULT_VARIABLE download_result + ${logging_params} + ) + + if(NOT download_result EQUAL 0) + hunter_gate_internal_error("Build project failed") + endif() + + file(REMOVE_RECURSE "${build_dir}") + file(REMOVE_RECURSE "${cmakelists}") + + file(WRITE "${sha1_location}" "${HUNTER_GATE_SHA1}") + file(WRITE "${done_location}" "DONE") + + hunter_gate_status_debug("Finished") +endfunction() + +# Must be a macro so master file 'cmake/Hunter' can +# apply all variables easily just by 'include' command +# (otherwise PARENT_SCOPE magic needed) +macro(HunterGate) + if(HUNTER_GATE_DONE) + # variable HUNTER_GATE_DONE set explicitly for external project + # (see `hunter_download`) + set_property(GLOBAL PROPERTY HUNTER_GATE_DONE YES) + endif() + + # First HunterGate command will init Hunter, others will be ignored + get_property(_hunter_gate_done GLOBAL PROPERTY HUNTER_GATE_DONE SET) + + if(NOT HUNTER_ENABLED) + # Empty function to avoid error "unknown function" + function(hunter_add_package) + endfunction() + + set( + _hunter_gate_disabled_mode_dir + "${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/disabled-mode" + ) + if(EXISTS "${_hunter_gate_disabled_mode_dir}") + hunter_gate_status_debug( + "Adding \"disabled-mode\" modules: ${_hunter_gate_disabled_mode_dir}" + ) + list(APPEND CMAKE_PREFIX_PATH "${_hunter_gate_disabled_mode_dir}") + endif() + elseif(_hunter_gate_done) + hunter_gate_status_debug("Secondary HunterGate (use old settings)") + hunter_gate_self( + "${HUNTER_CACHED_ROOT}" + "${HUNTER_VERSION}" + "${HUNTER_SHA1}" + _hunter_self + ) + include("${_hunter_self}/cmake/Hunter") + else() + set(HUNTER_GATE_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}") + + string(COMPARE NOTEQUAL "${PROJECT_NAME}" "" _have_project_name) + if(_have_project_name) + hunter_gate_fatal_error( + "Please set HunterGate *before* 'project' command. " + "Detected project: ${PROJECT_NAME}" + ERROR_PAGE "error.huntergate.before.project" + ) + endif() + + cmake_parse_arguments( + HUNTER_GATE "LOCAL" "URL;SHA1;GLOBAL;FILEPATH" "" ${ARGV} + ) + + string(COMPARE EQUAL "${HUNTER_GATE_SHA1}" "" _empty_sha1) + string(COMPARE EQUAL "${HUNTER_GATE_URL}" "" _empty_url) + string( + COMPARE + NOTEQUAL + "${HUNTER_GATE_UNPARSED_ARGUMENTS}" + "" + _have_unparsed + ) + string(COMPARE NOTEQUAL "${HUNTER_GATE_GLOBAL}" "" _have_global) + string(COMPARE NOTEQUAL "${HUNTER_GATE_FILEPATH}" "" _have_filepath) + + if(_have_unparsed) + hunter_gate_user_error( + "HunterGate unparsed arguments: ${HUNTER_GATE_UNPARSED_ARGUMENTS}" + ) + endif() + if(_empty_sha1) + hunter_gate_user_error("SHA1 suboption of HunterGate is mandatory") + endif() + if(_empty_url) + hunter_gate_user_error("URL suboption of HunterGate is mandatory") + endif() + if(_have_global) + if(HUNTER_GATE_LOCAL) + hunter_gate_user_error("Unexpected LOCAL (already has GLOBAL)") + endif() + if(_have_filepath) + hunter_gate_user_error("Unexpected FILEPATH (already has GLOBAL)") + endif() + endif() + if(HUNTER_GATE_LOCAL) + if(_have_global) + hunter_gate_user_error("Unexpected GLOBAL (already has LOCAL)") + endif() + if(_have_filepath) + hunter_gate_user_error("Unexpected FILEPATH (already has LOCAL)") + endif() + endif() + if(_have_filepath) + if(_have_global) + hunter_gate_user_error("Unexpected GLOBAL (already has FILEPATH)") + endif() + if(HUNTER_GATE_LOCAL) + hunter_gate_user_error("Unexpected LOCAL (already has FILEPATH)") + endif() + endif() + + hunter_gate_detect_root() # set HUNTER_GATE_ROOT + + # Beautify path, fix probable problems with windows path slashes + get_filename_component( + HUNTER_GATE_ROOT "${HUNTER_GATE_ROOT}" ABSOLUTE + ) + hunter_gate_status_debug("HUNTER_ROOT: ${HUNTER_GATE_ROOT}") + if(NOT HUNTER_ALLOW_SPACES_IN_PATH) + string(FIND "${HUNTER_GATE_ROOT}" " " _contain_spaces) + if(NOT _contain_spaces EQUAL -1) + hunter_gate_fatal_error( + "HUNTER_ROOT (${HUNTER_GATE_ROOT}) contains spaces." + "Set HUNTER_ALLOW_SPACES_IN_PATH=ON to skip this error" + "(Use at your own risk!)" + ERROR_PAGE "error.spaces.in.hunter.root" + ) + endif() + endif() + + string( + REGEX + MATCH + "[0-9]+\\.[0-9]+\\.[0-9]+[-_a-z0-9]*" + HUNTER_GATE_VERSION + "${HUNTER_GATE_URL}" + ) + string(COMPARE EQUAL "${HUNTER_GATE_VERSION}" "" _is_empty) + if(_is_empty) + set(HUNTER_GATE_VERSION "unknown") + endif() + + hunter_gate_self( + "${HUNTER_GATE_ROOT}" + "${HUNTER_GATE_VERSION}" + "${HUNTER_GATE_SHA1}" + _hunter_self + ) + + set(_master_location "${_hunter_self}/cmake/Hunter") + if(EXISTS "${HUNTER_GATE_ROOT}/cmake/Hunter") + # Hunter downloaded manually (e.g. by 'git clone') + set(_unused "xxxxxxxxxx") + set(HUNTER_GATE_SHA1 "${_unused}") + set(HUNTER_GATE_VERSION "${_unused}") + else() + get_filename_component(_archive_id_location "${_hunter_self}/.." ABSOLUTE) + set(_done_location "${_archive_id_location}/DONE") + set(_sha1_location "${_archive_id_location}/SHA1") + + # Check Hunter already downloaded by HunterGate + if(NOT EXISTS "${_done_location}") + hunter_gate_download("${_archive_id_location}") + endif() + + if(NOT EXISTS "${_done_location}") + hunter_gate_internal_error("hunter_gate_download failed") + endif() + + if(NOT EXISTS "${_sha1_location}") + hunter_gate_internal_error("${_sha1_location} not found") + endif() + file(READ "${_sha1_location}" _sha1_value) + string(TOLOWER "${_sha1_value}" _sha1_value_lower) + string(TOLOWER "${HUNTER_GATE_SHA1}" _HUNTER_GATE_SHA1_lower) + string(COMPARE EQUAL "${_sha1_value_lower}" "${_HUNTER_GATE_SHA1_lower}" _is_equal) + if(NOT _is_equal) + hunter_gate_internal_error( + "Short SHA1 collision:" + " ${_sha1_value} (from ${_sha1_location})" + " ${HUNTER_GATE_SHA1} (HunterGate)" + ) + endif() + if(NOT EXISTS "${_master_location}") + hunter_gate_user_error( + "Master file not found:" + " ${_master_location}" + "try to update Hunter/HunterGate" + ) + endif() + endif() + include("${_master_location}") + set_property(GLOBAL PROPERTY HUNTER_GATE_DONE YES) + endif() +endmacro() diff --git a/cmake/conan/CMakeLists.txt b/cmake/conan/CMakeLists.txt deleted file mode 100644 index 4899e70e..00000000 --- a/cmake/conan/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# Download automatically, you can also just copy the conan.cmake file - -if (NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake") - message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan") - file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.13/conan.cmake" - "${CMAKE_BINARY_DIR}/conan.cmake") -endif () -include(${CMAKE_BINARY_DIR}/conan.cmake) - -conan_check(REQUIRED) - -conan_cmake_run(CONANFILE conanfile.txt BASIC_SETUP CMAKE_TARGETS BUILD missing) diff --git a/cmake/gtest/CMakeLists.txt b/cmake/gtest/CMakeLists.txt deleted file mode 100644 index eea7d079..00000000 --- a/cmake/gtest/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -############################## -# Google Test -# Based on instructions in https://github.com/google/googletest/tree/master/googletest#incorporating-into-an-existing-cmake-project -# Download and unpack googletest at configure time -configure_file(CMakeLists.txt.gtest.in ${CMAKE_BINARY_DIR}/googletest-download/CMakeLists.txt) - -execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . - RESULT_VARIABLE result - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download) -if (result) - message(FATAL_ERROR "CMake step for googletest failed: ${result}") -endif () - -execute_process(COMMAND ${CMAKE_COMMAND} --build . - RESULT_VARIABLE result - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download) -if (result) - message(FATAL_ERROR "Build step for googletest failed: ${result}") -endif () - -# Prevent overriding the parent project's compiler/linker settings on Windows -set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) - -add_subdirectory( - ${CMAKE_BINARY_DIR}/googletest-src - ${CMAKE_BINARY_DIR}/googletest-build -) - -if (CMAKE_VERSION VERSION_LESS 2.8.11) - include_directories("${gtest_SOURCE_DIR}/include") -endif () diff --git a/cmake/gtest/CMakeLists.txt.gtest.in b/cmake/gtest/CMakeLists.txt.gtest.in deleted file mode 100644 index cd4ae6c7..00000000 --- a/cmake/gtest/CMakeLists.txt.gtest.in +++ /dev/null @@ -1,16 +0,0 @@ -# Based on https://github.com/google/googletest/tree/master/googletest#incorporating-into-an-existing-cmake-project -cmake_minimum_required(VERSION 2.8.2) - -project(googletest-download NONE) - -include(ExternalProject) -ExternalProject_Add(googletest - GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG release-1.11.0 - SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src" - BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" - TEST_COMMAND "" - ) diff --git a/conanfile.txt b/conanfile.txt deleted file mode 100644 index 6df14337..00000000 --- a/conanfile.txt +++ /dev/null @@ -1,6 +0,0 @@ -[requires] -jsoncpp/1.9.4 -fmt/7.1.3 - -[generators] -cmake diff --git a/deps/ledger-zxlib b/deps/ledger-zxlib index 9e9cb2b2..dca3f65c 160000 --- a/deps/ledger-zxlib +++ b/deps/ledger-zxlib @@ -1 +1 @@ -Subproject commit 9e9cb2b21fdf94a6b1f7d71ee6f89ca8101712ce +Subproject commit dca3f65cbcda72034a2ee89e74573e2318428298 diff --git a/tests/testvectors/invoke_contracts.json b/tests/testvectors/invoke_contracts.json index f5118417..ab90966f 100644 --- a/tests/testvectors/invoke_contracts.json +++ b/tests/testvectors/invoke_contracts.json @@ -7,76 +7,17 @@ "testnet": false, "message": { "version": 0, - "to0x": "0x1969ed81bf20d13b9c235619aa3e4c903b6fc02b", - "from": "f137sjdbgunloi7couiy4l5nc7pd6k2jmq32vizpy", - "nonce": 1, - "value": "SFT 357.518646808779096064", - "gaslimit": 1000000, - "gasfeecap": "0000000000000002500", - "gaspremium": "0000000000000002500", + "to0x": "0xff000000000000000000000000000000001c0485", + "to": "f01836165", + "from": "f16evrgvbuk3htf44rrp647zrwzuglk4ynoiivvgi", + "nonce": 206, + "value": "WFIL 0.0001", + "gaslimit": 30213277, + "gasfeecap": "0000000000000206328", + "gaspremium": "000000000000201090", "method": "ERC20 Transfer" }, - "encoded_tx_hex": "8A0056040AC5EA96DD365983CFEC90E72B6A2DAC9562F458BA5501DFE49184D46ADC8F89D44638BEB45F78FCAD259001401A000F4240430009C4430009C41AE525AA155847A9059CBB0000000000000000000000001969ED81BF20D13B9C235619AA3E4C903B6FC02B0000000000000000000000000000000000000000000000136191630EBF9F000082013A" - }, - { - "description": "Invoke EVM Transfer ERC20", - "encoded_tx": "notAvailable", - "valid": true, - "error": "", - "testnet": false, - "message": { - "version": 0, - "to0x": "0x578c692a59f3a980d2b88ab3e48a4c26e7b01eb1", - "from": "f01369483", - "nonce": 1, - "value": "iFIL 258.700501816708235264", - "gaslimit": 1000000, - "gasfeecap": "0000000000000002500", - "gaspremium": "0000000000000002500", - "method": "ERC20 Transfer" - }, - "encoded_tx_hex": "8A0056040A690908F7FA93AFC040CFBD9FE1DDD2C2668AA0E044008BCB5301401A000F4240430009C4430009C41AE525AA155844A9059CBB000000000000000000000000578C692A59F3A980D2B88AB3E48A4C26E7B01EB100000000000000000000000000000000000000000000000E0630CFBF90310000" - }, - { - "description": "Invoke EVM Transfer ERC20", - "encoded_tx": "notAvailable", - "valid": true, - "error": "", - "testnet": false, - "message": { - "version": 0, - "to0x": "0x2ca0949685c99337b74b99d9f4fabfa6d6be7979", - "from": "f137sjdbgunloi7couiy4l5nc7pd6k2jmq32vizpy", - "nonce": 1, - "value": "?? 224970872185567215616", - "gaslimit": 1000000, - "gasfeecap": "0000000000000002500", - "gaspremium": "0000000000000002500", - "method": "ERC20 Transfer", - "Contract": "0x00c6a1694b0fd298423f8797c39d28f595a9eef9", - "ContractF4": "f410faddkc2klb7jjqqr7q6l4hhji6wk2t3xzutk27gy" - }, - "encoded_tx_hex": "8A0056040A00C6A1694B0FD298423F8797C39D28F595A9EEF95501DFE49184D46ADC8F89D44638BEB45F78FCAD259001401A000F4240430009C4430009C41AE525AA155847A9059CBB0000000000000000000000002CA0949685C99337B74B99D9F4FABFA6D6BE797900000000000000000000000000000000000000000000000C3219184E568A800082013A" - }, - { - "description": "Invoke EVM Transfer ERC20", - "encoded_tx": "notAvailable", - "valid": true, - "error": "", - "testnet": false, - "message": { - "version": 0, - "to0x": "0xff00000000000000000000000000000000bc614e", - "to": "f012345678", - "from": "f01369483", - "nonce": 1, - "value": "iFIL 258.700501816708235264", - "gaslimit": 1000000, - "gasfeecap": "0000000000000002500", - "gaspremium": "0000000000000002500", - "method": "ERC20 Transfer" - }, - "encoded_tx_hex": "8A0056040A690908F7FA93AFC040CFBD9FE1DDD2C2668AA0E044008BCB5301401A000F4240430009C4430009C41AE525AA155844A9059CBB000000000000000000000000ff00000000000000000000000000000000BC614E00000000000000000000000000000000000000000000000E0630CFBF90310000" + "encoded_tx_hex": "8a0056040a60e1773636cf5e4a227d9ac24f20feca034ee25a5501f12b13543456cf32f3918bfdcfe636cd0cb5730d18ce401a01cd049d44000325f844000311821ae525aa1558465844a9059cbb000000000000000000000000ff000000000000000000000000000000001c048500000000000000000000000000000000000000000000000000005af3107a4000" } ] diff --git a/tests_zemu/package.json b/tests_zemu/package.json index ee5d5c65..37d74b9a 100644 --- a/tests_zemu/package.json +++ b/tests_zemu/package.json @@ -20,7 +20,7 @@ "dependencies": { "@zondax/ledger-filecoin": "^0.13.0", "@ledgerhq/hw-transport-node-hid": "6.28.4", - "@zondax/zemu": "^0.48.0" + "@zondax/zemu": "^0.49.0" }, "devDependencies": { "@ethereumjs/common": "^2.4.0", @@ -30,23 +30,23 @@ "@types/jest": "^29.5.12", "@types/ledgerhq__hw-transport": "^4.21.8", "@types/secp256k1": "^4.0.6", - "@typescript-eslint/eslint-plugin": "^7.8.0", - "@typescript-eslint/parser": "^7.8.0", + "@typescript-eslint/eslint-plugin": "^7.11.0", + "@typescript-eslint/parser": "^7.11.0", "blakejs": "^1.2.1", "bn.js": "^5.2.0", "crypto-js": "4.2.0", "elliptic": "^6.5.5", - "eslint": "^9.1.1", + "eslint": "^9.3.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-jest": "^28.3.0", + "eslint-plugin-jest": "^28.5.0", "eslint-plugin-prettier": "^5.1.3", "jest": "29.7.0", "jest-serial-runner": "^1.1.0", "js-sha256": "0.11.0", "prettier": "^3.2.5", "secp256k1": "^5.0.0", - "ts-jest": "^29.1.2", + "ts-jest": "^29.1.4", "ts-node": "^10.9.2", "typescript": "^5.4.5" } diff --git a/tests_zemu/snapshots/s-mainmenu/00004.png b/tests_zemu/snapshots/s-mainmenu/00004.png index a5c6d118..c28174a1 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 a5c6d118..c28174a1 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_erc20_transfer/00000.png b/tests_zemu/snapshots/s-sign_erc20_transfer/00000.png index af40f055..1a970d9c 100644 Binary files a/tests_zemu/snapshots/s-sign_erc20_transfer/00000.png and b/tests_zemu/snapshots/s-sign_erc20_transfer/00000.png differ diff --git a/tests_zemu/snapshots/s-sign_erc20_transfer/00001.png b/tests_zemu/snapshots/s-sign_erc20_transfer/00001.png index 5c924346..0e3fbc0b 100644 Binary files a/tests_zemu/snapshots/s-sign_erc20_transfer/00001.png and b/tests_zemu/snapshots/s-sign_erc20_transfer/00001.png differ diff --git a/tests_zemu/snapshots/s-sign_erc20_transfer/00002.png b/tests_zemu/snapshots/s-sign_erc20_transfer/00002.png index 28b4b5c3..679c2872 100644 Binary files a/tests_zemu/snapshots/s-sign_erc20_transfer/00002.png and b/tests_zemu/snapshots/s-sign_erc20_transfer/00002.png differ diff --git a/tests_zemu/snapshots/s-sign_erc20_transfer/00003.png b/tests_zemu/snapshots/s-sign_erc20_transfer/00003.png index 6fd92c76..2581437f 100644 Binary files a/tests_zemu/snapshots/s-sign_erc20_transfer/00003.png and b/tests_zemu/snapshots/s-sign_erc20_transfer/00003.png differ diff --git a/tests_zemu/snapshots/s-sign_erc20_transfer/00004.png b/tests_zemu/snapshots/s-sign_erc20_transfer/00004.png index 58da7723..9a327c60 100644 Binary files a/tests_zemu/snapshots/s-sign_erc20_transfer/00004.png and b/tests_zemu/snapshots/s-sign_erc20_transfer/00004.png differ diff --git a/tests_zemu/snapshots/s-sign_erc20_transfer/00005.png b/tests_zemu/snapshots/s-sign_erc20_transfer/00005.png index 006c26ab..06adf855 100644 Binary files a/tests_zemu/snapshots/s-sign_erc20_transfer/00005.png and b/tests_zemu/snapshots/s-sign_erc20_transfer/00005.png differ diff --git a/tests_zemu/snapshots/s-sign_erc20_transfer/00006.png b/tests_zemu/snapshots/s-sign_erc20_transfer/00006.png index f57d1dce..895f0845 100644 Binary files a/tests_zemu/snapshots/s-sign_erc20_transfer/00006.png and b/tests_zemu/snapshots/s-sign_erc20_transfer/00006.png differ diff --git a/tests_zemu/snapshots/s-sign_erc20_transfer/00007.png b/tests_zemu/snapshots/s-sign_erc20_transfer/00007.png new file mode 100644 index 00000000..646129dd Binary files /dev/null and b/tests_zemu/snapshots/s-sign_erc20_transfer/00007.png differ diff --git a/tests_zemu/snapshots/s-sign_erc20_transfer/00008.png b/tests_zemu/snapshots/s-sign_erc20_transfer/00008.png new file mode 100644 index 00000000..006c26ab Binary files /dev/null and b/tests_zemu/snapshots/s-sign_erc20_transfer/00008.png differ diff --git a/tests_zemu/snapshots/s-sign_erc20_transfer/00009.png b/tests_zemu/snapshots/s-sign_erc20_transfer/00009.png new file mode 100644 index 00000000..f57d1dce Binary files /dev/null and b/tests_zemu/snapshots/s-sign_erc20_transfer/00009.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00004.png b/tests_zemu/snapshots/sp-mainmenu/00004.png index 597608e8..005fba7e 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 597608e8..005fba7e 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-sign_erc20_transfer/00001.png b/tests_zemu/snapshots/sp-sign_erc20_transfer/00001.png index ff1cd05f..346b228a 100644 Binary files a/tests_zemu/snapshots/sp-sign_erc20_transfer/00001.png and b/tests_zemu/snapshots/sp-sign_erc20_transfer/00001.png differ diff --git a/tests_zemu/snapshots/sp-sign_erc20_transfer/00002.png b/tests_zemu/snapshots/sp-sign_erc20_transfer/00002.png index bc1ae7d4..a349885d 100644 Binary files a/tests_zemu/snapshots/sp-sign_erc20_transfer/00002.png and b/tests_zemu/snapshots/sp-sign_erc20_transfer/00002.png differ diff --git a/tests_zemu/snapshots/sp-sign_erc20_transfer/00003.png b/tests_zemu/snapshots/sp-sign_erc20_transfer/00003.png index 5ba51ecd..30185697 100644 Binary files a/tests_zemu/snapshots/sp-sign_erc20_transfer/00003.png and b/tests_zemu/snapshots/sp-sign_erc20_transfer/00003.png differ diff --git a/tests_zemu/snapshots/sp-sign_erc20_transfer/00004.png b/tests_zemu/snapshots/sp-sign_erc20_transfer/00004.png index b4219c0b..404cecb3 100644 Binary files a/tests_zemu/snapshots/sp-sign_erc20_transfer/00004.png and b/tests_zemu/snapshots/sp-sign_erc20_transfer/00004.png differ diff --git a/tests_zemu/snapshots/sp-sign_erc20_transfer/00005.png b/tests_zemu/snapshots/sp-sign_erc20_transfer/00005.png index 1e4be699..deb4a047 100644 Binary files a/tests_zemu/snapshots/sp-sign_erc20_transfer/00005.png and b/tests_zemu/snapshots/sp-sign_erc20_transfer/00005.png differ diff --git a/tests_zemu/snapshots/sp-sign_erc20_transfer/00006.png b/tests_zemu/snapshots/sp-sign_erc20_transfer/00006.png index c88c5d4e..27e72a95 100644 Binary files a/tests_zemu/snapshots/sp-sign_erc20_transfer/00006.png and b/tests_zemu/snapshots/sp-sign_erc20_transfer/00006.png differ diff --git a/tests_zemu/snapshots/sp-sign_erc20_transfer/00007.png b/tests_zemu/snapshots/sp-sign_erc20_transfer/00007.png new file mode 100644 index 00000000..1e4be699 Binary files /dev/null and b/tests_zemu/snapshots/sp-sign_erc20_transfer/00007.png differ diff --git a/tests_zemu/snapshots/sp-sign_erc20_transfer/00008.png b/tests_zemu/snapshots/sp-sign_erc20_transfer/00008.png new file mode 100644 index 00000000..c88c5d4e Binary files /dev/null and b/tests_zemu/snapshots/sp-sign_erc20_transfer/00008.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00001.png b/tests_zemu/snapshots/st-mainmenu/00001.png index 1f847048..7af9d0d2 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_erc20_transfer/00001.png b/tests_zemu/snapshots/st-sign_erc20_transfer/00001.png index efbb6a9c..2d9f5cf0 100644 Binary files a/tests_zemu/snapshots/st-sign_erc20_transfer/00001.png and b/tests_zemu/snapshots/st-sign_erc20_transfer/00001.png differ diff --git a/tests_zemu/snapshots/st-sign_erc20_transfer/00002.png b/tests_zemu/snapshots/st-sign_erc20_transfer/00002.png index 14b1f6f3..535db3c1 100644 Binary files a/tests_zemu/snapshots/st-sign_erc20_transfer/00002.png and b/tests_zemu/snapshots/st-sign_erc20_transfer/00002.png differ diff --git a/tests_zemu/snapshots/st-sign_erc20_transfer/00003.png b/tests_zemu/snapshots/st-sign_erc20_transfer/00003.png index a676a685..c384b63c 100644 Binary files a/tests_zemu/snapshots/st-sign_erc20_transfer/00003.png and b/tests_zemu/snapshots/st-sign_erc20_transfer/00003.png differ diff --git a/tests_zemu/snapshots/st-sign_erc20_transfer/00004.png b/tests_zemu/snapshots/st-sign_erc20_transfer/00004.png new file mode 100644 index 00000000..2e222b65 Binary files /dev/null and b/tests_zemu/snapshots/st-sign_erc20_transfer/00004.png differ diff --git a/tests_zemu/snapshots/st-sign_erc20_transfer/00005.png b/tests_zemu/snapshots/st-sign_erc20_transfer/00005.png new file mode 100644 index 00000000..a676a685 Binary files /dev/null and b/tests_zemu/snapshots/st-sign_erc20_transfer/00005.png differ diff --git a/tests_zemu/snapshots/x-mainmenu/00004.png b/tests_zemu/snapshots/x-mainmenu/00004.png index 597608e8..005fba7e 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 597608e8..005fba7e 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_erc20_transfer/00001.png b/tests_zemu/snapshots/x-sign_erc20_transfer/00001.png index ff1cd05f..346b228a 100644 Binary files a/tests_zemu/snapshots/x-sign_erc20_transfer/00001.png and b/tests_zemu/snapshots/x-sign_erc20_transfer/00001.png differ diff --git a/tests_zemu/snapshots/x-sign_erc20_transfer/00002.png b/tests_zemu/snapshots/x-sign_erc20_transfer/00002.png index bc1ae7d4..a349885d 100644 Binary files a/tests_zemu/snapshots/x-sign_erc20_transfer/00002.png and b/tests_zemu/snapshots/x-sign_erc20_transfer/00002.png differ diff --git a/tests_zemu/snapshots/x-sign_erc20_transfer/00003.png b/tests_zemu/snapshots/x-sign_erc20_transfer/00003.png index 5ba51ecd..30185697 100644 Binary files a/tests_zemu/snapshots/x-sign_erc20_transfer/00003.png and b/tests_zemu/snapshots/x-sign_erc20_transfer/00003.png differ diff --git a/tests_zemu/snapshots/x-sign_erc20_transfer/00004.png b/tests_zemu/snapshots/x-sign_erc20_transfer/00004.png index b4219c0b..404cecb3 100644 Binary files a/tests_zemu/snapshots/x-sign_erc20_transfer/00004.png and b/tests_zemu/snapshots/x-sign_erc20_transfer/00004.png differ diff --git a/tests_zemu/snapshots/x-sign_erc20_transfer/00005.png b/tests_zemu/snapshots/x-sign_erc20_transfer/00005.png index 1e4be699..deb4a047 100644 Binary files a/tests_zemu/snapshots/x-sign_erc20_transfer/00005.png and b/tests_zemu/snapshots/x-sign_erc20_transfer/00005.png differ diff --git a/tests_zemu/snapshots/x-sign_erc20_transfer/00006.png b/tests_zemu/snapshots/x-sign_erc20_transfer/00006.png index c88c5d4e..27e72a95 100644 Binary files a/tests_zemu/snapshots/x-sign_erc20_transfer/00006.png and b/tests_zemu/snapshots/x-sign_erc20_transfer/00006.png differ diff --git a/tests_zemu/snapshots/x-sign_erc20_transfer/00007.png b/tests_zemu/snapshots/x-sign_erc20_transfer/00007.png new file mode 100644 index 00000000..1e4be699 Binary files /dev/null and b/tests_zemu/snapshots/x-sign_erc20_transfer/00007.png differ diff --git a/tests_zemu/snapshots/x-sign_erc20_transfer/00008.png b/tests_zemu/snapshots/x-sign_erc20_transfer/00008.png new file mode 100644 index 00000000..c88c5d4e Binary files /dev/null and b/tests_zemu/snapshots/x-sign_erc20_transfer/00008.png differ diff --git a/tests_zemu/tests/standard.test.ts b/tests_zemu/tests/standard.test.ts index d6bfa7d7..b5b308a7 100644 --- a/tests_zemu/tests/standard.test.ts +++ b/tests_zemu/tests/standard.test.ts @@ -517,7 +517,7 @@ describe('Standard', function () { const app = new FilecoinApp(sim.getTransport()); const txBlob = Buffer.from( - "8A0056040A690908F7FA93AFC040CFBD9FE1DDD2C2668AA0E044008BCB5301401A000F4240430009C4430009C41AE525AA155844A9059CBB000000000000000000000000578C692A59F3A980D2B88AB3E48A4C26E7B01EB100000000000000000000000000000000000000000000000E0630CFBF90310000", + "8a0056040a60e1773636cf5e4a227d9ac24f20feca034ee25a5501f12b13543456cf32f3918bfdcfe636cd0cb5730d18ce401a01cd049d44000325f844000311821ae525aa1558465844a9059cbb000000000000000000000000ff000000000000000000000000000000001c048500000000000000000000000000000000000000000000000000005af3107a4000", "hex", );