Skip to content

Commit

Permalink
update to v0.2.0 (#21)
Browse files Browse the repository at this point in the history
* update from cryptogarageinc/cfd-core v0.2.6 (#21)

Co-authored-by: k-matsuzawa <[email protected]>
  • Loading branch information
ko-matsu and k-matsuzawa authored Oct 28, 2020
1 parent 19df788 commit 18c8fd6
Show file tree
Hide file tree
Showing 40 changed files with 2,471 additions and 705 deletions.
40 changes: 0 additions & 40 deletions .github/workflows/check_pre-merge_sprint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,50 +62,13 @@ jobs:
os: [ubuntu-20.04, ubuntu-18.04]
shared: [on]
elements: [on, off]
cmake_cache: [false]
# Currently using cmake 3.17.0 by default
# exclude:
# - os: ubuntu-18.04
# cmake_cache: false
# - os: ubuntu-16.04
# cmake_cache: false
# include:
# - os: ubuntu-18.04
# cmake_cache: true
# - os: ubuntu-16.04
# cmake_cache: true

steps:
- uses: actions/checkout@v2
- name: dump version
run: |
cmake --version
gcc --version
- name: cmake-useCache-ubuntu
uses: actions/cache@v1
if: matrix.cmake_cache == 'true'
with:
path: cache/cmake
key: ${{ runner.os }}-cmake-${{ env.CMAKE_VERSION }}-x64-0
restore-keys: |
${{ runner.os }}-cmake-${{ env.CMAKE_VERSION }}-x64-
- name: cmake-download-ubuntu
if: matrix.cmake_cache == 'true' && steps.cache.outputs.cache-hit != 'true'
run: |
mkdir -p cache/cmake
cd cache/cmake
wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz
cd ../..
- name: cmake-setting-ubuntu
if: matrix.cmake_cache == 'true'
run: |
export cmake_file_name="cmake-$CMAKE_VERSION-Linux-x86_64"
cd cache/cmake
tar zxvf $cmake_file_name.tar.gz
chmod +x $cmake_file_name/bin/cmake $cmake_file_name/bin/ctest
export CURRENT_DIR=$(pwd)
echo ::add-path::$CURRENT_DIR/$cmake_file_name/bin
cd ../..
- name: ubuntu-apt-install
if: matrix.elements == 'on'
run: |
Expand Down Expand Up @@ -137,9 +100,6 @@ jobs:
with:
name: output-lcov-cfdcore-${{ matrix.os }}
path: ./build/lcov_cfdcore_output.zip
- name: ubuntu-after
if: matrix.cmake_cache == 'true'
run: rm -rf cache/cmake/cmake-$CMAKE_VERSION-Linux-x86_64

doxygen-ubuntu:
name: doxygen-check
Expand Down
106 changes: 106 additions & 0 deletions .github/workflows/code_scanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: code scan

on:
push:
branches:
- master
- develop
- features/sprint*
- feature/code_scanning
pull_request:
branches:
- master
- develop
- features/sprint*

jobs:
analyze-CodeQL:
name: CodeQL
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['cpp']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# https://git.io/JvXDl

# ️ If the Autobuild fails above, remove it and uncomment the following three lines and modify them (or add more) to build your code if your project uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

OSSAR-Scan:
# OSSAR runs on windows-latest.
# ubuntu-latest and macos-latest support coming soon
runs-on: windows-latest

steps:
# Checkout your code repository to scan
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Ensure a compatible version of dotnet is installed.
# The [Microsoft Security Code Analysis CLI](https://aka.ms/mscadocs) is built with dotnet v3.1.201.
# A version greater than or equal to v3.1.201 of dotnet must be installed on the agent in order to run this action.
# GitHub hosted runners already have a compatible version of dotnet installed and this step may be skipped.
# For self-hosted runners, ensure dotnet version 3.1.201 or later is installed by including this action:
# - name: Install .NET
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: '3.1.x'

# Run open source static analysis tools
- name: Run OSSAR
uses: github/ossar-action@v1
id: ossar

# Upload results to the Security tab
- name: Upload OSSAR results
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: ${{ steps.ossar.outputs.sarifFile }}
2 changes: 2 additions & 0 deletions cmake/CfdCommonOption.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ endif()

if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(ENABLE_DEBUG TRUE)
set(RPATH_TARGET "Debug")
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUGBUILD>)
if(ENABLE_COVERAGE AND ${ENABLE_COVERAGE})
set(STACK_PROTECTOR_OPT "")
Expand All @@ -31,6 +32,7 @@ set(STACK_PROTECTOR_OPT $<IF:$<CXX_COMPILER_ID:MSVC>,/GS,-fstack-check -fstack-
endif()
else()
set(ENABLE_DEBUG FALSE)
set(RPATH_TARGET "Release")
set(STACK_PROTECTOR_OPT "")
endif() # CMAKE_BUILD_TYPE

Expand Down
2 changes: 1 addition & 1 deletion external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if(LIBWALLY_TARGET_VERSION)
set(LIBWALLY_TARGET_TAG ${LIBWALLY_TARGET_VERSION})
message(STATUS "[external project local] libwally-core target=${LIBWALLY_TARGET_VERSION}")
else()
set(LIBWALLY_TARGET_TAG refs/tags/cfd-0.0.6)
set(LIBWALLY_TARGET_TAG refs/tags/cfd-0.2.3)
endif()

if(${USE_GIT_SSH})
Expand Down
2 changes: 2 additions & 0 deletions include/cfdcore/Makefile.srclist
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ CFDCORE_PKGINCLUDE_FILES = \
cfdcore_exception.h \
cfdcore_iterator.h \
cfdcore_logger_interface.h \
cfdcore_schnorrsig.h \
cfdcore_ecdsa_adaptor.h \
$(CFDCORE_ELEMENTS_PKGINCLUDE_FILES)

23 changes: 22 additions & 1 deletion include/cfdcore/cfdcore_bytedata.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ class CFD_CORE_EXPORT ByteData {
*/
bool Equals(const ByteData& bytedata) const;

/**
* @brief Get head data only 1 byte.
* @details empty is return 0.
* @return 1byte data
*/
uint8_t GetHeadData() const;

/**
* @brief byte data情報をserializeする.
* @return serialize data
Expand Down Expand Up @@ -165,7 +172,7 @@ class CFD_CORE_EXPORT ByteData {
template <class ByteTop, class... ByteDataClass>
ByteData Concat(const ByteTop& top, const ByteDataClass&... args) const {
ByteData result = Concat(top);
return result.Join(args...);
return result.Concat(args...);
}

/**
Expand Down Expand Up @@ -279,6 +286,13 @@ class CFD_CORE_EXPORT ByteData160 {
*/
ByteData GetData() const;

/**
* @brief Get head data only 1 byte.
* @details empty is return 0.
* @return 1byte data
*/
uint8_t GetHeadData() const;

/**
* @brief Join byte data list.
* @param[in] data byte data.
Expand Down Expand Up @@ -427,6 +441,13 @@ class CFD_CORE_EXPORT ByteData256 {
*/
ByteData GetData() const;

/**
* @brief Get head data only 1 byte.
* @details empty is return 0.
* @return 1byte data
*/
uint8_t GetHeadData() const;

/**
* @brief Join byte data list.
* @param[in] data byte data.
Expand Down
Loading

0 comments on commit 18c8fd6

Please sign in to comment.