Skip to content

Commit

Permalink
update to v0.2.1 (#24)
Browse files Browse the repository at this point in the history
update from cryptogarageinc v0.2.10 + CI
Co-authored-by: k-matsuzawa <[email protected]>
  • Loading branch information
ko-matsu authored Nov 21, 2020
1 parent 680ffb8 commit 9f54d6d
Show file tree
Hide file tree
Showing 18 changed files with 1,060 additions and 190 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/check_pre-merge_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
jobs:
cmake-win-test:
name: cmake build-win
runs-on: windows-latest
runs-on: windows-2019
strategy:
matrix:
generator: ['Visual Studio 16 2019', 'MSYS Makefiles']
Expand All @@ -37,7 +37,10 @@ jobs:
cmake-mac-test:
name: cmake build-mac
runs-on: macos-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-10.15, macos-11.0]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -92,7 +95,7 @@ jobs:
doxygen-ubuntu:
name: doxygen-check
runs-on: ubuntu-latest
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/check_pre-merge_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
jobs:
cmake-win-test:
name: cmake build-win
runs-on: windows-latest
runs-on: windows-2019
strategy:
matrix:
generator: ['Visual Studio 16 2019', 'MSYS Makefiles']
Expand All @@ -37,7 +37,10 @@ jobs:
cmake-mac-test:
name: cmake build-mac
runs-on: macos-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-10.15, macos-11.0]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -92,7 +95,7 @@ jobs:
doxygen-ubuntu:
name: doxygen-check
runs-on: ubuntu-latest
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/check_pre-merge_sprint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
jobs:
cmake-win:
name: cmake build-win
runs-on: windows-latest
runs-on: windows-2019
strategy:
matrix:
generator: ['Visual Studio 16 2019', 'MSYS Makefiles']
Expand All @@ -37,7 +37,10 @@ jobs:
cmake-mac:
name: cmake build-mac
runs-on: macos-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-10.15, macos-11.0]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -98,7 +101,7 @@ jobs:

doxygen-ubuntu:
name: doxygen-check
runs-on: ubuntu-latest
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/code_scanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ on:
- develop
- features/sprint*
- feature/code_scanning
paths:
- '**.js'
- '**.ts'
- '**.cpp'
- '**.h'
- '**/code_scanner.yml'
- '**/external_project_local_setting.config'
pull_request:
branches:
- master
Expand All @@ -16,7 +23,7 @@ on:
jobs:
analyze-CodeQL:
name: CodeQL
runs-on: ubuntu-latest
runs-on: ubuntu-18.04

strategy:
fail-fast: false
Expand Down Expand Up @@ -68,7 +75,7 @@ jobs:
OSSAR-Scan:
# OSSAR runs on windows-latest.
# ubuntu-latest and macos-latest support coming soon
runs-on: windows-latest
runs-on: windows-2019

steps:
# Checkout your code repository to scan
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/create_release-and-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
create_releases:
name: create-releases
runs-on: ubuntu-latest
runs-on: ubuntu-18.04
outputs:
release_url: ${{ steps.output_url.outputs.upload_url }}

Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
upload-object-windows:
name: upload-object-win
needs: create_releases
runs-on: windows-latest
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
upload-object-alpine-3-10:
name: upload-object-alpine-3.10
needs: create_releases
runs-on: ubuntu-latest
runs-on: ubuntu-18.04

steps:
- name: checkout
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
upload-object-alpine-3-12:
name: upload-object-alpine-3.12
needs: create_releases
runs-on: ubuntu-latest
runs-on: ubuntu-18.04

steps:
- name: checkout
Expand Down Expand Up @@ -265,7 +265,7 @@ jobs:
upload-object-macos:
name: upload-object-macos
needs: create_releases
runs-on: macos-latest
runs-on: macos-10.15
strategy:
fail-fast: false
matrix:
Expand Down
82 changes: 0 additions & 82 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if(CFDCORE_TARGET_VERSION)
set(CFDCORE_TARGET_TAG ${CFDCORE_TARGET_VERSION})
message(STATUS "[external project local] cfd-core target=${CFDCORE_TARGET_VERSION}")
else()
set(CFDCORE_TARGET_TAG v0.2.0)
set(CFDCORE_TARGET_TAG v0.2.1)
endif()
if(CFDCORE_TARGET_URL)
set(CFDCORE_TARGET_REP ${CFDCORE_TARGET_URL})
Expand Down
17 changes: 13 additions & 4 deletions include/cfd/cfd_elements_transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ using cfd::core::AbstractTransaction;
using cfd::core::Address;
using cfd::core::AddressType;
using cfd::core::Amount;
using cfd::core::BlindData;
using cfd::core::BlindFactor;
using cfd::core::BlindParameter;
using cfd::core::BlockHash;
Expand Down Expand Up @@ -428,14 +429,16 @@ class CFD_EXPORT ConfidentialTransactionContext
* -1 to 18. -1 is public value. 0 is most private.
* @param[in] minimum_bits rangeproof blinding bits.
* 0 to 64. Number of bits of the value to keep private. 0 is auto.
* @param[out] blinder_list blinder list. (default is null)
*/
void BlindTransaction(
const std::map<OutPoint, BlindParameter>& utxo_info_map,
const std::map<OutPoint, IssuanceBlindingKeyPair>& issuance_key_map,
const std::vector<ElementsConfidentialAddress>&
confidential_address_list,
int64_t minimum_range_value = 1, int exponent = 0,
int minimum_bits = kDefaultBlindMinimumBits);
int minimum_bits = kDefaultBlindMinimumBits,
std::vector<BlindData>* blinder_list = nullptr);
/**
* @brief Blind Trasnsaction.
* @param[in] utxo_info_map txin utxo information map.
Expand All @@ -448,6 +451,7 @@ class CFD_EXPORT ConfidentialTransactionContext
* -1 to 18. -1 is public value. 0 is most private.
* @param[in] minimum_bits rangeproof blinding bits.
* 0 to 64. Number of bits of the value to keep private. 0 is auto.
* @param[out] blinder_list blinder list. (default is null)
*/
void BlindTransactionWithDirectKey(
const std::map<OutPoint, BlindParameter>& utxo_info_map,
Expand All @@ -456,7 +460,8 @@ class CFD_EXPORT ConfidentialTransactionContext
confidential_address_list,
const std::vector<ConfidentialKeyBlindParameter>& confidential_key_list,
int64_t minimum_range_value = 1, int exponent = 0,
int minimum_bits = kDefaultBlindMinimumBits);
int minimum_bits = kDefaultBlindMinimumBits,
std::vector<BlindData>* blinder_list = nullptr);

/**
* @brief Unblind issuance data.
Expand Down Expand Up @@ -502,12 +507,14 @@ class CFD_EXPORT ConfidentialTransactionContext
* -1 to 18. -1 is public value. 0 is most private.
* @param[in] minimum_bits rangeproof blinding bits.
* 0 to 64. Number of bits of the value to keep private. 0 is auto.
* @param[out] blinder_list blinder list. (default is null)
*/
void Blind(
const std::vector<ElementsConfidentialAddress>* confidential_addresses =
nullptr,
int64_t minimum_range_value = 1, int exponent = 0,
int minimum_bits = kDefaultBlindMinimumBits);
int minimum_bits = kDefaultBlindMinimumBits,
std::vector<BlindData>* blinder_list = nullptr);
/**
* @brief Execute blinding issuance & txout using utxo data.
* @param[in] issuance_key_map issue blinding key map.
Expand All @@ -519,13 +526,15 @@ class CFD_EXPORT ConfidentialTransactionContext
* -1 to 18. -1 is public value. 0 is most private.
* @param[in] minimum_bits rangeproof blinding bits.
* 0 to 64. Number of bits of the value to keep private. 0 is auto.
* @param[out] blinder_list blinder list. (default is null)
*/
void BlindIssuance(
const std::map<OutPoint, IssuanceBlindingKeyPair>& issuance_key_map,
const std::vector<ElementsConfidentialAddress>* confidential_addresses =
nullptr,
int64_t minimum_range_value = 1, int exponent = 0,
int minimum_bits = kDefaultBlindMinimumBits);
int minimum_bits = kDefaultBlindMinimumBits,
std::vector<BlindData>* blinder_list = nullptr);

/**
* @brief sign with privkey.
Expand Down
34 changes: 34 additions & 0 deletions include/cfdc/cfdcapi_elements_transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ enum CfdBlindOption {
kCfdBlindOptionExponent = 2,
/** blind option: minBits */
kCfdBlindOptionMinimumBits = 3,
/** blind option: collect blinder */
kCfdBlindOptionCollectBlinder = 4,
};

/**
Expand Down Expand Up @@ -557,12 +559,44 @@ CFDC_API int CfdAddBlindTxOutByAddress(
* @param[in] blind_handle blinding handle.
* @param[in] tx_hex_string transaction hex.
* @param[out] tx_string blinding transaction hex.
* If 'CfdFreeStringBuffer' is implemented,
* Call 'CfdFreeStringBuffer' after you are finished using it.
* @return CfdErrorCode
*/
CFDC_API int CfdFinalizeBlindTx(
void* handle, void* blind_handle, const char* tx_hex_string,
char** tx_string);

/**
* @brief get blinding data.
* @param[in] handle cfd handle.
* @param[in] blind_handle blinding handle.
* @param[in] index index.
* @param[out] vout txout vout.
* @param[out] asset asset.
* If 'CfdFreeStringBuffer' is implemented,
* Call 'CfdFreeStringBuffer' after you are finished using it.
* @param[out] value_satoshi satoshi amount.
* @param[out] asset_blind_factor asset blinder.
* If 'CfdFreeStringBuffer' is implemented,
* Call 'CfdFreeStringBuffer' after you are finished using it.
* @param[out] value_blind_factor amount blinder.
* If 'CfdFreeStringBuffer' is implemented,
* Call 'CfdFreeStringBuffer' after you are finished using it.
* @param[out] issuance_txid issuance utxo txid.
* If 'CfdFreeStringBuffer' is implemented,
* Call 'CfdFreeStringBuffer' after you are finished using it.
* @param[out] issuance_vout issuance utxo vount.
* @param[out] is_issuance_asset issuance asset.
* @param[out] is_issuance_token issuance token.
* @return CfdErrorCode
*/
CFDC_API int CfdGetBlindTxBlindData(
void* handle, void* blind_handle, uint32_t index, uint32_t* vout,
char** asset, int64_t* value_satoshi, char** asset_blind_factor,
char** value_blind_factor, char** issuance_txid, uint32_t* issuance_vout,
bool* is_issuance_asset, bool* is_issuance_token);

/**
* @brief free blinding handle.
* @param[in] handle handle pointer.
Expand Down
Loading

0 comments on commit 9f54d6d

Please sign in to comment.