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

candidate 1.2.0 release #444

Merged
merged 9 commits into from
Feb 8, 2024
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
8 changes: 4 additions & 4 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2019, macos-11]
os: [ubuntu-22.04, windows-2019, macos-14]
env:
CIBW_BEFORE_ALL_LINUX: yum install -y swig || apk add swig
CIBW_BEFORE_ALL_MACOS: brew install gnu-sed swig automake
CIBW_BEFORE_ALL_MACOS: brew install gnu-sed swig automake libtool
CIBW_BEFORE_ALL_WINDOWS: choco install swig --version=3.0.12 --no-progress --allow-downgrade -y
CIBW_BEFORE_BUILD_WINDOWS: .\tools\msvc\swig.bat
CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair --only-plat -w {dest_dir} {wheel}
Expand All @@ -42,9 +42,9 @@ jobs:
platforms: arm64

- name: Build Wheels
uses: pypa/cibuildwheel@v2.14
uses: pypa/cibuildwheel@v2.16.5
env:
CIBW_SKIP: "cp3{5..7}-* cp3{6..11}-win32* cp3{6..11}-musllinux_aarch64* pp*"
CIBW_SKIP: "cp3{5..7}-* cp3{6..12}-win32* cp3{6..12}-musllinux_aarch64* pp*"
CIBW_ARCHS_LINUX: "x86_64 aarch64"
CIBW_ARCHS_MACOS: "x86_64 arm64 universal2"

Expand Down
29 changes: 29 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,32 @@ run_scan_build_clang:
- ./tools/cleanup.sh && ./tools/autogen.sh
- CC=clang CFLAGS="-O0" scan-build-11 ./configure --enable-export-all --enable-swig-python --enable-swig-java --disable-clear-tests --disable-asm
- scan-build-11 --keep-cc --exclude src/secp256k1/ make -j $(($(grep ^processor /proc/cpuinfo | wc -l) / 2))

cmake-test:
image: greenaddress/wallycore@sha256:f159b338f3d25e13958d79fbd709238e3864de5468b9d743625466a0a681e52b
tags:
- ga
script:
- mv _cmake cmake
- mv _CMakeLists.txt CMakeLists.txt
- mv src/_CMakeLists.txt src/CMakeLists.txt
- mv src/ctest/_CMakeLists.txt src/ctest/CMakeLists.txt
- cmake -B build-cmake -S .
-DBUILD_SHARED_LIBS:BOOL=FALSE
-DCMAKE_BUILD_TYPE:STRING=Debug
-DWALLYCORE_ENABLE_TESTS:BOOL=TRUE
-DWALLYCORE_ENABLE_COVERAGE:BOOL=TRUE
- cmake --build build-cmake
#- ctest --test-dir build-cmake --output-junit report.xml --output-on-failure -E "test_(clear|elements_tx)"
- cd build-cmake
- ctest --output-on-failure -E "test_(clear|elements_tx)"
- cd -
- pip install gcovr
- gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml --root ${CI_PROJECT_DIR}
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
reports:
# junit: build-cmake/report.xml # junit report generation not available in cmake 3.18
coverage_report:
coverage_format: cobertura
path: coverage.xml
16 changes: 15 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
# Changes

## Unreleased
## Version 1.2.0

### Added

- Python: Add Python 3.12 wheels to the binary releases/PyPI.
- tx: expose `wally_tx_input_clone`/`wally_tx_input_clone` for input cloning.
- Build: Add new static analysis CI runs.

### Changed

- Javascript: The npm build now uses nodejs 20, as nodejs 16 is end-of-life.
- Android: Update android NDK to version 26b.
- libsecp256k1-zkp: The library has been updated to include the latest
changes to its cmake infrastructure.
- cmake: Now takes advantage of the new libsecp256k1-zkp cmake files to build
experimental modules and export the project in cmake style. cmake now also
builds test and collects coverage data.

### Fixed

- Build: Don't use `which` on Debian as it is now deprecated.
- Various bug fixes from static analysis.
- Various build and documentation fixes.


## Version 1.1.0

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ installed.
For non-development use, you can install wally from PyPI with `pip` as follows:

```
pip install wallycore==1.1.0
pip install wallycore==1.2.0
```

For development, you can build and install wally using:
Expand Down
85 changes: 37 additions & 48 deletions _CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,61 +1,50 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.18)

project(
libwallycore
VERSION 1.1.0
VERSION 1.2.0
DESCRIPTION "A collection of useful primitives for cryptocurrency wallets"
LANGUAGES C
)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

option(BUILD_SHARED_LIBS "Build as shared library" OFF)

option(WALLYCORE_ENABLE_TESTS "Build tests" OFF)
option(WALLYCORE_INSTALL "Enable install" OFF)
option(WALLYCORE_COVERAGE "Enable coverage" OFF)
option(WALLYCORE_BUILD_ELEMENTS "Build elements" ON)

include(cmake/utils.cmake)
generate_config_file()
configure_file(src/ccan_config.h ccan_config.h COPYONLY)

include(cmake/libsecp256k1.cmake)

add_subdirectory(src)


### install directives
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)

set(LIB_CMAKE_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/wallycore)

configure_package_config_file(
${CMAKE_SOURCE_DIR}/cmake/wallycore-config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/wallycore-config.cmake"
INSTALL_DESTINATION ${LIB_CMAKE_INSTALL_DIR}
PATH_VARS LIB_CMAKE_INSTALL_DIR
)
write_basic_package_version_file(
wallycore-config-version.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)

install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/wallycore-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/wallycore-config-version.cmake"
DESTINATION
${LIB_CMAKE_INSTALL_DIR}
)
install(
TARGETS wallycore
EXPORT "wallycore-target"
COMPONENT wallycore
RUNTIME EXCLUDE_FROM_ALL
OBJECTS EXCLUDE_FROM_ALL
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(EXPORT "wallycore-target"
DESTINATION ${LIB_CMAKE_INSTALL_DIR}
NAMESPACE wallycore::
FILE "wallycore-targets.cmake"
)

# libsec256k1-zkp
set(SECP256K1_ENABLE_MODULE_ECDH ON)
set(SECP256K1_ENABLE_MODULE_RECOVERY ON)
set(SECP256K1_ENABLE_MODULE_EXTRAKEYS ON)
set(SECP256K1_ENABLE_MODULE_SCHNORRSIG ON)
set(SECP256K1_ENABLE_MODULE_ELLSWIFT OFF)
set(SECP256K1_ENABLE_MODULE_GENERATOR ON)
set(SECP256K1_ENABLE_MODULE_RANGEPROOF ON)
set(SECP256K1_ENABLE_MODULE_SURJECTIONPROOF ON)
set(SECP256K1_ENABLE_MODULE_WHITELIST ON)
set(SECP256K1_ENABLE_MODULE_MUSIG OFF)
set(SECP256K1_ENABLE_MODULE_ECDSA_ADAPTOR OFF)
set(SECP256K1_ENABLE_MODULE_ECDSA_S2C ON)
set(SECP256K1_ENABLE_MODULE_BPPP OFF)
set(SECP256K1_BUILD_BENCHMARK OFF)
set(SECP256K1_BUILD_TESTS OFF)
set(SECP256K1_BUILD_EXHAUSTIVE_TESTS OFF)
set(SECP256K1_BUILD_CTIME_TESTS OFF)
set(SECP256K1_BUILD_EXAMPLES OFF)
set(SECP256K1_INSTALL ${WALLYCORE_INSTALL})
add_subdirectory(./src/secp256k1/)

add_subdirectory(./src)

if(NOT WALLYCORE_ENABLE_TESTS)
return()
endif()

enable_testing()
add_subdirectory(src/ctest)
21 changes: 0 additions & 21 deletions _cmake/libsecp256k1-pkgconfig.cmake

This file was deleted.

116 changes: 0 additions & 116 deletions _cmake/libsecp256k1.cmake

This file was deleted.

7 changes: 2 additions & 5 deletions _cmake/wallycore-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ if("libsecp256k1" IN_LIST wallycore_FIND_COMPONENTS)
if(TARGET wallycore::libsecp256k1)
message(FATAL_ERROR "wallycore::libsecp256k1 already defined")
endif()
include(FindPkgConfig REQUIRED)
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON)
pkg_check_modules(libsecp256k1 REQUIRED IMPORTED_TARGET libsecp256k1)
add_library(wallycore::libsecp256k1 ALIAS PkgConfig::libsecp256k1)
find_package(libsecp256k1 CONFIG REQUIRED)
add_library(wallycore::libsecp256k1 ALIAS libsecp256k1::libsecp256k1)
set(wallycore_libsecp256k1_FOUND TRUE)
endif()

set(wallycore_COMPONENT_FOUND TRUE)


check_required_components(wallycore)
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AC_PREREQ([2.60])
AC_INIT([libwallycore],[1.1.0])
AC_INIT([libwallycore],[1.2.0])
AC_CONFIG_AUX_DIR([tools/build-aux])
AC_CONFIG_MACRO_DIR([tools/build-aux/m4])
AC_CONFIG_SRCDIR([src/mnemonic.h])
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def extract_docs(infile, outfile):
# built documents.
#
# The short X.Y version.
version = u'1.1.0'
version = u'1.2.0'
# The full version, including alpha/beta/rc tags.
release = version

Expand Down
12 changes: 12 additions & 0 deletions include/wally.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1872,6 +1872,18 @@ inline int tx_init_alloc(uint32_t version, uint32_t locktime, size_t inputs_allo
return detail::check_ret(__FUNCTION__, ret);
}

template <class TX_INPUT_IN>
inline int tx_input_clone(const TX_INPUT_IN& tx_input_in, struct wally_tx_input* input) {
int ret = ::wally_tx_input_clone(detail::get_p(tx_input_in), input);
return detail::check_ret(__FUNCTION__, ret);
}

template <class TX_INPUT_IN>
inline int tx_input_clone_alloc(const TX_INPUT_IN& tx_input_in, struct wally_tx_input** input) {
int ret = ::wally_tx_input_clone_alloc(detail::get_p(tx_input_in), input);
return detail::check_ret(__FUNCTION__, ret);
}

inline int tx_input_free(struct wally_tx_input* input) {
int ret = ::wally_tx_input_free(input);
return detail::check_ret(__FUNCTION__, ret);
Expand Down
4 changes: 2 additions & 2 deletions include/wally_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ extern "C" {

/** Library version */
#define WALLY_MAJOR_VER 1
#define WALLY_MINOR_VER 1
#define WALLY_MINOR_VER 2
#define WALLY_PATCH_VER 0
#define WALLY_BUILD_VER 0x10100
#define WALLY_BUILD_VER 0x10200

/**
* Initialize wally.
Expand Down
Loading
Loading