Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into descriptor-example
Browse files Browse the repository at this point in the history
  • Loading branch information
futurechimp committed Oct 10, 2024
2 parents 1f68cb6 + ec7342d commit 2209462
Show file tree
Hide file tree
Showing 88 changed files with 3,036 additions and 2,638 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,6 @@ jobs:
uses: Swatinem/[email protected]
- name: Install grcov
run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi
# TODO: re-enable the hwi tests
- 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
run: cargo test --all-features
- name: Make coverage directory
Expand All @@ -51,7 +40,7 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage-report.html
56 changes: 34 additions & 22 deletions .github/workflows/cont_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ on: [push, pull_request]
name: CI

jobs:
prepare:
runs-on: ubuntu-latest
outputs:
rust_version: ${{ steps.read_toolchain.outputs.rust_version }}
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Read rust version"
id: read_toolchain
run: echo "rust_version=$(cat rust-version)" >> $GITHUB_OUTPUT

build-test:
name: Build and test
Expand All @@ -14,17 +24,17 @@ jobs:
clippy: true
- version: 1.63.0 # MSRV
features:
- --no-default-features
- --no-default-features --features miniscript/no-std
- --all-features
steps:
- name: checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust.version }}
override: true
profile: minimal
toolchain: ${{ matrix.rust.version }}
override: true
profile: minimal
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Pin dependencies for MSRV
Expand All @@ -37,10 +47,11 @@ jobs:
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"
- name: Build
run: cargo build ${{ matrix.features }}
run: cargo build --workspace --exclude 'example_*' ${{ matrix.features }}
- name: Test
run: cargo test ${{ matrix.features }}
run: cargo test --workspace --exclude 'example_*' ${{ matrix.features }}

check-no-std:
name: Check no_std
Expand Down Expand Up @@ -86,10 +97,10 @@ jobs:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
target: "wasm32-unknown-unknown"
toolchain: stable
override: true
profile: minimal
target: "wasm32-unknown-unknown"
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Check bdk wallet
Expand All @@ -108,22 +119,23 @@ jobs:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: rustfmt
toolchain: stable
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
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.78.0
components: clippy
override: true
toolchain: ${{ needs.prepare.outputs.rust_version }}
components: clippy
override: true
- name: Rust Cache
uses: Swatinem/[email protected]
- uses: actions-rs/clippy-check@v1
Expand All @@ -132,7 +144,7 @@ jobs:
args: --all-features --all-targets -- -D warnings

build-examples:
name: Build Examples
name: Build & Test Examples
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -141,10 +153,10 @@ jobs:
- example_bitcoind_rpc_polling
- example_electrum
- example_esplora
- wallet_electrum
- wallet_esplora_async
- wallet_esplora_blocking
- wallet_rpc
- example_wallet_electrum
- example_wallet_esplora_async
- example_wallet_esplora_blocking
- example_wallet_rpc
steps:
- name: checkout
uses: actions/checkout@v2
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/cron-update-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Update rust version
on:
schedule:
- cron: "0 0 15 * *" # At 00:00 on day-of-month 15.
workflow_dispatch: # allows manual triggering
jobs:
format:
name: Update rustc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Update rust-version to use latest stable
run: |
set -x
# Extract the version from whatever version of the compiler dtolnay/rust-toolchain gives us.
RUST_VERSION=$(rustc --verbose --version | sed -ne 's/^release: //p')
# Update the version in the reference file.
echo "${RUST_VERSION}" > rust-version
echo "rust_version=${RUST_VERSION}" >> $GITHUB_ENV
# In case of no new version don't make an empty PR.
if ! git diff --exit-code > /dev/null; then
echo "Updated rustc. Opening PR."
echo "changes_made=true" >> $GITHUB_ENV
else
echo "Attempted to update rustc but the latest stable date did not change. Not opening any PR."
echo "changes_made=false" >> $GITHUB_ENV
fi
- name: Create Pull Request
if: env.changes_made == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.generate-token.outputs.token }}
author: Github Action <[email protected]>
committer: Github Action <[email protected]>
branch: create-pull-request/update-rust-version
title: |
ci: automated update to rustc ${{ env.rust_version }}
commit-message: |
ci: automated update to rustc ${{ env.rust_version }}
body: |
Automated update to Github CI workflow `cont_integration.yml` by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
4 changes: 2 additions & 2 deletions .github/workflows/nightly_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
env:
RUSTDOCFLAGS: '--cfg docsrs -Dwarnings'
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: built-docs
path: ./target/doc/*
Expand All @@ -44,7 +44,7 @@ jobs:
- name: Remove old latest
run: rm -rf ./docs/.vuepress/public/docs-rs/bdk/nightly/latest
- name: Download built docs
uses: actions/download-artifact@v1
uses: actions/download-artifact@v4
with:
name: built-docs
path: ./docs/.vuepress/public/docs-rs/bdk/nightly/latest
Expand Down
11 changes: 9 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ Every new feature should be covered by functional tests where possible.
When refactoring, structure your PR to make it easy to review and don't
hesitate to split it into multiple small, focused PRs.

The Minimal Supported Rust Version is **1.57.0** (enforced by our CI).
The Minimum Supported Rust Version is **1.63.0** (enforced by our CI).

Commits should cover both the issue fixed and the solution's rationale.
These [guidelines](https://chris.beams.io/posts/git-commit/) should be kept in mind. Commit messages should follow the ["Conventional Commits 1.0.0"](https://www.conventionalcommits.org/en/v1.0.0/) to make commit histories easier to read by humans and automated tools.
These [guidelines](https://chris.beams.io/posts/git-commit/) should be kept in mind. Commit messages follow the ["Conventional Commits 1.0.0"](https://www.conventionalcommits.org/en/v1.0.0/) to make commit histories easier to read by humans and automated tools. All commits must be [GPG signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits).

To facilitate communication with other contributors, the project is making use
of GitHub's "assignee" field. First check that no one is assigned and then
Expand Down Expand Up @@ -81,12 +81,19 @@ well as test out the patch set and opine on the technical merits of the patch.
PR should be reviewed first on the conceptual level before focusing on code
style or grammar fixes.

To merge a PR we require all CI tests to pass, the PR has at least one approving review by a maintainer with write access, and reasonable criticisms have been addressed.

Coding Conventions
------------------

This codebase uses spaces, not tabs.
Use `cargo fmt` with the default settings to format code before committing.
This is also enforced by the CI.
All public items must be documented. We adhere to the [Rust API Guidelines](https://rust-lang.github.io/api-guidelines/about.html) with respect to documentation.

The library is written using safe rust. Special consideration must be given to code which proposes an exception to the rule.

All new features require testing. Tests should be unique and self-describing. If a test is in development or is broken or no longer useful, then a reason should be given for adding the `#[ignore]` attribute.

Security
--------
Expand Down
14 changes: 9 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@ resolver = "2"
members = [
"crates/wallet",
"crates/chain",
"crates/core",
"crates/file_store",
"crates/electrum",
"crates/esplora",
"crates/bitcoind_rpc",
"crates/hwi",
"crates/testenv",
"example-crates/example_cli",
"example-crates/example_electrum",
"example-crates/example_esplora",
"example-crates/example_bitcoind_rpc_polling",
"example-crates/wallet_electrum",
"example-crates/wallet_esplora_blocking",
"example-crates/wallet_esplora_async",
"example-crates/wallet_rpc",
"example-crates/example_wallet_electrum",
"example-crates/example_wallet_esplora_blocking",
"example-crates/example_wallet_esplora_async",
"example-crates/example_wallet_rpc",
]

[workspace.package]
authors = ["Bitcoin Dev Kit Developers"]

[workspace.lints.clippy]
print_stdout = "deny"
print_stderr = "deny"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ 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"
```

## License
Expand Down
9 changes: 0 additions & 9 deletions ci/Dockerfile.ledger

This file was deleted.

30 changes: 0 additions & 30 deletions ci/automation.json

This file was deleted.

2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv="1.63.0"
msrv="1.63.0"
12 changes: 8 additions & 4 deletions crates/bitcoind_rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bdk_bitcoind_rpc"
version = "0.13.0"
version = "0.16.0"
edition = "2021"
rust-version = "1.63"
homepage = "https://bitcoindevkit.org"
Expand All @@ -12,15 +12,19 @@ readme = "README.md"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lints]
workspace = true

[dependencies]
bitcoin = { version = "0.32.0", default-features = false }
bitcoincore-rpc = { version = "0.19.0" }
bdk_chain = { path = "../chain", version = "0.17", default-features = false }
bdk_core = { path = "../core", version = "0.3.0", default-features = false }

[dev-dependencies]
bdk_testenv = { path = "../testenv", default-features = false }
bdk_chain = { path = "../chain" }

[features]
default = ["std"]
std = ["bitcoin/std", "bdk_chain/std"]
serde = ["bitcoin/serde", "bdk_chain/serde"]
std = ["bitcoin/std", "bdk_core/std"]
serde = ["bitcoin/serde", "bdk_core/serde"]
2 changes: 1 addition & 1 deletion crates/bitcoind_rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! mempool.
#![warn(missing_docs)]

use bdk_chain::{local_chain::CheckPoint, BlockId};
use bdk_core::{BlockId, CheckPoint};
use bitcoin::{block::Header, Block, BlockHash, Transaction};
pub use bitcoincore_rpc;
use bitcoincore_rpc::bitcoincore_rpc_json;
Expand Down
Loading

0 comments on commit 2209462

Please sign in to comment.