-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d20711
commit 9484af2
Showing
9 changed files
with
431 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
features: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
feature: | ||
- serde | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install rust stable | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: Feature ${{ matrix.feature }} | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --no-default-features --features=${{ matrix.feature }} | ||
- name: Defaults + ${{ matrix.feature }} | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --features=${{ matrix.feature }} | ||
platforms: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11.0, windows-2019 ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install macos dependencies | ||
if: startsWith(matrix.os, 'macos') | ||
run: brew install pkg-config | ||
- name: Install rust stable | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: Build with no features | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --no-default-features | ||
- name: Build with defaults | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --all-features | ||
toolchains: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: [ nightly, beta, stable, 1.41.1 ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install rust ${{ matrix.toolchain }} | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
override: true | ||
- name: All features | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --workspace --all-targets --all-features | ||
dependency: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install latest stable | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: Create dependency | ||
run: | | ||
cargo new dep_test | ||
cp contrib/depCargo.toml dep_test/Cargo.toml | ||
cd dep_test | ||
- name: Build dependency | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --verbose | ||
- name: Clean up | ||
run: | | ||
cd .. | ||
rm -rf dep_test | ||
android: | ||
runs-on: ubuntu-latest | ||
env: | ||
NDK_VERSION: 20.1.5948944 | ||
ANDROID_CLI_ZIP: commandlinetools-linux-6858069_latest.zip | ||
ANDROID_CLI_SHA256: 87f6dcf41d4e642e37ba03cb2e387a542aa0bd73cb689a9e7152aad40a6e7a08 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: set environment variables | ||
run: | | ||
ANDROID_SDK_ROOT="$GITHUB_WORKSPACE/sdk" | ||
NDK_HOME="$ANDROID_SDK_ROOT/ndk/$NDK_VERSION" | ||
echo "ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" >> $GITHUB_ENV | ||
echo "NDK_HOME=$NDK_HOME" >> $GITHUB_ENV | ||
echo "PATH=$PATH:$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_ENV | ||
- name: Install NDK | ||
run: | | ||
wget -nv https://dl.google.com/android/repository/$ANDROID_CLI_ZIP | ||
echo "$ANDROID_CLI_SHA256 $ANDROID_CLI_ZIP" > SHA256SUMS | ||
sha256sum -c SHA256SUMS | ||
unzip $ANDROID_CLI_ZIP | ||
mkdir -p $ANDROID_SDK_ROOT/cmdline-tools && mv cmdline-tools $ANDROID_SDK_ROOT/cmdline-tools/3.0 | ||
yes 2>/dev/null | $ANDROID_SDK_ROOT/cmdline-tools/3.0/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT \ | ||
"build-tools;29.0.3" "platforms;android-29" "ndk;$NDK_VERSION" |grep -v '\[='; true | ||
- name: Add rust targets | ||
run: | | ||
rustup target add aarch64-linux-android x86_64-linux-android armv7-linux-androideabi i686-linux-android | ||
- name: Build for aarch64-linux-android | ||
run: | | ||
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang" | ||
export CC="aarch64-linux-android21-clang" | ||
export CFLAGS="--sysroot=$NDK_HOME/sysroot -I$NDK_HOME/sysroot/usr/include -I$NDK_HOME/sysroot/usr/include/aarch64-linux-android" | ||
export CXX="aarch64-linux-android21-clang++" | ||
export CXXFLAGS="$CFLAGS -nostdlib++ -I$NDK_HOME/sources/cxx-stl/llvm-libc++/include" | ||
export LDFLAGS="--sysroot=$NDK_HOME/platforms/android-21/arch-arm64" | ||
cargo check --all-features --target=aarch64-linux-android | ||
- name: Build for x86_64-linux-android | ||
run: | | ||
export CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER="$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android26-clang" | ||
export CC="x86_64-linux-android21-clang" | ||
export CFLAGS="--sysroot=$NDK_HOME/sysroot -I$NDK_HOME/sysroot/usr/include -I$NDK_HOME/sysroot/usr/include/x86_64-linux-android" | ||
export CXX="x86_64-linux-android21-clang++" | ||
export CXXFLAGS="$CFLAGS -nostdlib++ -I$NDK_HOME/sources/cxx-stl/llvm-libc++/include" | ||
export LDFLAGS="--sysroot=$NDK_HOME/platforms/android-21/arch-x86_64" | ||
cargo check --all-features --target=x86_64-linux-android | ||
- name: Build for armv7-linux-androideabi | ||
run: | | ||
export CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER="$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi26-clang" | ||
export CC="armv7a-linux-androideabi21-clang" | ||
export CFLAGS="--sysroot=$NDK_HOME/sysroot -I$NDK_HOME/sysroot/usr/include -I$NDK_HOME/sysroot/usr/include/arm-linux-androideabi" | ||
export CXX="armv7a-linux-androideabi21-clang++" | ||
export CXXFLAGS="$CFLAGS -nostdlib++ -I$NDK_HOME/sources/cxx-stl/llvm-libc++/include" | ||
export LDFLAGS="--sysroot=$NDK_HOME/platforms/android-21/arch-arm -L$NDK_HOME/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a" | ||
cargo check --all-features --target=armv7-linux-androideabi | ||
- name: Build for i686-linux-android | ||
run: | | ||
export CARGO_TARGET_I686_LINUX_ANDROID_LINKER="$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android26-clang" | ||
export CC="i686-linux-android21-clang" | ||
export CFLAGS="--sysroot=$NDK_HOME/sysroot -I$NDK_HOME/sysroot/usr/include -I$NDK_HOME/sysroot/usr/include/i686-linux-android" | ||
export CXX="i686-linux-android21-clang++" | ||
export CXXFLAGS="$CFLAGS -nostdlib++ -I$NDK_HOME/sources/cxx-stl/llvm-libc++/include" | ||
export LDFLAGS="--sysroot=$NDK_HOME/platforms/android-21/arch-x86" | ||
cargo check --all-features --target=i686-linux-android | ||
ios: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: Dependencies and targets | ||
run: | | ||
rustup target add aarch64-apple-ios x86_64-apple-ios | ||
cargo install cargo-lipo | ||
- name: build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: lipo | ||
args: --all-features --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Codecov | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
codecov: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install latest nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
- name: Build & test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --workspace --all-features --no-fail-fast | ||
env: | ||
CARGO_INCREMENTAL: '0' | ||
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off' | ||
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off' | ||
- id: coverage | ||
name: Generate coverage | ||
uses: actions-rs/[email protected] | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ${{ steps.coverage.outputs.report }} | ||
directory: ./coverage/reports/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Lints | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
fmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install latest nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
components: rustfmt | ||
- uses: actions-rs/cargo@v1 | ||
name: Lints | ||
with: | ||
command: fmt | ||
args: --all -- --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Pre-publishing check | ||
|
||
on: | ||
pull_request: | ||
branches: [ master ] | ||
tags: | ||
- 'pre-publish' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install rust stable | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: publish | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: publish | ||
args: --dry-run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Publication | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
publication: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: cargo login ${{ secrets.CRATES_IO_TOKEN }} | ||
- run: cd derive && cargo publish --all-features; sleep 30 | ||
- run: cargo publish --all-features; sleep 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
testing: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install latest stable | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: Build & test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --workspace --all-features --no-fail-fast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,27 @@ | ||
# Descriptor wallet library | ||
|
||
Library for building descriptor-based bitcoin wallets | ||
![Build](https://github.com/LNP-BP/descriptor-wallet/workflows/Build/badge.svg) | ||
![Tests](https://github.com/LNP-BP/descriptor-wallet/workflows/Tests/badge.svg) | ||
![Lints](https://github.com/LNP-BP/descriptor-wallet/workflows/Lints/badge.svg) | ||
[![codecov](https://codecov.io/gh/LNP-BP/descriptor-wallet/branch/master/graph/badge.svg)](https://codecov.io/gh/LNP-BP/descriptor-wallet) | ||
|
||
[![crates.io](https://meritbadge.herokuapp.com/descriptor-wallet)](https://crates.io/crates/descriptor-wallet) | ||
[![Docs](https://docs.rs/descriptor-wallet/badge.svg)](https://docs.rs/descriptor-wallet) | ||
[![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/) | ||
[![MIT licensed](https://img.shields.io/github/license/LNP-BP/descriptor-wallet)](./LICENSE) | ||
|
||
Library for building descriptor-based bitcoin wallets. Previously was a part of | ||
[LNP/BP Core Library](https://github.com/LNP-BP/rust-lnpbp). | ||
|
||
Components: | ||
- More efficient manipulations with BIP-32 derivation paths | ||
- Universal miniscript/classical bitcoin descriptors | ||
- Script templates allowing embedding extended pubkeys into bitcoin script | ||
assembly | ||
- Lexicographic ordering of transaction & PSBT inputs & oututs | ||
- Script type system | ||
- Helper types for working with hash-lock contracts | ||
- PSBT utility functions (retrieving previous output, computing fee) | ||
|
||
Includes separate crate for SLIP-132 functionality in [`/slip132`](./slip132) | ||
subdirectory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This is an add-on that must be added to any dependency using this library | ||
|
||
derive-wallet = { path = "..", features = ["serde"] } | ||
slip132 = { path = "../slip132" } | ||
|
||
[workspace] |
Oops, something went wrong.