Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update to 0.4.3 #78

Merged
merged 3 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
FROM ghcr.io/cryptogarageinc/elements-testing:v0.1.1 as cfd_wasm_base
FROM ghcr.io/cryptogarageinc/elements-testing:v0.2.5 as cfd_wasm_base

ARG EMSDK_VERSION=2.0.12
ARG NODE_VERSION=14.15.5
ARG NODE_VERSION=14.18.2

# install tzdata before git
USER root
RUN apt-get update && apt-get install -y tzdata
ENV TZ=Asia/Tokyo

RUN apt-get update && apt-get install -y \
csh \
clang \
clang-format \
ccache \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -40,4 +42,5 @@ RUN chmod 755 /emscripten/emsdk/emsdk_env.sh && \

# RUN /emscripten/emsdk/emsdk_env.sh

ENTRYPOINT ["/bin/bash", "-l", "-c"]
USER testuser
CMD ["bash"]
1 change: 1 addition & 0 deletions cmake/CfdCommonOption.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ endif()
option(ENABLE_ELEMENTS "enable elements code (ON or OFF. default:ON)" ON)
option(ENABLE_TESTS "enable code tests (ON or OFF. default:ON)" ON)
option(ENABLE_EMSCRIPTEN "enable EMSCRIPTEN (ON or OFF. default:OFF)" OFF)
option(STD_CPP_VERSION "c++ version (11/14/17. default:14)" "14")

# use "cmake -DCMAKE_BUILD_TYPE=Debug" or "cmake-js -D"
# option(ENABLE_DEBUG "enable debugging (ON or OFF. default:OFF)" OFF)
Expand Down
6 changes: 6 additions & 0 deletions cmake/CfdCoverage.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
if(ENABLE_DEBUG AND ENABLE_COVERAGE AND ${ENABLE_DEBUG} AND ${ENABLE_COVERAGE})
if(CMAKE_CXX_COMPILER_ID AND ("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang"))
set(PROFILE_ARCS_OPT "")
set(TEST_COVERAGE_OPT "")
set(GCOV_LIBRARY "")
else()
set(COLLECT_COVERAGE ON)
set(PROFILE_ARCS_OPT -fprofile-arcs)
set(TEST_COVERAGE_OPT -ftest-coverage)
set(GCOV_LIBRARY gcov)
set(COVERAGE 1)
endif()
else()
set(PROFILE_ARCS_OPT "")
set(TEST_COVERAGE_OPT "")
Expand Down
2 changes: 1 addition & 1 deletion cmake/Cpp11Setting.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ else()
set(ENABLE_LOGGING TRUE)
endif()
else()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
set(ENABLE_LOGGING FALSE)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down
2 changes: 1 addition & 1 deletion dist/cfdjs_wasm.js

Large diffs are not rendered by default.

Binary file modified dist/cfdjs_wasm.wasm
Binary file not shown.
11 changes: 9 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,25 @@ services:
volumes:
- /private/work
- .:/private/cfd-js-wasm
- wasmbuild-ccache-data:/home/testuser/.cache/ccache
user: root
entrypoint: /private/cfd-js-wasm/tools/build_for_release.sh

wasm-test:
image: ghcr.io/cryptogarageinc/elements-testing:v0.2.3
image: ghcr.io/cryptogarageinc/elements-testing:v0.2.5
volumes:
- ./:/workspace
working_dir: /workspace
user: testuser
command: /bin/bash -c "npm install && NODE_OPTIONS=--no-experimental-fetch npm run test_example"

wasm-update-package-lock:
image: ghcr.io/cryptogarageinc/elements-testing:v0.2.3
image: ghcr.io/cryptogarageinc/elements-testing:v0.2.5
volumes:
- ./:/workspace
working_dir: /workspace
user: testuser
command: /bin/bash -c "./tools/update_package.sh"

volumes:
wasmbuild-ccache-data:
34 changes: 23 additions & 11 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2817,14 +2817,6 @@ export interface SchnorrSignResponse {
hex: string;
}

/** Request for creating a Schnorr signature. */
export interface SchnorrVerifyRequest {
pubkey: string;
message: string;
isHashed?: boolean;
signature: string;
}

/**
* Contains the validation result
* @property {boolean} valid - whether the signature is valid.
Expand Down Expand Up @@ -3604,7 +3596,10 @@ export interface VerifySignatureRequest {
genesisBlockHash?: string;
}

/** @property {boolean} success - verify result (true only. If it fails, an error is thrown.) */
/**
* Contains the validation result
* @property {boolean} success - verify result (true only. If it fails, an error is thrown.)
*/
export interface VerifySignatureResponse {
success: boolean;
}
Expand Down Expand Up @@ -3640,6 +3635,17 @@ export interface VerifySignatureTxInRequest {
codeSeparatorPosition?: bigint | number;
}

/**
* Request for verify signature.
* @property {string} pubkey - public key (ecdsa or x-only schnorr)
*/
export interface VerifySignatureWithPubkeyRequest {
pubkey: string;
message: string;
isHashed?: boolean;
signature: string;
}

/**
* Request data for verification
* @property {string} tx - transaction hex
Expand Down Expand Up @@ -4324,10 +4330,10 @@ export class Cfdjs {
SchnorrSign(jsonObject: SchnorrSignRequest): Promise<SchnorrSignResponse>;
/**
* Verify a Schnorr signature for a given message
* @param {SchnorrVerifyRequest} jsonObject - request data.
* @param {VerifySignatureWithPubkeyRequest} jsonObject - request data.
* @return {Promise<SchnorrVerifyResponse>} - response data.
*/
SchnorrVerify(jsonObject: SchnorrVerifyRequest): Promise<SchnorrVerifyResponse>;
SchnorrVerify(jsonObject: VerifySignatureWithPubkeyRequest): Promise<SchnorrVerifyResponse>;
/**
* Select coins.
* @param {SelectUtxosRequest} jsonObject - request data.
Expand Down Expand Up @@ -4490,6 +4496,12 @@ export class Cfdjs {
* @return {Promise<VerifySignatureResponse>} - response data.
*/
VerifySignature(jsonObject: VerifySignatureRequest): Promise<VerifySignatureResponse>;
/**
* Verify signature with pubkey.
* @param {VerifySignatureWithPubkeyRequest} jsonObject - request data.
* @return {Promise<VerifySignatureResponse>} - response data.
*/
VerifySignatureWithPubkey(jsonObject: VerifySignatureWithPubkeyRequest): Promise<VerifySignatureResponse>;
}

/**
Expand Down
10 changes: 5 additions & 5 deletions local_resource/external_project_local_setting.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
CFDJS_WASM_VERSION=0.4.1
CFDJS_TARGET_VERSION=refs/tags/v0.4.1
CFD_TARGET_VERSION=refs/tags/v0.4.3
CFDCORE_TARGET_VERSION=refs/tags/v0.4.3
LIBWALLY_TARGET_VERSION=refs/tags/cfd-0.4.5
CFDJS_WASM_VERSION=0.4.3
CFDJS_TARGET_VERSION=refs/tags/v0.4.10
CFD_TARGET_VERSION=refs/tags/v0.4.7
CFDCORE_TARGET_VERSION=refs/tags/v0.4.5
LIBWALLY_TARGET_VERSION=refs/tags/cfd-0.4.8
CFDJS_TARGET_URL=cryptogarageinc/cfd-js.git
CFD_TARGET_URL=cryptogarageinc/cfd.git
CFDCORE_TARGET_URL=cryptogarageinc/cfd-core.git
Loading