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

bdk v1.0.0-alpha.0 #793

Merged
merged 56 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
544c397
Modified build, clippy and test steps
evanlinjin Nov 4, 2022
aab2b12
bdk_core integration initial commit 🔥
LLFourn Nov 3, 2022
a40da9b
Make bdk no_std
LLFourn Jan 10, 2023
57538e5
Move tests to /tests
LLFourn Feb 14, 2023
5985706
Add wallet persistence
LLFourn Feb 15, 2023
b310a7a
Add Wallet::cancel_tx
LLFourn Feb 15, 2023
3baf972
Use bdk_chain Balance
LLFourn Feb 15, 2023
e1eb025
Make doctests work
LLFourn Feb 21, 2023
fdfc9b9
Delete unused things
LLFourn Feb 21, 2023
8a6de3a
Convert to workspace
LLFourn Feb 21, 2023
22bec6d
Delete unused errors
LLFourn Feb 21, 2023
b60820a
Remove authors.workspace because older cargo don't like
LLFourn Feb 21, 2023
6d05598
Remove test-readme-examples
LLFourn Feb 21, 2023
20e45b7
Add back test-hardware-signer feature
LLFourn Feb 21, 2023
9edbdf5
[ci] Fix feature flags
LLFourn Feb 21, 2023
94a084a
Fix doc links
LLFourn Feb 21, 2023
1c970a9
Fix code coverage CI
danielabrozzoni Feb 22, 2023
f2188f9
Make lib.rs's docs be the README.md
LLFourn Mar 1, 2023
37dfa77
Move bdk_chain into the bdk repo :tada:
danielabrozzoni Mar 1, 2023
03deafb
Move bdk_file_store into the bdk repo :tada:
danielabrozzoni Mar 1, 2023
949608a
Move bdk_electrum into the bdk repo :tada:
danielabrozzoni Mar 1, 2023
c069b0f
Move everything else over 🎉
LLFourn Mar 2, 2023
2e82cd8
Use tempfile for file_store tests
LLFourn Mar 2, 2023
b555976
Rename the stub wallet examples
LLFourn Mar 2, 2023
303a170
Rust fmt
danielabrozzoni Mar 2, 2023
3f5a78a
Disable test-hardware-signer
danielabrozzoni Mar 2, 2023
1805bd3
Fix clippy
danielabrozzoni Mar 2, 2023
c61b360
Fix cargo clippy warnings
danielabrozzoni Mar 2, 2023
8c9bceb
Fix the "repository" field in Cargo.toml
danielabrozzoni Mar 2, 2023
5acee82
Update rust stable in CI (1.67.0)
danielabrozzoni Mar 2, 2023
5708bf0
Fix docs
danielabrozzoni Mar 2, 2023
96d932c
Add clippy.toml
danielabrozzoni Mar 2, 2023
3a5d727
Update workspace dependencies to be relative paths
notmandatory Mar 3, 2023
38ef170
Make bdk and bdk_chain work under 1.57.0
notmandatory Mar 3, 2023
a38f633
Make bdk_file_store use bincode v1
LLFourn Mar 3, 2023
0ba41c5
Make bdk_esplora wasm compatible again
danielabrozzoni Mar 3, 2023
dfcbafd
Use action-rs/toolchain in CI
danielabrozzoni Mar 3, 2023
0c7a0ab
Disable code coverage
danielabrozzoni Mar 3, 2023
d267517
NewError implements StdError (fix typo)
danielabrozzoni Mar 3, 2023
b082932
Add the wallet_esplora example
danielabrozzoni Mar 3, 2023
b3836cb
Use hardcoded send amount for `wallet_esplora` example
evanlinjin Mar 6, 2023
69cf6d7
Use os-specific temp dir for `wallet_esplora` example
evanlinjin Mar 6, 2023
de9457f
Changed `inflate_update` logic to not depend on `Cow`
evanlinjin Mar 7, 2023
0505cd7
Remove transaction-based type parameters and traits
evanlinjin Mar 7, 2023
eddd748
Add `wallet_electrum` example
evanlinjin Mar 7, 2023
9d26121
Improve stdout output for wallet esplora/electrum examples
evanlinjin Mar 8, 2023
47faa88
Fix cargo clippy
danielabrozzoni Mar 8, 2023
0aaf420
examples: exit if balance < SEND_AMOUNT
danielabrozzoni Mar 8, 2023
ab9242d
Replace current caching solution with Rust Cache
vladimirfomene Mar 8, 2023
26ab2e2
Implement EsploraExt for Async client
vladimirfomene Mar 7, 2023
def0c9e
Add `wallet_esplora_async` example and various fixes
evanlinjin Mar 8, 2023
ae9b19d
`bdk` README improvements
evanlinjin Mar 9, 2023
5dd4ce7
More documentation improvements
evanlinjin Mar 10, 2023
2fcf9c4
Make async esplora futures Send
LLFourn Mar 10, 2023
352f95f
[ci] misc fixes
danielabrozzoni Mar 10, 2023
bc3e05c
Doc fixes
danielabrozzoni Mar 13, 2023
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
53 changes: 23 additions & 30 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,37 @@ jobs:
uses: actions/checkout@v2
- name: Install lcov tools
run: sudo apt-get install lcov -y
- name: Install rustup
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: Set default toolchain
run: rustup default nightly
- name: Set profile
run: rustup set profile minimal
- name: Add llvm tools
run: rustup component add llvm-tools-preview
- name: Update toolchain
run: rustup update
- name: Cache cargo
uses: actions/cache@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
toolchain: "1.65.0"
override: true
profile: minimal
components: llvm-tools-preview
- name: Rust Cache
uses: Swatinem/rust-cache@v2.2.1
- name: Install grcov
run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi
- name: Build simulator image
run: docker build -t hwi/ledger_emulator ./ci -f ci/Dockerfile.ledger
- name: Run simulator image
run: docker run --name simulator --network=host hwi/ledger_emulator &
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install python dependencies
run: pip install hwi==2.1.1 protobuf==3.20.1
- name: Test
# WARNING: this is not testing the following features: test-esplora, test-hardware-signer, async-interface
# This is because some of our features are mutually exclusive, and generating various reports and
# merging them doesn't seem to be working very well.
# For more info, see:
# - https://github.com/bitcoindevkit/bdk/issues/696
# - https://github.com/bitcoindevkit/bdk/pull/748#issuecomment-1242721040
run: cargo test --features all-keys,compact_filters,compiler,key-value-db,sqlite,sqlite-bundled,test-electrum,test-rpc,verify
run: cargo test --all-features
danielabrozzoni marked this conversation as resolved.
Show resolved Hide resolved
- name: Run grcov
run: mkdir coverage; grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' -o ./coverage/lcov.info
- name: Generate HTML coverage report
run: genhtml -o coverage-report.html ./coverage/lcov.info

- name: Coveralls upload
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# - name: Coveralls upload
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
Expand Down
206 changes: 50 additions & 156 deletions .github/workflows/cont_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,118 +10,27 @@ jobs:
strategy:
matrix:
rust:
- version: 1.65.0 # STABLE
- version: stable
clippy: true
- version: 1.57.0 # MSRV
features:
- default
- minimal
- all-keys
- minimal,use-esplora-blocking
- key-value-db
- electrum
- compact_filters
- use-esplora-blocking,key-value-db,electrum
- compiler
- rpc
- verify
- async-interface
- use-esplora-async
- sqlite
- sqlite-bundled
- --no-default-features
- --all-features
steps:
- name: checkout
uses: actions/checkout@v2
- name: Generate cache key
run: echo "${{ matrix.rust.version }} ${{ matrix.features }}" | tee .cache_key
- name: cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Set default toolchain
run: rustup default ${{ matrix.rust.version }}
- name: Set profile
run: rustup set profile minimal
- name: Add clippy
if: ${{ matrix.rust.clippy }}
run: rustup component add clippy
- name: Update toolchain
run: rustup update
- name: Build
run: cargo build --features ${{ matrix.features }} --no-default-features
- name: Clippy
if: ${{ matrix.rust.clippy }}
run: cargo clippy --all-targets --features ${{ matrix.features }} --no-default-features -- -D warnings
- name: Test
run: cargo test --features ${{ matrix.features }} --no-default-features

test-readme-examples:
name: Test README.md examples
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-test-md-docs-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Set default toolchain
run: rustup default nightly
- name: Set profile
run: rustup set profile minimal
- name: Update toolchain
run: rustup update
- name: Test
run: cargo test --features test-md-docs --no-default-features -- doctest::ReadmeDoctests
Comment on lines -62 to -83
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we're still going to have some examples in the README, so we shouldn't remove the checks from the CI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to change how this is done actually. I was just gonna include the README as a doc in the lib.rs using: https://doc.rust-lang.org/rustdoc/write-documentation/the-doc-attribute.html


test-blockchains:
name: Blockchain ${{ matrix.blockchain.features }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
blockchain:
- name: electrum
testprefix: blockchain::electrum::test
features: test-electrum,verify
- name: rpc
testprefix: blockchain::rpc::test
features: test-rpc
- name: rpc-legacy
testprefix: blockchain::rpc::test
features: test-rpc-legacy
- name: esplora
testprefix: esplora
features: test-esplora,use-esplora-async,verify
- name: esplora
testprefix: esplora
features: test-esplora,use-esplora-blocking,verify
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Setup rust toolchain
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
toolchain: ${{ matrix.rust.version }}
override: true
profile: minimal
- name: Rust Cache
uses: Swatinem/rust-cache@v2.2.1
- name: Build
run: cargo build ${{ matrix.features }}
- name: Test
run: cargo test --no-default-features --features ${{ matrix.blockchain.features }} ${{ matrix.blockchain.testprefix }}::bdk_blockchain_tests
run: cargo test ${{ matrix.features }}

check-wasm:
name: Check WASM
Expand All @@ -132,72 +41,57 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
# Install a recent version of clang that supports wasm32
- run: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
- run: sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main" || exit 1
- 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: Set default toolchain
run: rustup default 1.65.0 # STABLE
- name: Set profile
run: rustup set profile minimal
- name: Add target wasm32
run: rustup target add wasm32-unknown-unknown
- name: Update toolchain
run: rustup update
- name: Check
run: cargo check --target wasm32-unknown-unknown --features async-interface,use-esplora-async,dev-getrandom-wasm --no-default-features
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
target: "wasm32-unknown-unknown"
- name: Rust Cache
uses: Swatinem/rust-cache@v2.2.1
- name: Check bdk
working-directory: ./crates/bdk
run: cargo check --target wasm32-unknown-unknown --features dev-getrandom-wasm
- name: Check esplora
working-directory: ./crates/esplora
run: cargo check --target wasm32-unknown-unknown --features async --no-default-features

fmt:
name: Rust fmt
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set default toolchain
run: rustup default nightly
- name: Set profile
run: rustup set profile minimal
- name: Add rustfmt
run: rustup component add rustfmt
- name: Update toolchain
run: rustup update
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: rustfmt
- name: Check fmt
run: cargo fmt --all -- --config format_code_in_doc_comments=true --check

test_hardware_wallet:
runs-on: ubuntu-20.04
strategy:
matrix:
rust:
- version: 1.65.0 # STABLE
- version: 1.57.0 # MSRV
clippy_check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build simulator image
run: docker build -t hwi/ledger_emulator ./ci -f ci/Dockerfile.ledger
- name: Run simulator image
run: docker run --name simulator --network=host hwi/ledger_emulator &
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install python dependencies
run: pip install hwi==2.1.1 protobuf==3.20.1
- name: Set default toolchain
run: rustup default ${{ matrix.rust.version }}
- name: Set profile
run: rustup set profile minimal
- name: Update toolchain
run: rustup update
- name: Test
run: cargo test --features test-hardware-signer
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
# we pin clippy instead of using "stable" so that our CI doesn't break
# at each new cargo release
toolchain: "1.67.0"
components: clippy
override: true
- name: Rust Cache
uses: Swatinem/rust-cache@v2.2.1
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -D warnings
14 changes: 5 additions & 9 deletions .github/workflows/nightly_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,18 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: nightly-docs-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Set default toolchain
run: rustup default nightly-2022-12-14
- name: Set profile
run: rustup set profile minimal
- name: Update toolchain
run: rustup update
- name: Rust Cache
uses: Swatinem/rust-cache@v2.2.1
- name: Build docs
run: cargo rustdoc --verbose --features=compiler,electrum,esplora,use-esplora-blocking,compact_filters,rpc,key-value-db,sqlite,all-keys,verify,hardware-signer -- --cfg docsrs -Dwarnings
run: cargo doc --no-deps
env:
RUSTDOCFLAGS: '--cfg docsrs -Dwarnings'
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
Expand Down
Loading