Skip to content

Commit

Permalink
Merge pull request #203 from ArkEcosystem/release/v1.0.0
Browse files Browse the repository at this point in the history
release: 1.0.0
  • Loading branch information
faustbrian authored Feb 14, 2020
2 parents 9424ce1 + 95b72bd commit f06376c
Show file tree
Hide file tree
Showing 231 changed files with 13,745 additions and 7,307 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
indent_size = 4
trim_trailing_whitespace = true
35 changes: 35 additions & 0 deletions .github/workflows/codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CodeClimate Coverage

on:
push:
branches:
- 'master'
- 'develop'

jobs:
codeclimate:
runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
- name: Set compiler to clang++
run: COMPILER=clang++
- name: Install Dependencies
run: brew install cmake lcov
- name: Make scripts executable
run: sudo chmod +x ./.github/workflows/test/clang_tidy.sh
- name: Setup Code Climate test-reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- name: Build & Run Coverage Tests
run: |
./cc-test-reporter before-build
cmake -DCMAKE_BUILD_TYPE=Coverage -DUNIT_TEST=ON .
cmake --build .
./test/ark_cpp_crypto_tests
lcov --directory . --include "*/src/*" --include "*/test/*" --exclude "*/src/lib/*" --exclude "*/extern/*" --capture --output-file coverage.info --ignore-errors gcov
./cc-test-reporter format-coverage --input-type lcov coverage.info
./cc-test-reporter upload-coverage
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
27 changes: 0 additions & 27 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,6 @@ on:
types: [ready_for_review, synchronize, opened]

jobs:
codeclimate:
runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
- name: Set compiler to clang++
run: COMPILER=clang++
- name: Install Dependencies
run: brew install cmake lcov
- name: Make scripts executable
run: sudo chmod +x ./.github/workflows/test/clang_tidy.sh
- name: Setup Code Climate test-reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- name: Build & Run Coverage Tests
run: |
./cc-test-reporter before-build
cmake -DCMAKE_BUILD_TYPE=Coverage -DUNIT_TEST=ON .
cmake --build .
./test/ark_cpp_crypto_tests
lcov --directory . --include "*/src/*" --include "*/test/*" --exclude "*/src/lib/*" --exclude "*/extern/*" --capture --output-file coverage.info --ignore-errors gcov
./cc-test-reporter format-coverage --input-type lcov coverage.info
./cc-test-reporter upload-coverage
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

codecov:
runs-on: ubuntu-latest

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,5 @@ jobs:
shell: cmd
run: msbuild "%GITHUB_WORKSPACE%\ark_cpp_crypto.sln"
- name: Run Tests
run: call "%GITHUB_WORKSPACE%\test\Debug\ark_cpp_crypto_tests"
shell: cmd
run: "%GITHUB_WORKSPACE%\\test\\Debug\\ark_cpp_crypto_tests.exe"
Empty file modified .github/workflows/test/clang_format.sh
100644 → 100755
Empty file.
Empty file modified .github/workflows/test/clang_tidy.sh
100644 → 100755
Empty file.
4 changes: 3 additions & 1 deletion .github/workflows/test/install_arduino.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ sudo ln -s /usr/local/share/arduino-cli /usr/local/bin/arduino-cli

printf "board_manager:
additional_urls:
- https://dl.espressif.com/dl/package_esp32_index.json" >> .cli-config.yml
- https://dl.espressif.com/dl/package_esp32_index.json
- http://arduino.esp8266.com/stable/package_esp8266com_index.json" >> .cli-config.yml
sudo mv .cli-config.yml /usr/local/share/

arduino-cli core update-index
arduino-cli core install esp32:esp32
arduino-cli core install esp8266:esp8266
Empty file modified .github/workflows/test/install_platform_io.sh
100644 → 100755
Empty file.
5 changes: 4 additions & 1 deletion .github/workflows/test/script_arduino.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ mkdir -p ~/Arduino/libraries/cpp-crypto/
mv ${GITHUB_WORKSPACE}/* ~/Arduino/libraries/cpp-crypto/

arduino-cli lib install "[email protected]"
arduino-cli lib install "[email protected]"
arduino-cli lib install "[email protected]"
arduino-cli lib install "[email protected]"
arduino-cli lib install "[email protected]"

arduino-cli compile --output temp.bin -b esp32:esp32:esp32 ~/Arduino/libraries/cpp-crypto/examples/arduino/ESP32/ESP32.ino --debug

arduino-cli compile --output temp.bin -b esp8266:esp8266:nodemcu ~/Arduino/libraries/cpp-crypto/examples/arduino/ESP8266/ESP8266.ino --debug
2 changes: 2 additions & 0 deletions .github/workflows/test/script_desktop.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

# run desktop builds
cmake . -DCMAKE_BUILD_TYPE=Coverage
cmake --build .
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test/script_platform_io.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/env bash

# run PlatformIO builds
platformio run
platformio run -d ./test

# platformio run -e esp8266_tests -d test
platformio run -e esp32_tests -d test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
/include/uECC
/lib/
/bin/
build
./build
./extern
/src/ark_cpp_crypto.vcxproj.filters
/src/ark_cpp_crypto.vcxproj
/src/ark_cpp_crypto.sln
Expand Down
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2020-02-13

## [1.0.0-arduino] - 2020-02-13

### Changed
- break up unit tests to support platforms with limited RAM ([#172])
- removed use of monolithic `arkCrypto.h` header ([#190])

### Added
- added AIP-11 support for Core v.2.6 Transactions ([#198])

### Fixed
- fixed `transaction::to_array` tests on ESP8266 ([#178])
- fixed `transaction::to_json` tests on ESP8266 ([#180])

## [0.7.0] - 2019-10-08

## [0.7.0-arduino] - 2019-10-08
Expand Down Expand Up @@ -121,5 +136,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
[#121]: https://github.com/ArkEcosystem/cpp-crypto/pull/121
[#133]: https://github.com/ArkEcosystem/cpp-crypto/pull/133
[#156]: https://github.com/ArkEcosystem/cpp-crypto/pull/156
[0.7.0]: https://github.com/ArkEcosystem/cpp-crypto/compare/0.6.0...0.7.0
[0.7.0-arduino]: https://github.com/ArkEcosystem/cpp-crypto/compare/0.6.0-arduino...0.7.0-arduino
[0.7.0]: https://github.com/ArkEcosystem/cpp-crypto/compare/0.6.0-arduino...0.7.0
[#172]: https://github.com/ArkEcosystem/cpp-crypto/pull/172
[#178]: https://github.com/ArkEcosystem/cpp-crypto/pull/178
[#180]: https://github.com/ArkEcosystem/cpp-crypto/pull/180
[#190]: https://github.com/ArkEcosystem/cpp-crypto/pull/190
[#198]: https://github.com/ArkEcosystem/cpp-crypto/pull/198
[1.0.0]: https://github.com/ArkEcosystem/cpp-crypto/compare/0.7.0-arduino...1.0.0
[1.0.0-arduino]: https://github.com/ArkEcosystem/cpp-crypto/compare/0.7.0-arduino...1.0.0-arduino
80 changes: 60 additions & 20 deletions cmake/External.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
# ArduinoJson: https://github.com/bblanchon/ArduinoJson
# ------------------------------------------------------------------------------

# Set the configuration
# Copy the configuration
configure_file(${CMAKE_SOURCE_DIR}/cmake/extern/ArduinoJson.txt.in
${EXTERNAL_LIBRARY_DIR}/arduinojson/CMakeLists.txt)

# Execute Git Clone and run Cmake
# Configure the Cmake build
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${EXTERNAL_LIBRARY_DIR}/arduinojson)

if(result)
message(FATAL_ERROR "ArduinoJson: CMake Failed: ${result}")
message(FATAL_ERROR "ArduinoJson: CMake Configuration Failed: ${result}")
endif()

# Build the Cloned Repo
# Execute Git Clone and run Cmake
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${EXTERNAL_LIBRARY_DIR}/arduinojson)

if(result)
message(FATAL_ERROR "ArduinoJson: Build Failed: ${result}")
message(FATAL_ERROR "ArduinoJson: Clone and Build Step Failed: ${result}")
endif()

set(ARDUINO_JSON_SOURCE_DIR
Expand All @@ -33,68 +33,107 @@ include_directories(${ARDUINO_JSON_SOURCE_DIR})

# ------------------------------------------------------------------------------

# ------------------------------------------------------------------------------
# BCL: https://github.com/sleepdefic1t/bcl
# ------------------------------------------------------------------------------

# Copy the configuration
configure_file(${CMAKE_SOURCE_DIR}/cmake/extern/BCL.txt.in
${EXTERNAL_LIBRARY_DIR}/bcl/CMakeLists.txt)

# Configure the Cmake build
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${EXTERNAL_LIBRARY_DIR}/bcl)

if(result)
message(FATAL_ERROR "BCL: CMake Configuration Failed: ${result}")
endif()

# Execute Git Clone and run Cmake
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${EXTERNAL_LIBRARY_DIR}/bcl)

if(result)
message(FATAL_ERROR "BIP66: Clone and Build Step Failed: ${result}")
endif()

set(BCL_SOURCE
${EXTERNAL_LIBRARY_DIR}/bcl/src/src/Base58Check.cpp
${EXTERNAL_LIBRARY_DIR}/bcl/src/src/CurvePoint.cpp
${EXTERNAL_LIBRARY_DIR}/bcl/src/src/Ecdsa.cpp
${EXTERNAL_LIBRARY_DIR}/bcl/src/src/FieldInt.cpp
${EXTERNAL_LIBRARY_DIR}/bcl/src/src/Ripemd160.cpp
${EXTERNAL_LIBRARY_DIR}/bcl/src/src/Sha256.cpp
${EXTERNAL_LIBRARY_DIR}/bcl/src/src/Sha256Hash.cpp
${EXTERNAL_LIBRARY_DIR}/bcl/src/src/Uint256.cpp
${EXTERNAL_LIBRARY_DIR}/bcl/src/src/Utils.cpp
CACHE INTERNAL "BCL: Source Files"
)

include_directories(${EXTERNAL_LIBRARY_DIR}/bcl/src/src)

# ------------------------------------------------------------------------------

# ------------------------------------------------------------------------------
# BIP66: https://github.com/sleepdefic1t/BIP66
# ------------------------------------------------------------------------------

# Set the configuration
# Copy the configuration
configure_file(${CMAKE_SOURCE_DIR}/cmake/extern/BIP66.txt.in
${EXTERNAL_LIBRARY_DIR}/bip66/CMakeLists.txt)

# Execute Git Clone and run Cmake
# Configure the Cmake build
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${EXTERNAL_LIBRARY_DIR}/bip66)

if(result)
message(FATAL_ERROR "BIP66: CMake Failed: ${result}")
message(FATAL_ERROR "BIP66: CMake Configuration Failed: ${result}")
endif()

# Build the Cloned Repo
# Execute Git Clone and run Cmake
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${EXTERNAL_LIBRARY_DIR}/bip66)

if(result)
message(FATAL_ERROR "BIP66: Build Failed: ${result}")
message(FATAL_ERROR "BIP66: Clone and Build Step Failed: ${result}")
endif()

add_subdirectory("${EXTERNAL_LIBRARY_DIR}/bip66/src/src"
"${EXTERNAL_LIBRARY_DIR}/bip66/build"
EXCLUDE_FROM_ALL)

set(BIP66_SOURCE
${EXTERNAL_LIBRARY_DIR}/bip66/src/src/bip66.cpp
CACHE INTERNAL "BIP66: Source Files")

include_directories(${BIP66_SOURCE_DIR})
include_directories(${EXTERNAL_LIBRARY_DIR}/bip66/src/)

# ------------------------------------------------------------------------------

# ------------------------------------------------------------------------------
# uECC: https://github.com/kmackay/micro-ecc
# ------------------------------------------------------------------------------

# Set the configuration
# Copy the configuration
configure_file(${CMAKE_SOURCE_DIR}/cmake/extern/uECC.txt.in
${EXTERNAL_LIBRARY_DIR}/uecc/CMakeLists.txt)

# Execute Git Clone and run Cmake
# Configure the Cmake build
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${EXTERNAL_LIBRARY_DIR}/uecc)

if(result)
message(FATAL_ERROR "uECC: CMake Failed: ${result}")
message(FATAL_ERROR "uECC: CMake Configuration Failed: ${result}")
endif()

# Build the Cloned Repo
# Execute Git Clone and run Cmake
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${EXTERNAL_LIBRARY_DIR}/uecc)

if(result)
message(FATAL_ERROR "uECC: Build Failed: ${result}")
message(FATAL_ERROR "uECC: Clone and Build Step Failed: ${result}")
endif()

set(UECC_SOURCE_DIR
Expand All @@ -114,6 +153,7 @@ include_directories(${UECC_SOURCE_DIR})
# ------------------------------------------------------------------------------

set(EXTERNAL_LIBRARY_SOURCE
${BCL_SOURCE}
${BIP66_SOURCE}
${UECC_SOURCE}
CACHE INTERNAL "External Lib Binary Files")
Expand Down
3 changes: 3 additions & 0 deletions cmake/extern/ArduinoJson.txt.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

cmake_minimum_required(VERSION 3.2)

project(arduinojson-download)

include(ExternalProject)

# ------------------------------------------------------------------------------
Expand All @@ -10,6 +12,7 @@ include(ExternalProject)
ExternalProject_Add(ArduinoJson
GIT_REPOSITORY https://github.com/bblanchon/ArduinoJson
GIT_TAG v6.12.0
GIT_CONFIG advice.detachedHead=false
SOURCE_DIR "${EXTERNAL_LIBRARY_DIR}/arduinojson/src"
BINARY_DIR "${EXTERNAL_LIBRARY_DIR}/arduinojson/build"
CONFIGURE_COMMAND ""
Expand Down
24 changes: 24 additions & 0 deletions cmake/extern/BCL.txt.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

cmake_minimum_required(VERSION 3.2)

project(bcl-download)

include(ExternalProject)

# ------------------------------------------------------------------------------
# BCL: https://github.com/sleepdefic1t/bcl
# ------------------------------------------------------------------------------

ExternalProject_Add(BCL
GIT_REPOSITORY https://github.com/sleepdefic1t/bcl
GIT_TAG 0.0.5
GIT_CONFIG advice.detachedHead=false
SOURCE_DIR "${EXTERNAL_LIBRARY_DIR}/bcl/src"
BINARY_DIR "${EXTERNAL_LIBRARY_DIR}/bcl/build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)

# ------------------------------------------------------------------------------
5 changes: 4 additions & 1 deletion cmake/extern/BIP66.txt.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

cmake_minimum_required(VERSION 3.2)

project(bip66-download)

include(ExternalProject)

# ------------------------------------------------------------------------------
Expand All @@ -9,7 +11,8 @@ include(ExternalProject)

ExternalProject_Add(BIP66
GIT_REPOSITORY https://github.com/sleepdefic1t/BIP66
GIT_TAG 0.2.1
GIT_TAG 0.3.2
GIT_CONFIG advice.detachedHead=false
SOURCE_DIR "${EXTERNAL_LIBRARY_DIR}/bip66/src"
BINARY_DIR "${EXTERNAL_LIBRARY_DIR}/bip66/build"
CONFIGURE_COMMAND ""
Expand Down
Loading

0 comments on commit f06376c

Please sign in to comment.