Skip to content
Closed
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
5 changes: 1 addition & 4 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ jobs:
- name: Install lcov tools
run: sudo apt-get install lcov -y
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
profile: minimal
components: llvm-tools-preview
- name: Rust Cache
uses: Swatinem/[email protected]
Expand Down
136 changes: 86 additions & 50 deletions .github/workflows/cont_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,102 @@ jobs:
- name: "Read rust version"
id: read_toolchain
run: echo "rust_version=$(cat rust-version)" >> $GITHUB_OUTPUT
build-test:

build-check:
needs: prepare
name: Build and test
name: Check
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- version: ${{ needs.prepare.outputs.rust_version }}
clippy: true
- version: 1.63.0 # MSRV
- version: 1.63.0 # Overall MSRV
- version: 1.75.0 # Specific MSRV for `bdk_electrum`
features:
- --no-default-features --features miniscript/no-std
- --all-features
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust.version }}
override: true
profile: minimal
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Pin dependencies for 1.75
if: matrix.rust.version == '1.75.0'
run: |
cargo update -p home --precise "0.5.9"
- name: Pin dependencies for MSRV
if: matrix.rust.version == '1.63.0'
run: ./ci/pin-msrv.sh
- name: Build + Check
run: |
cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5"
cargo update -p time --precise "0.3.20"
cargo update -p home --precise "0.5.5"
cargo update -p proptest --precise "1.2.0"
cargo update -p url --precise "2.5.0"
cargo update -p cc --precise "1.0.105"
cargo update -p tokio --precise "1.38.1"
cargo update -p tokio-util --precise "0.7.11"
cargo update -p indexmap --precise "2.5.0"
cargo update -p security-framework-sys --precise "2.11.1"
cargo update -p csv --precise "1.3.0"
cargo update -p unicode-width --precise "0.1.13"
cargo update -p [email protected] --precise "0.23.19"
- name: Build
run: cargo build --workspace --exclude 'example_*' ${{ matrix.features }}
- name: Test
run: cargo test --workspace --exclude 'example_*' ${{ matrix.features }}
if [ "${{matrix.rust.version}}" = '1.63.0' ]; then
cargo build --workspace --exclude 'example_*' --exclude 'bdk_electrum' ${{ matrix.features }}
cargo check --workspace --exclude 'example_*' --exclude 'bdk_electrum' ${{ matrix.features }}
else
cargo build --workspace --exclude 'example_*' ${{ matrix.features }}
cargo check --workspace --exclude 'example_*' ${{ matrix.features }}
fi

test-bdk:
needs: prepare
name: Test Bdk
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- version: ${{ needs.prepare.outputs.rust_version }}
- version: 1.63.0 # MSRV
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust.version }}
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Pin dependencies for MSRV
if: matrix.rust.version == '1.63.0'
run: ./ci/pin-msrv.sh
- name: Test library
run: |
cargo test -p bdk_core --all-features
cargo test -p bdk_chain --all-features
cargo test -p bdk_bitcoind_rpc --all-features -- --test-threads=2
cargo test -p bdk_esplora --all-features -- --test-threads=2
cargo test -p bdk_file_store --all-features
cargo test -p bdk_testenv --all-features -- --test-threads=2
cargo test -p bdk_wallet --all-features

test-electrum:
needs: prepare
name: Test Electrum
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- version: ${{ needs.prepare.outputs.rust_version }}
- version: 1.75.0 # MSRV
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust.version }}
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Pin dependencies for MSRV
if: matrix.rust.version == '1.75.0'
run: |
cargo update -p home --precise "0.5.9"
- name: Test electrum
run: cargo test -p bdk_electrum --all-features -- --test-threads=2

check-no-std:
needs: prepare
name: Check no_std
Expand All @@ -68,12 +118,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ needs.prepare.outputs.rust_version }}
override: true
profile: minimal
# target: "thumbv6m-none-eabi"
# targets: "thumbv6m-none-eabi"
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Check bdk_chain
Expand All @@ -87,7 +135,7 @@ jobs:
- name: Check esplora
working-directory: ./crates/esplora
# TODO "--target thumbv6m-none-eabi" should work but currently does not
run: cargo check --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
run: cargo check --no-default-features --features miniscript/no-std

check-wasm:
needs: prepare
Expand All @@ -104,20 +152,18 @@ jobs:
- run: sudo apt-get update || exit 1
- run: sudo apt-get install -y libclang-common-10-dev clang-10 libc6-dev-i386 || exit 1
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ needs.prepare.outputs.rust_version }}
override: true
profile: minimal
target: "wasm32-unknown-unknown"
targets: "wasm32-unknown-unknown"
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Check bdk wallet
working-directory: ./crates/wallet
run: cargo check --target wasm32-unknown-unknown --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
- name: Check esplora
working-directory: ./crates/esplora
run: cargo check --target wasm32-unknown-unknown --no-default-features --features miniscript/no-std,bdk_chain/hashbrown,async
run: cargo check --target wasm32-unknown-unknown --no-default-features --features async,miniscript/no-std

fmt:
needs: prepare
Expand All @@ -127,34 +173,26 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ needs.prepare.outputs.rust_version }}
override: true
profile: minimal
components: rustfmt
- name: Check fmt
run: cargo fmt --all -- --config format_code_in_doc_comments=true --check

clippy_check:
needs: prepare
runs-on: ubuntu-latest
permissions:
checks: write
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ needs.prepare.outputs.rust_version }}
components: clippy
override: true
- name: Rust Cache
uses: Swatinem/[email protected]
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Clippy Results
args: --all-features --all-targets -- -D warnings
- name: Clippy
run: cargo clippy --all-targets --all-features -- -Dwarnings

build-examples:
needs: prepare
Expand All @@ -175,11 +213,9 @@ jobs:
- name: checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ needs.prepare.outputs.rust_version }}
override: true
profile: minimal
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Build
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ Fully working examples of how to use these components are in `/example-crates`:
[`bdk_chain`]: https://docs.rs/bdk-chain/

## Minimum Supported Rust Version (MSRV)
This library should compile with any combination of features with Rust 1.63.0.
The BDK library maintains a MSRV of 1.63.0. This includes the following crates

- `bdk_core`
- `bdk_chain`
- `bdk_bitcoind_rpc`.
- `bdk_esplora`.
- `bdk_wallet`.

The MSRV of `bdk_electrum` is 1.75.0

To build with the MSRV you will need to pin dependencies as follows:

Expand All @@ -80,7 +88,6 @@ cargo update -p indexmap --precise "2.5.0"
cargo update -p security-framework-sys --precise "2.11.1"
cargo update -p csv --precise "1.3.0"
cargo update -p unicode-width --precise "0.1.13"
cargo update -p [email protected] --precise "0.23.19"
```

## License
Expand Down
24 changes: 24 additions & 0 deletions ci/pin-msrv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

set -x
set -euo pipefail

# Pin dependencies for MSRV

# To pin deps, switch toolchain to MSRV and execute the below updates

# cargo clean
# rustup default 1.63.0

cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5"
cargo update -p time --precise "0.3.20"
cargo update -p home --precise "0.5.5"
cargo update -p proptest --precise "1.2.0"
cargo update -p url --precise "2.5.0"
cargo update -p cc --precise "1.0.105"
cargo update -p tokio --precise "1.38.1"
cargo update -p tokio-util --precise "0.7.11"
cargo update -p indexmap --precise "2.5.0"
cargo update -p security-framework-sys --precise "2.11.1"
cargo update -p csv --precise "1.3.0"
cargo update -p unicode-width --precise "0.1.13"
8 changes: 8 additions & 0 deletions crates/electrum/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@
BDK Electrum extends [`electrum-client`] to update [`bdk_chain`] structures
from an Electrum server.

## Minimum Supported Rust Version (MSRV)
This crate has a MSRV of 1.75.0.

To build with MSRV you will need to pin dependencies as follows:
```shell
cargo update -p home --precise "0.5.9"
```

[`electrum-client`]: https://docs.rs/electrum-client/
[`bdk_chain`]: https://docs.rs/bdk-chain/
6 changes: 3 additions & 3 deletions crates/esplora/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ workspace = true

[dependencies]
bdk_core = { path = "../core", version = "0.4.1", default-features = false }
esplora-client = { version = "0.11.0", default-features = false }
esplora-client = { version = "0.11.0", default-features = false }
async-trait = { version = "0.1.66", optional = true }
futures = { version = "0.3.26", optional = true }
miniscript = { version = "12.0.0", optional = true, default-features = false }

[dev-dependencies]
esplora-client = { version = "0.11.0" }
esplora-client = { version = "0.11.0" }
bdk_chain = { path = "../chain" }
bdk_testenv = { path = "../testenv" }
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros"] }

[features]
default = ["std", "async-https", "blocking-https"]
std = ["bdk_chain/std", "miniscript?/std"]
std = ["miniscript?/std"]
tokio = ["esplora-client/tokio"]
async = ["async-trait", "futures", "esplora-client/async"]
async-https = ["async", "esplora-client/async-https"]
Expand Down