Skip to content

Commit

Permalink
update to v0.1.6 (#17)
Browse files Browse the repository at this point in the history
Co-authored-by: k-matsuzawa <[email protected]>
  • Loading branch information
ko-matsu and k-matsuzawa authored Sep 4, 2020
1 parent 3771005 commit 67f13c4
Show file tree
Hide file tree
Showing 27 changed files with 1,653 additions and 724 deletions.
20 changes: 5 additions & 15 deletions .github/workflows/check_pre-merge_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
- test_ci

env:
CMAKE_VERSION: 3.15.5
CMAKE_BUILD_PARALLEL_LEVEL: 4

jobs:
Expand All @@ -21,28 +20,19 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node: [8, 12, 13, 14]
os: [macos-latest, ubuntu-latest]
node: [8, 12, 14]
exclude:
- os: windows-latest
node: 8
- os: macos-latest
node: 8
- os: macos-latest
node: 13

steps:
- uses: actions/checkout@v2
- uses: actions/[email protected].0
- uses: actions/[email protected].1
continue-on-error: true
timeout-minutes: 1
with:
node-version: ${{ matrix.node }}
- name: setup-node retry
uses: actions/[email protected]
timeout-minutes: 1
with:
node-version: ${{ matrix.node }}
- name: dump node version
id: node_ver
run: |
Expand All @@ -62,13 +52,13 @@ jobs:
id: npm_info
run: |
npm --version
echo "::set-output name=npm_cachedir::$(npm config get cache)"
echo "::set-output name=temp_npm_cachedir::$(npm config get cache)"
- name: use npm cache
if: matrix.os != 'windows-latest' && steps.node_cache.outputs.cache-hit != 'true'
uses: actions/cache@v1
id: npm_cache
with:
path: ${{ steps.npm_info.outputs.npm_cachedir }}
path: ${{ steps.npm_info.outputs.temp_npm_cachedir }}
key: npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-0
restore-keys: |
npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-
Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/check_pre-merge_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
- master

env:
CMAKE_VERSION: 3.15.5
CMAKE_BUILD_PARALLEL_LEVEL: 4

jobs:
Expand All @@ -19,28 +18,19 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node: [8, 12, 13, 14]
os: [macos-latest, ubuntu-latest]
node: [8, 12, 14]
exclude:
- os: windows-latest
node: 8
- os: macos-latest
node: 8
- os: macos-latest
node: 13

steps:
- uses: actions/checkout@v2
- uses: actions/[email protected].0
- uses: actions/[email protected].1
continue-on-error: true
timeout-minutes: 1
with:
node-version: ${{ matrix.node }}
- name: setup-node retry
uses: actions/[email protected]
timeout-minutes: 1
with:
node-version: ${{ matrix.node }}
- name: dump node version
id: node_ver
run: |
Expand All @@ -60,13 +50,13 @@ jobs:
id: npm_info
run: |
npm --version
echo "::set-output name=npm_cachedir::$(npm config get cache)"
echo "::set-output name=temp_npm_cachedir::$(npm config get cache)"
- name: use npm cache
if: matrix.os != 'windows-latest' && steps.node_cache.outputs.cache-hit != 'true'
uses: actions/cache@v1
id: npm_cache
with:
path: ${{ steps.npm_info.outputs.npm_cachedir }}
path: ${{ steps.npm_info.outputs.temp_npm_cachedir }}
key: npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-0
restore-keys: |
npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-
Expand Down
19 changes: 6 additions & 13 deletions .github/workflows/check_pre-merge_sprint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
- features/sprint*

env:
CMAKE_VERSION: 3.15.5
CMAKE_BUILD_PARALLEL_LEVEL: 4

jobs:
Expand All @@ -19,28 +18,22 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
# os: [macos-latest, windows-latest, ubuntu-latest]
os: [macos-latest, ubuntu-latest]
node: [8, 12, 14]
exclude:
- os: windows-latest
node: 8
- os: macos-latest
node: 8
- os: macos-latest
node: 14
node: 12

steps:
- uses: actions/checkout@v2
- uses: actions/[email protected].0
- uses: actions/[email protected].1
continue-on-error: true
timeout-minutes: 1
with:
node-version: ${{ matrix.node }}
- name: setup-node retry
uses: actions/[email protected]
timeout-minutes: 1
with:
node-version: ${{ matrix.node }}
- name: dump node version
id: node_ver
run: |
Expand All @@ -60,13 +53,13 @@ jobs:
id: npm_info
run: |
npm --version
echo "::set-output name=npm_cachedir::$(npm config get cache)"
echo "::set-output name=temp_npm_cachedir::$(npm config get cache)"
- name: use npm cache
if: matrix.os != 'windows-latest' && steps.node_cache.outputs.cache-hit != 'true'
uses: actions/cache@v1
id: npm_cache
with:
path: ${{ steps.npm_info.outputs.npm_cachedir }}
path: ${{ steps.npm_info.outputs.temp_npm_cachedir }}
key: npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-0
restore-keys: |
npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-
Expand Down
25 changes: 11 additions & 14 deletions .github/workflows/create_release-and-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ jobs:
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash
# run: |
# echo "##[set-output name=VERSION;]$(echo ${GITHUB_REF#refs/tags/})"
# echo "CMAKE_VERSION=${env:CMAKE_VERSION}" > cmake_ver.txt
# cat cmake_ver.txt
- name: dump version
env:
version: ${{ steps.get_version.outputs.VERSION }}
Expand Down Expand Up @@ -118,16 +114,17 @@ jobs:
asset_path: ./cfd.zip
asset_name: cfdjs-api-${{ steps.get_version.outputs.VERSION }}-win-vs2019-x86_64.zip
asset_content_type: application/zip
- name: npm install
run: npm install
timeout-minutes: 20
- name: prebuild
run: npm run prebuild_all
- name: prebuild upload
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run prebuild_upload_all -- ${GITHUB_TOKEN}
shell: bash
# Comment out until the node addon's build on windows is possible.
# - name: npm install
# run: npm install
# timeout-minutes: 20
# - name: prebuild
# run: npm run prebuild_all
# - name: prebuild upload
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: npm run prebuild_upload_all -- ${GITHUB_TOKEN}
# shell: bash

upload-object-ubuntu:
name: upload-object-ubuntu
Expand Down
72 changes: 37 additions & 35 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ set(CFDJS_API_INSTALLED TRUE)
endif() # find_package
endif()

find_package(cfd QUIET CONFIG)
find_package(univalue QUIET CONFIG)
find_package(wally QUIET CONFIG)
find_package(cfdcore QUIET CONFIG)
find_package(cfd QUIET CONFIG)
if((NOT CFDJS_API_INSTALLED) OR (NOT cfd_FOUND) OR (NOT ${cfd_FOUND}) OR (NOT cfdcore_FOUND) OR (NOT ${cfdcore_FOUND}))
# load and compile libwally
else()
Expand All @@ -64,31 +66,24 @@ include(${CMAKE_CURRENT_BINARY_DIR}/${EXTERNAL_LOCAL_CURRENT_FILENAME}.cmake)
message(STATUS "[external project local] load current cfd-js file")
endif()

if(NOT CFDJS_API_INSTALLED)

# cfd
if(CFD_TARGET_VERSION)
set(CFD_TARGET_TAG ${CFD_TARGET_VERSION})
message(STATUS "[external project local] cfd target=${CFD_TARGET_VERSION}")
else()
set(CFD_TARGET_TAG v0.1.5)
endif()
if(CFD_TARGET_URL)
set(CFD_TARGET_REP ${CFD_TARGET_URL})
message(STATUS "[external project local] cfd url=${CFD_TARGET_URL}")
# libwally-core (force build on wallycore.node)
if(LIBWALLY_TARGET_VERSION)
set(LIBWALLY_TARGET_TAG ${LIBWALLY_TARGET_VERSION})
message(STATUS "[external project cfd-js local] libwally-core target=${LIBWALLY_TARGET_VERSION}")
else()
set(CFD_TARGET_REP p2pderivatives/cfd.git)
set(LIBWALLY_TARGET_TAG refs/tags/cfd-0.0.6)
endif()

if(${USE_GIT_SSH})
set(CFD_URL [email protected]:${CFD_TARGET_REP})
set(LIBWALLY_URL [email protected]:cryptogarageinc/libwally-core.git)
else()
set(CFD_URL https://github.com/${CFD_TARGET_REP})
set(LIBWALLY_URL https://github.com/cryptogarageinc/libwally-core.git)
endif()

set(TEMPLATE_PROJECT_NAME cfd)
set(TEMPLATE_PROJECT_GIT_REPOSITORY ${CFD_URL})
set(TEMPLATE_PROJECT_GIT_TAG ${CFD_TARGET_TAG})
set(TEMPLATE_PROJECT_NAME libwally-core)
set(TEMPLATE_PROJECT_GIT_REPOSITORY ${LIBWALLY_URL})
set(TEMPLATE_PROJECT_GIT_TAG ${LIBWALLY_TARGET_TAG})
set(PROJECT_EXTERNAL "${CMAKE_SOURCE_DIR}/external/${TEMPLATE_PROJECT_NAME}/external")
set(DIR_PATH "${CFD_ROOT_BINARY_DIR}/${TEMPLATE_PROJECT_NAME}")
set(DL_PATH "${CFD_ROOT_BINARY_DIR}/external/${TEMPLATE_PROJECT_NAME}/download")
Expand All @@ -97,6 +92,7 @@ get_property(PROP_VALUE GLOBAL PROPERTY ${TEMPLATE_PROJECT_NAME})
if(PROP_VALUE)
message(STATUS "[exist directory] ${TEMPLATE_PROJECT_NAME} exist")
else()
message(STATUS "[external project cfd-js] libwally-core target=${LIBWALLY_TARGET_TAG}")
configure_file(template_CMakeLists.txt.in ${DL_PATH}/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -S . -B ${DL_PATH}
RESULT_VARIABLE result
Expand All @@ -117,36 +113,37 @@ if(EXISTS ${PROJECT_EXTERNAL})
${CFD_ROOT_BINARY_DIR}/external/${TEMPLATE_PROJECT_NAME}/external)
endif()

if((NOT cfd_FOUND) OR (NOT ${cfd_FOUND}))
add_subdirectory(${CMAKE_SOURCE_DIR}/external/${TEMPLATE_PROJECT_NAME}
${DIR_PATH}/build)
else()
message(STATUS "[external project local] use cfd cache")
endif((NOT cfd_FOUND) OR (NOT ${cfd_FOUND}))

set_property(GLOBAL PROPERTY ${TEMPLATE_PROJECT_NAME} 1)
endif()

endif(NOT CFDJS_API_INSTALLED)

if(NOT CFDJS_API_INSTALLED)

# libwally-core (force build on wallycore.node)
if(LIBWALLY_TARGET_VERSION)
set(LIBWALLY_TARGET_TAG ${LIBWALLY_TARGET_VERSION})
message(STATUS "[external project cfd-js local] libwally-core target=${LIBWALLY_TARGET_VERSION}")
# cfd
if(CFD_TARGET_VERSION)
set(CFD_TARGET_TAG ${CFD_TARGET_VERSION})
message(STATUS "[external project local] cfd target=${CFD_TARGET_VERSION}")
else()
set(CFD_TARGET_TAG v0.1.6)
endif()
if(CFD_TARGET_URL)
set(CFD_TARGET_REP ${CFD_TARGET_URL})
message(STATUS "[external project local] cfd url=${CFD_TARGET_URL}")
else()
set(LIBWALLY_TARGET_TAG refs/tags/cfd-0.0.4)
set(CFD_TARGET_REP p2pderivatives/cfd.git)
endif()

if(${USE_GIT_SSH})
set(LIBWALLY_URL [email protected]:cryptogarageinc/libwally-core.git)
set(CFD_URL [email protected]:${CFD_TARGET_REP})
else()
set(LIBWALLY_URL https://github.com/cryptogarageinc/libwally-core.git)
set(CFD_URL https://github.com/${CFD_TARGET_REP})
endif()

set(TEMPLATE_PROJECT_NAME libwally-core)
set(TEMPLATE_PROJECT_GIT_REPOSITORY ${LIBWALLY_URL})
set(TEMPLATE_PROJECT_GIT_TAG ${LIBWALLY_TARGET_TAG})
set(TEMPLATE_PROJECT_NAME cfd)
set(TEMPLATE_PROJECT_GIT_REPOSITORY ${CFD_URL})
set(TEMPLATE_PROJECT_GIT_TAG ${CFD_TARGET_TAG})
set(PROJECT_EXTERNAL "${CMAKE_SOURCE_DIR}/external/${TEMPLATE_PROJECT_NAME}/external")
set(DIR_PATH "${CFD_ROOT_BINARY_DIR}/${TEMPLATE_PROJECT_NAME}")
set(DL_PATH "${CFD_ROOT_BINARY_DIR}/external/${TEMPLATE_PROJECT_NAME}/download")
Expand All @@ -155,7 +152,6 @@ get_property(PROP_VALUE GLOBAL PROPERTY ${TEMPLATE_PROJECT_NAME})
if(PROP_VALUE)
message(STATUS "[exist directory] ${TEMPLATE_PROJECT_NAME} exist")
else()
message(STATUS "[external project cfd-js] libwally-core target=${LIBWALLY_TARGET_TAG}")
configure_file(template_CMakeLists.txt.in ${DL_PATH}/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -S . -B ${DL_PATH}
RESULT_VARIABLE result
Expand All @@ -176,8 +172,14 @@ if(EXISTS ${PROJECT_EXTERNAL})
${CFD_ROOT_BINARY_DIR}/external/${TEMPLATE_PROJECT_NAME}/external)
endif()

if((NOT cfd_FOUND) OR (NOT ${cfd_FOUND}))
add_subdirectory(${CMAKE_SOURCE_DIR}/external/${TEMPLATE_PROJECT_NAME}
${DIR_PATH}/build)
else()
message(STATUS "[external project local] use cfd cache")
endif((NOT cfd_FOUND) OR (NOT ${cfd_FOUND}))

set_property(GLOBAL PROPERTY ${TEMPLATE_PROJECT_NAME} 1)
endif()

endif(NOT CFDJS_API_INSTALLED)
9 changes: 5 additions & 4 deletions include/cfdjs/cfdjs_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ struct AddSignTxInRequestStruct {
* @brief AddSignRequestStruct struct
*/
struct AddSignRequestStruct {
std::string tx = ""; //!< tx // NOLINT
bool is_elements = false; //!< is_elements // NOLINT
std::string tx = ""; //!< tx // NOLINT
AddSignTxInRequestStruct txin; //!< txin // NOLINT
std::set<std::string> ignore_items; //!< using on JSON mapping convert.
};
Expand Down Expand Up @@ -1962,9 +1962,10 @@ struct EstimateFeeRequestStruct {
* @brief EstimateFeeResponseStruct struct
*/
struct EstimateFeeResponseStruct {
int64_t fee_amount = 0; //!< fee_amount // NOLINT
int64_t tx_fee_amount = 0; //!< tx_fee_amount // NOLINT
int64_t utxo_fee_amount = 0; //!< utxo_fee_amount // NOLINT
int64_t fee_amount = 0; //!< fee_amount // NOLINT
int64_t tx_fee_amount = 0; //!< tx_fee_amount // NOLINT
int64_t txout_fee_amount = 0; //!< txout_fee_amount // NOLINT
int64_t utxo_fee_amount = 0; //!< utxo_fee_amount // NOLINT
cfd::js::api::InnerErrorResponseStruct error; //!< error information
std::set<std::string> ignore_items; //!< using on JSON mapping convert.
};
Expand Down
Loading

0 comments on commit 67f13c4

Please sign in to comment.