Skip to content

Commit

Permalink
Merge pull request #102 from Zondax/dev
Browse files Browse the repository at this point in the history
Update to spec 6003001
  • Loading branch information
chcmedeiros authored Jul 2, 2024
2 parents 04605cf + a438b1d commit bb99eaf
Show file tree
Hide file tree
Showing 116 changed files with 47,113 additions and 37,330 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/check_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
branches:
- main
- develop
- master # for safety reasons
- dev # for safety reasons

jobs:
configure:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
branches:
- main
- develop
- master # for safety reasons
- dev # for safety reasons

jobs:
analyse:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/guidelines_enforcer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ on:
workflow_dispatch:
push:
branches:
- master
- main
- develop
- master # for safety reasons
- dev # for safety reasons
pull_request:

jobs:
guidelines_enforcer:
name: Call Ledger guidelines_enforcer
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1
with:
relative_app_directory: app
10 changes: 6 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
branches:
- main
- develop
- master # for safety reasons
- dev # for safety reasons

jobs:
configure:
Expand Down Expand Up @@ -137,7 +139,7 @@ jobs:
- name: Build NanoS
shell: bash -l {0}
run: |
make SUBSTRATE_PARSER_FULL=0
make SUBSTRATE_PARSER_FULL=0 PRODUCTION_BUILD=0
mv ./app/pkg/installer_s.sh ./app/pkg/installer_nanos.sh
- name: Set tag
id: nanos_light
Expand Down Expand Up @@ -173,7 +175,7 @@ jobs:
- name: Build NanoS XL
shell: bash -l {0}
run: |
make SUBSTRATE_PARSER_FULL=1
make SUBSTRATE_PARSER_FULL=1 PRODUCTION_BUILD=0
mv ./app/pkg/installer_s.sh ./app/pkg/installer_nanos_xl.sh
- name: Set tag
id: nanos_xl
Expand Down Expand Up @@ -209,7 +211,7 @@ jobs:
- name: Build NanoSP
shell: bash -l {0}
run: |
make SUBSTRATE_PARSER_FULL=1
make SUBSTRATE_PARSER_FULL=1 PRODUCTION_BUILD=0
mv ./app/pkg/installer_s2.sh ./app/pkg/installer_nanos_plus.sh
- name: Set tag
id: nanosp
Expand Down Expand Up @@ -244,7 +246,7 @@ jobs:

- name: Build Stax
shell: bash -l {0}
run: make SUBSTRATE_PARSER_FULL=1
run: make SUBSTRATE_PARSER_FULL=1 PRODUCTION_BUILD=0
- name: Set tag
id: stax
run: echo "tag_name=$(./app/pkg/installer_stax.sh version)" >> $GITHUB_OUTPUT
Expand Down
21 changes: 9 additions & 12 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
[submodule "deps/nanos-secure-sdk"]
path = deps/nanos-secure-sdk
url = https://github.com/LedgerHQ/nanos-secure-sdk.git
[submodule "deps/BLAKE2"]
path = deps/BLAKE2
url = https://github.com/BLAKE2/BLAKE2
[submodule "cmake/cmake-modules"]
path = cmake/cmake-modules
url = https://github.com/bilke/cmake-modules.git
[submodule "deps/nanox-secure-sdk"]
path = deps/nanox-secure-sdk
[submodule "deps/ledger-zxlib"]
path = deps/ledger-zxlib
url = https://github.com/zondax/ledger-zxlib
[submodule "deps/nanos-secure-sdk"]
path = deps/nanos-secure-sdk
url = https://github.com/LedgerHQ/ledger-secure-sdk.git
[submodule "deps/nanosplus-secure-sdk"]
path = deps/nanosplus-secure-sdk
url = https://github.com/LedgerHQ/ledger-secure-sdk.git
[submodule "deps/ledger-zxlib"]
path = deps/ledger-zxlib
url = https://github.com/zondax/ledger-zxlib
[submodule "deps/nanox-secure-sdk"]
path = deps/nanox-secure-sdk
url = https://github.com/LedgerHQ/ledger-secure-sdk.git
[submodule "deps/stax-secure-sdk"]
path = deps/stax-secure-sdk
url = https://github.com/LedgerHQ/ledger-secure-sdk.git
url = https://github.com/LedgerHQ/ledger-secure-sdk.git
51 changes: 40 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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-polymesh VERSION 0.0.0)
enable_testing()

set(CMAKE_CXX_STANDARD 17)
cmake_policy(SET CMP0025 NEW)
set(CMAKE_CXX_STANDARD 11)
cmake_policy(SET CMP0144 NEW)

set(HUNTER_STATUS_DEBUG ON)
set(HUNTER_TLS_VERIFY ON)

enable_testing()

option(ENABLE_FUZZING "Build with fuzzing instrumentation and build fuzz targets" OFF)
option(ENABLE_COVERAGE "Build with source code coverage instrumentation" OFF)
Expand All @@ -28,14 +47,27 @@ 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)

add_definitions(-DSUBSTRATE_PARSER_FULL)

if(ENABLE_FUZZING)
add_definitions(-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1)
SET(ENABLE_SANITIZERS ON CACHE BOOL "Sanitizer automatically enabled" FORCE)
SET(CMAKE_BUILD_TYPE Debug)

add_definitions(-DENABLE_COVERAGE=1)
string(APPEND CMAKE_C_FLAGS " -fprofile-arcs -ftest-coverage")
string(APPEND CMAKE_CXX_FLAGS " -fprofile-arcs -ftest-coverage")
string(APPEND CMAKE_LINKER_FLAGS " -fprofile-arcs -ftest-coverage")

if (DEFINED ENV{FUZZ_LOGGING})
add_definitions(-DFUZZING_LOGGING)
message(FATAL_ERROR "Fuzz logging enabled")
Expand Down Expand Up @@ -72,9 +104,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)

set (RETRIEVE_MAJOR_CMD
"cat ${CMAKE_CURRENT_SOURCE_DIR}/app/Makefile.version | grep APPVERSION_M | cut -b 14- | tr -d '\n'"
)
Expand Down Expand Up @@ -148,13 +177,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)

##############################################################
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ ifeq ($(BOLOS_SDK),)

ZXLIB_COMPILE_STAX ?= 1
SUBSTRATE_PARSER_FULL ?= 1
PRODUCTION_BUILD ?= 1
include $(CURDIR)/deps/ledger-zxlib/dockerized_build.mk

else
Expand All @@ -48,5 +49,6 @@ zemu_install: tests_tools_build
test_all:
make zemu_install
SUBSTRATE_PARSER_FULL=1 make
make clean_build
SUBSTRATE_PARSER_FULL=1 SUPPORT_SR25519=1 make buildS
make zemu_test
Loading

0 comments on commit bb99eaf

Please sign in to comment.