From 5e3561654ef3155fc5668c951b733520713a4178 Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Mon, 9 Dec 2024 18:08:26 +0100 Subject: [PATCH 01/27] workflows --- .github/workflows/audit.yml | 28 ----------- .../{cont_integration.yml => ci.yml} | 47 +++++++------------ .github/workflows/code_coverage.yml | 46 ------------------ 3 files changed, 17 insertions(+), 104 deletions(-) delete mode 100644 .github/workflows/audit.yml rename .github/workflows/{cont_integration.yml => ci.yml} (58%) delete mode 100644 .github/workflows/code_coverage.yml diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml deleted file mode 100644 index 17f20ac..0000000 --- a/.github/workflows/audit.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Audit - -on: - push: - paths: - # Run if workflow changes - - ".github/workflows/audit.yml" - # Run on changed dependencies - - "**/Cargo.toml" - - "**/Cargo.lock" - # Run if the configuration file changes - - "**/audit.toml" - # Rerun periodically to pick up new advisories - schedule: - - cron: "0 0 * * *" # Nightly - # Run manually - workflow_dispatch: - -jobs: - audit: - runs-on: ubuntu-latest - permissions: - contents: read - issues: write - steps: - - uses: actions/checkout@v4 - - uses: actions-rust-lang/audit@v1 - name: Audit Rust Dependencies diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/ci.yml similarity index 58% rename from .github/workflows/cont_integration.yml rename to .github/workflows/ci.yml index 1837871..5716ff2 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/ci.yml @@ -21,40 +21,33 @@ jobs: matrix: rust: - version: stable - clippy: true - version: 1.63.0 # MSRV features: - - --no-default-features - - --all-features + - all + - debug,default + - debug,esplora + - debug,snap + - debug,bitcoind steps: - name: checkout uses: actions/checkout@v4 - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ matrix.rust.version }} - override: true - profile: minimal - name: Install wasm-pack run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -f - name: Rust Cache uses: Swatinem/rust-cache@v2.7.5 - - name: Pin dependencies for MSRV - if: matrix.rust.version == '1.63.0' - 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" - name: Build - run: wasm-pack build --features ${{ matrix.features }} + run: | + if [ "${{ matrix.features }}" = "all" ]; then + wasm-pack build --all-features + else + wasm-pack build --features ${{ matrix.features }} + fi - name: Test + if: ${{ matrix.features != 'all' }} run: wasm-pack test --chrome --firefox --safari --headless --features ${{ matrix.features }} fmt: @@ -64,11 +57,9 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: stable - override: true - profile: minimal components: rustfmt - name: Check fmt run: cargo fmt --all -- --config format_code_in_doc_comments=true --check @@ -80,15 +71,11 @@ jobs: checks: write steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ needs.prepare.outputs.rust_version }} components: clippy - override: true - name: Rust Cache uses: Swatinem/rust-cache@v2.7.5 - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - name: Clippy Results - args: --all-features --all-targets -- -D warnings + - name: Run Clippy + run: cargo clippy --all-features --all-targets -- -D warnings diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml deleted file mode 100644 index c5dbec0..0000000 --- a/.github/workflows/code_coverage.yml +++ /dev/null @@ -1,46 +0,0 @@ -on: [push, pull_request] - -name: Code Coverage - -jobs: - Codecov: - name: Code Coverage - runs-on: ubuntu-latest - env: - RUSTFLAGS: "-Cinstrument-coverage" - RUSTDOCFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "./target/coverage/%p-%m.profraw" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install lcov tools - run: sudo apt-get install lcov -y - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - profile: minimal - components: llvm-tools-preview - - name: Rust Cache - uses: Swatinem/rust-cache@v2.7.5 - - name: Install grcov - run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi - - name: Test - run: cargo test --all-features - - name: Make coverage directory - run: mkdir coverage - - name: Run grcov - run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --keep-only '**/crates/**' --ignore '**/tests/**' --ignore '**/examples/**' -o ./coverage/lcov.info - - name: Generate HTML coverage report - run: genhtml -o coverage-report.html --ignore-errors source ./coverage/lcov.info - - name: Coveralls upload - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: coverage-report - path: coverage-report.html From 026d8f242909c29ead157967a84695d66c57a02b Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Mon, 9 Dec 2024 18:14:08 +0100 Subject: [PATCH 02/27] use commits in actions and not tags --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5716ff2..adfe6f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,13 +32,13 @@ jobs: - name: checkout uses: actions/checkout@v4 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 with: toolchain: ${{ matrix.rust.version }} - name: Install wasm-pack run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -f - name: Rust Cache - uses: Swatinem/rust-cache@v2.7.5 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - name: Build run: | if [ "${{ matrix.features }}" = "all" ]; then @@ -57,7 +57,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 with: toolchain: stable components: rustfmt @@ -71,11 +71,11 @@ jobs: checks: write steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 with: toolchain: ${{ needs.prepare.outputs.rust_version }} components: clippy - name: Rust Cache - uses: Swatinem/rust-cache@v2.7.5 + uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - name: Run Clippy run: cargo clippy --all-features --all-targets -- -D warnings From 3b0e9cfda2b38921b8e10724d9f989aac144f9a6 Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Mon, 9 Dec 2024 18:17:13 +0100 Subject: [PATCH 03/27] CI only when targeting main --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index adfe6f9..3a53169 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,7 @@ -on: [push, pull_request] +on: + pull_request: + branches: + - main name: CI From 89311d0b147f8da11b78865a01e2140cfb0add85 Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Mon, 9 Dec 2024 19:16:01 +0100 Subject: [PATCH 04/27] change MSRV to 1.73 --- .github/workflows/ci.yml | 2 +- Cargo.toml | 2 +- clippy.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a53169..a6778ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: matrix: rust: - version: stable - - version: 1.63.0 # MSRV + - version: 1.73.0 # MSRV features: - all - debug,default diff --git a/Cargo.toml b/Cargo.toml index 99e2508..3bc8be6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ readme = "README.md" license = "MIT OR Apache-2.0" authors = ["Bitcoin Developers"] edition = "2021" -rust-version = "1.63" +rust-version = "1.73" [lib] crate-type = ["cdylib", "rlib"] diff --git a/clippy.toml b/clippy.toml index b3c3a24..f09ac0f 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.63.0" +msrv = "1.73.0" From 0a7795ed946a0ebde093941c2a046fdc3979d97e Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Mon, 9 Dec 2024 19:28:04 +0100 Subject: [PATCH 05/27] remove prepare and merge fmt and clippy --- .github/workflows/ci.yml | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6778ff..2223844 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,8 @@ jobs: strategy: matrix: rust: - - version: stable - - version: 1.73.0 # MSRV + - stable + - 1.73.0 # MSRV features: - all - debug,default @@ -37,7 +37,7 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 with: - toolchain: ${{ matrix.rust.version }} + toolchain: ${{ matrix.rust }} - name: Install wasm-pack run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -f - name: Rust Cache @@ -53,8 +53,8 @@ jobs: if: ${{ matrix.features != 'all' }} run: wasm-pack test --chrome --firefox --safari --headless --features ${{ matrix.features }} - fmt: - name: Rust fmt + lint: + name: Lint (fmt + clippy) runs-on: ubuntu-latest steps: - name: Checkout @@ -63,22 +63,10 @@ jobs: uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 with: toolchain: stable - 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: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 - with: - toolchain: ${{ needs.prepare.outputs.rust_version }} - components: clippy + components: rustfmt, clippy - name: Rust Cache uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - name: Check formatting + run: cargo fmt --all -- --config format_code_in_doc_comments=true --check - name: Run Clippy run: cargo clippy --all-features --all-targets -- -D warnings From b56dafcf022d30a74ae5769bdc42b50c0a39b461 Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Mon, 9 Dec 2024 19:28:37 +0100 Subject: [PATCH 06/27] remove prepare and merge fmt and clippy --- .github/workflows/ci.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2223844..6d8a0f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,17 +6,6 @@ on: 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 runs-on: ubuntu-latest From 96fad7a2576d1097a4ee300434b986c476b1349d Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Tue, 10 Dec 2024 10:26:35 +0100 Subject: [PATCH 07/27] use cargo to install wasm-pack --- .github/workflows/ci.yml | 2 +- rust-version | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 rust-version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d8a0f8..a96d9cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: with: toolchain: ${{ matrix.rust }} - name: Install wasm-pack - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -f + run: cargo install wasm-pack - name: Rust Cache uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - name: Build diff --git a/rust-version b/rust-version deleted file mode 100644 index 8f03ba2..0000000 --- a/rust-version +++ /dev/null @@ -1 +0,0 @@ -1.82.0 \ No newline at end of file From bc61caec1ebc53dc3aa9eac311d00a2465017c03 Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Tue, 10 Dec 2024 10:32:02 +0100 Subject: [PATCH 08/27] msrv 1.74 --- .github/workflows/ci.yml | 2 +- Cargo.toml | 2 +- clippy.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a96d9cb..30fa5eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: matrix: rust: - stable - - 1.73.0 # MSRV + - 1.74.0 # MSRV features: - all - debug,default diff --git a/Cargo.toml b/Cargo.toml index 3bc8be6..b8015d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ readme = "README.md" license = "MIT OR Apache-2.0" authors = ["Bitcoin Developers"] edition = "2021" -rust-version = "1.73" +rust-version = "1.74" [lib] crate-type = ["cdylib", "rlib"] diff --git a/clippy.toml b/clippy.toml index f09ac0f..3b9db9d 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.73.0" +msrv = "1.74.0" From 6c87c1039138b7847c64a9787d9b60bb5a4edc1d Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Tue, 10 Dec 2024 10:40:34 +0100 Subject: [PATCH 09/27] msrv 1.73 and locked --- .github/workflows/ci.yml | 4 ++-- Cargo.toml | 2 +- clippy.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30fa5eb..5a8780d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: matrix: rust: - stable - - 1.74.0 # MSRV + - 1.73.0 # MSRV features: - all - debug,default @@ -28,7 +28,7 @@ jobs: with: toolchain: ${{ matrix.rust }} - name: Install wasm-pack - run: cargo install wasm-pack + run: cargo install wasm-pack --locked - name: Rust Cache uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - name: Build diff --git a/Cargo.toml b/Cargo.toml index b8015d4..3bc8be6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ readme = "README.md" license = "MIT OR Apache-2.0" authors = ["Bitcoin Developers"] edition = "2021" -rust-version = "1.74" +rust-version = "1.73" [lib] crate-type = ["cdylib", "rlib"] diff --git a/clippy.toml b/clippy.toml index 3b9db9d..f09ac0f 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.74.0" +msrv = "1.73.0" From 91dc5e893cefe2cf807f9db0d1585d802085ba97 Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Wed, 11 Dec 2024 10:06:43 +0100 Subject: [PATCH 10/27] new types --- .github/workflows/ci.yml | 8 ++- Cargo.toml | 4 +- src/bitcoin/esplora_wallet.rs | 6 +- src/types/address.rs | 2 +- src/types/amount.rs | 124 ++++++++++++++++++++++++++++++++++ src/types/balance.rs | 29 ++++---- src/types/block.rs | 30 ++++++++ src/types/checkpoint.rs | 64 ++++++++++++++++++ src/types/mod.rs | 6 ++ tests/esplora.rs | 2 +- tests/wallet.rs | 2 +- 11 files changed, 257 insertions(+), 20 deletions(-) create mode 100644 src/types/amount.rs create mode 100644 src/types/block.rs create mode 100644 src/types/checkpoint.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a8780d..63086c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,8 +27,14 @@ jobs: uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 with: toolchain: ${{ matrix.rust }} + - name: Download wasm-pack + run: curl -sSL https://rustwasm.github.io/wasm-pack/installer/init.sh -o wasm-pack-init.sh + - name: Verify wasm-pack checksum + run: | + echo "7969444a2635a28157a31fae9736701f658a5ab346eb0c99bea18313c0d84018 wasm-pack-init.sh" > checksum.txt + sha256sum -c checksum.txt - name: Install wasm-pack - run: cargo install wasm-pack --locked + run: sh wasm-pack-init.sh -f - name: Rust Cache uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - name: Build diff --git a/Cargo.toml b/Cargo.toml index 3bc8be6..60dc730 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,9 +34,9 @@ wasm-bindgen-futures = "0.4.45" anyhow = "1.0.93" thiserror = "2.0.3" serde = { version = "1.0.215", default-features = false, features = ["derive"] } -js-sys = "0.3.72" serde-wasm-bindgen = "0.6.5" rmp-serde = "1.3.0" +js-sys = "0.3.76" # Compatibility to compile to WASM getrandom = { version = "0.2.15", features = ["js"] } @@ -50,10 +50,12 @@ bdk_esplora = { version = "0.19", default-features = false, features = [ bitcoin = { version = "0.32.4", default-features = false } miniscript = "12.2.0" bdk_bitcoind_rpc = { version = "0.16.0", optional = true } +bdk_core = "0.3.0" # Debug dependencies console_error_panic_hook = { version = "0.1.7", optional = true } + [dev-dependencies] wasm-bindgen-test = "0.3.45" web-sys = { version = "0.3.72", features = ["console"] } diff --git a/src/bitcoin/esplora_wallet.rs b/src/bitcoin/esplora_wallet.rs index 2a6b488..d58107c 100644 --- a/src/bitcoin/esplora_wallet.rs +++ b/src/bitcoin/esplora_wallet.rs @@ -13,7 +13,7 @@ use wasm_bindgen::{prelude::wasm_bindgen, JsError, JsValue}; use crate::{ bitcoin::{seed_to_descriptor, xpriv_to_descriptor, xpub_to_descriptor}, result::JsResult, - types::{AddressInfo, AddressType, Balance, KeychainKind, Network}, + types::{AddressInfo, AddressType, Balance, CheckPoint, KeychainKind, Network}, }; #[wasm_bindgen] @@ -187,6 +187,10 @@ impl EsploraWallet { .collect() } + pub fn latest_checkpoint(&self) -> CheckPoint { + self.wallet.latest_checkpoint().into() + } + pub fn take_staged(&mut self) -> JsResult { match self.wallet.take_staged() { Some(changeset) => Ok(to_value(&changeset)?), diff --git a/src/types/address.rs b/src/types/address.rs index 46dda9d..34b4d16 100644 --- a/src/types/address.rs +++ b/src/types/address.rs @@ -59,7 +59,7 @@ impl From for AddressInfo { /// The different types of addresses. #[wasm_bindgen] -#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Debug)] #[non_exhaustive] pub enum AddressType { /// Pay to pubkey hash. diff --git a/src/types/amount.rs b/src/types/amount.rs new file mode 100644 index 0000000..454e0c0 --- /dev/null +++ b/src/types/amount.rs @@ -0,0 +1,124 @@ +use std::ops::Deref; + +use bitcoin::{Amount as BdkAmount, Denomination as BdkDenomination}; +use wasm_bindgen::prelude::wasm_bindgen; + +/// Amount +/// +/// The [Amount] type can be used to express Bitcoin amounts that support +/// arithmetic and conversion to various denominations. +#[wasm_bindgen] +#[derive(Debug)] +pub struct Amount { + amount: BdkAmount, +} + +#[wasm_bindgen] +impl Amount { + /// Gets the number of satoshis in this [`Amount`]. + pub fn to_sat(&self) -> u64 { + self.amount.to_sat() + } + + /// Express this [`Amount`] as a floating-point value in Bitcoin. + /// + /// Please be aware of the risk of using floating-point numbers. + pub fn to_btc(&self) -> f64 { + self.amount.to_btc() + } + + /// Express this [Amount] as a floating-point value in the given denomination. + /// + /// Please be aware of the risk of using floating-point numbers. + pub fn to_float_in(&self, denom: Denomination) -> f64 { + self.amount.to_float_in(denom.into()) + } +} + +impl Deref for Amount { + type Target = BdkAmount; + + fn deref(&self) -> &Self::Target { + &self.amount + } +} + +impl From for Amount { + fn from(amount: BdkAmount) -> Self { + Amount { amount } + } +} + +/// A set of denominations in which amounts can be expressed. +/// +/// # Examples +/// ``` +/// # use core::str::FromStr; +/// # use bitcoin_units::Amount; +/// +/// assert_eq!(Amount::from_str("1 BTC").unwrap(), Amount::from_sat(100_000_000)); +/// assert_eq!(Amount::from_str("1 cBTC").unwrap(), Amount::from_sat(1_000_000)); +/// assert_eq!(Amount::from_str("1 mBTC").unwrap(), Amount::from_sat(100_000)); +/// assert_eq!(Amount::from_str("1 uBTC").unwrap(), Amount::from_sat(100)); +/// assert_eq!(Amount::from_str("10 nBTC").unwrap(), Amount::from_sat(1)); +/// assert_eq!(Amount::from_str("10000 pBTC").unwrap(), Amount::from_sat(1)); +/// assert_eq!(Amount::from_str("1 bit").unwrap(), Amount::from_sat(100)); +/// assert_eq!(Amount::from_str("1 sat").unwrap(), Amount::from_sat(1)); +/// assert_eq!(Amount::from_str("1000 msats").unwrap(), Amount::from_sat(1)); +/// ``` +#[wasm_bindgen] +#[derive(Debug)] +#[non_exhaustive] +pub enum Denomination { + /// BTC + Bitcoin, + /// cBTC + CentiBitcoin, + /// mBTC + MilliBitcoin, + /// uBTC + MicroBitcoin, + /// nBTC + NanoBitcoin, + /// pBTC + PicoBitcoin, + /// bits + Bit, + /// satoshi + Satoshi, + /// msat + MilliSatoshi, +} + +impl From for Denomination { + fn from(denom: BdkDenomination) -> Self { + match denom { + BdkDenomination::Bitcoin => Denomination::Bitcoin, + BdkDenomination::CentiBitcoin => Denomination::CentiBitcoin, + BdkDenomination::MilliBitcoin => Denomination::MilliBitcoin, + BdkDenomination::MicroBitcoin => Denomination::MicroBitcoin, + BdkDenomination::NanoBitcoin => Denomination::NanoBitcoin, + BdkDenomination::PicoBitcoin => Denomination::PicoBitcoin, + BdkDenomination::Bit => Denomination::Bit, + BdkDenomination::Satoshi => Denomination::Satoshi, + BdkDenomination::MilliSatoshi => Denomination::MilliSatoshi, + _ => panic!("Unsupported address type"), + } + } +} + +impl From for BdkDenomination { + fn from(denom: Denomination) -> Self { + match denom { + Denomination::Bitcoin => BdkDenomination::Bitcoin, + Denomination::CentiBitcoin => BdkDenomination::CentiBitcoin, + Denomination::MilliBitcoin => BdkDenomination::MilliBitcoin, + Denomination::MicroBitcoin => BdkDenomination::MicroBitcoin, + Denomination::NanoBitcoin => BdkDenomination::NanoBitcoin, + Denomination::PicoBitcoin => BdkDenomination::PicoBitcoin, + Denomination::Bit => BdkDenomination::Bit, + Denomination::Satoshi => BdkDenomination::Satoshi, + Denomination::MilliSatoshi => BdkDenomination::MilliSatoshi, + } + } +} diff --git a/src/types/balance.rs b/src/types/balance.rs index 5ba6bc4..0f543f6 100644 --- a/src/types/balance.rs +++ b/src/types/balance.rs @@ -1,12 +1,13 @@ use std::ops::Deref; use bdk_wallet::Balance as BdkBalance; -use serde::Serialize; use wasm_bindgen::prelude::wasm_bindgen; +use super::Amount; + /// Balance, differentiated into various categories. #[wasm_bindgen] -#[derive(Debug, Serialize)] +#[derive(Debug)] pub struct Balance { balance: BdkBalance, } @@ -15,26 +16,26 @@ pub struct Balance { impl Balance { /// All coinbase outputs not yet matured #[wasm_bindgen(getter)] - pub fn immature(&self) -> u64 { - self.balance.immature.to_sat() + pub fn immature(&self) -> Amount { + self.balance.immature.into() } /// Unconfirmed UTXOs generated by a wallet tx #[wasm_bindgen(getter)] - pub fn trusted_pending(&self) -> u64 { - self.balance.trusted_pending.to_sat() + pub fn trusted_pending(&self) -> Amount { + self.balance.trusted_pending.into() } /// Unconfirmed UTXOs received from an external wallet #[wasm_bindgen(getter)] - pub fn untrusted_pending(&self) -> u64 { - self.balance.untrusted_pending.to_sat() + pub fn untrusted_pending(&self) -> Amount { + self.balance.untrusted_pending.into() } /// Confirmed and immediately spendable balance #[wasm_bindgen(getter)] - pub fn confirmed(&self) -> u64 { - self.balance.confirmed.to_sat() + pub fn confirmed(&self) -> Amount { + self.balance.confirmed.into() } /// Get sum of trusted_pending and confirmed coins. @@ -42,14 +43,14 @@ impl Balance { /// This is the balance you can spend right now that shouldn't get cancelled via another party /// double spending it. #[wasm_bindgen(getter)] - pub fn trusted_spendable(&self) -> u64 { - self.balance.trusted_spendable().to_sat() + pub fn trusted_spendable(&self) -> Amount { + self.balance.trusted_spendable().into() } /// Get the whole balance visible to the wallet. #[wasm_bindgen(getter)] - pub fn total(&self) -> u64 { - self.balance.total().to_sat() + pub fn total(&self) -> Amount { + self.balance.total().into() } } diff --git a/src/types/block.rs b/src/types/block.rs new file mode 100644 index 0000000..dc5a19d --- /dev/null +++ b/src/types/block.rs @@ -0,0 +1,30 @@ +use bdk_core::BlockId as BdkBlockId; +use wasm_bindgen::prelude::wasm_bindgen; + +/// A reference to a block in the canonical chain. +#[wasm_bindgen] +#[derive(Debug)] +pub struct BlockId { + block_id: BdkBlockId, +} + +#[wasm_bindgen] +impl BlockId { + /// The height of the block. + #[wasm_bindgen(getter)] + pub fn height(&self) -> u32 { + self.block_id.height + } + + /// The hash of the block. + #[wasm_bindgen(getter)] + pub fn hash(&self) -> String { + self.block_id.hash.to_string() + } +} + +impl From for BlockId { + fn from(block_id: BdkBlockId) -> Self { + BlockId { block_id } + } +} diff --git a/src/types/checkpoint.rs b/src/types/checkpoint.rs new file mode 100644 index 0000000..ffcd336 --- /dev/null +++ b/src/types/checkpoint.rs @@ -0,0 +1,64 @@ +use std::ops::Deref; + +use bdk_core::CheckPoint as BdkCheckPoint; +use wasm_bindgen::prelude::wasm_bindgen; + +use super::BlockId; + +/// A checkpoint is a node of a reference-counted linked list of [`BlockId`]s. +/// +/// Checkpoints are cheaply cloneable and are useful to find the agreement point between two sparse +/// block chains. +#[wasm_bindgen] +#[derive(Debug)] +pub struct CheckPoint { + checkpoint: BdkCheckPoint, +} + +#[wasm_bindgen] +impl CheckPoint { + /// Get the [`BlockId`] of the checkpoint. + #[wasm_bindgen(getter)] + pub fn block_id(&self) -> BlockId { + self.checkpoint.block_id().into() + } + + /// Get the height of the checkpoint. + #[wasm_bindgen(getter)] + pub fn height(&self) -> u32 { + self.checkpoint.height() + } + + /// Get the block hash of the checkpoint. + #[wasm_bindgen(getter)] + pub fn hash(&self) -> String { + self.checkpoint.hash().to_string() + } + + /// Get the previous checkpoint in the chain + #[wasm_bindgen(getter)] + pub fn prev(&self) -> Option { + self.checkpoint.prev().map(Into::into) + } + + /// Get checkpoint at `height`. + /// + /// Returns `None` if checkpoint at `height` does not exist`. + pub fn get(&self, height: u32) -> Option { + self.checkpoint.get(height).map(Into::into) + } +} + +impl Deref for CheckPoint { + type Target = BdkCheckPoint; + + fn deref(&self) -> &Self::Target { + &self.checkpoint + } +} + +impl From for CheckPoint { + fn from(checkpoint: BdkCheckPoint) -> Self { + CheckPoint { checkpoint } + } +} diff --git a/src/types/mod.rs b/src/types/mod.rs index 983d19f..987db44 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -1,5 +1,8 @@ mod address; +mod amount; mod balance; +mod block; +mod checkpoint; mod descriptor; mod error; mod keychain; @@ -7,7 +10,10 @@ mod network; mod slip_10; pub use address::*; +pub use amount::*; pub use balance::*; +pub use block::*; +pub use checkpoint::*; pub use descriptor::*; pub use error::*; pub use keychain::*; diff --git a/tests/esplora.rs b/tests/esplora.rs index 3cb1668..106dba3 100644 --- a/tests/esplora.rs +++ b/tests/esplora.rs @@ -48,7 +48,7 @@ async fn test_esplora_wallet() { ); let balance = wallet.balance(); - assert_eq!(balance.total(), 0); + assert_eq!(balance.total().to_sat(), 0); let address1 = wallet.next_unused_address(KeychainKind::External); assert_eq!(address1.keychain(), KeychainKind::External); diff --git a/tests/wallet.rs b/tests/wallet.rs index 3987c74..329d565 100644 --- a/tests/wallet.rs +++ b/tests/wallet.rs @@ -96,7 +96,7 @@ async fn test_wallet() { let mut wallet = Wallet::from_seed(&seed, NETWORK, ADDRESS_TYPE).expect("wallet"); let balance = wallet.balance(); - assert_eq!(balance.total(), 0); + assert_eq!(balance.total().to_sat(), 0); let initial_changeset_js = wallet.take_staged().expect("take_staged"); let initial_changeset: ChangeSet = From 188a6ee247e4a129e3ea8ab821cd2a7fe932f95c Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Wed, 11 Dec 2024 12:46:09 +0100 Subject: [PATCH 11/27] typo in messagePack --- src/storage/snap_persister.rs | 4 ++-- src/types/error.rs | 8 ++++---- src/types/mod.rs | 4 ++-- src/types/{slip_10.rs => slip10.rs} | 0 4 files changed, 8 insertions(+), 8 deletions(-) rename src/types/{slip_10.rs => slip10.rs} (100%) diff --git a/src/storage/snap_persister.rs b/src/storage/snap_persister.rs index 50a7b2c..6eb507c 100644 --- a/src/storage/snap_persister.rs +++ b/src/storage/snap_persister.rs @@ -34,7 +34,7 @@ impl SnapPersister { let mut changeset = self.extract_changeset(&state)?; changeset.merge(new_changeset.clone()); - let state_bytes = rmp_serde::to_vec(&changeset).map_err(SnapPersisterError::EncodeMRP)?; + let state_bytes = rmp_serde::to_vec(&changeset).map_err(SnapPersisterError::EncodeMP)?; let state_b64 = BASE64_STANDARD.encode(&state_bytes); state.insert(self.key.clone(), state_b64); @@ -80,7 +80,7 @@ impl SnapPersister { let state_bytes = BASE64_STANDARD .decode(state_b64) .map_err(SnapPersisterError::DecodeBase64)?; - rmp_serde::from_slice(&state_bytes).map_err(SnapPersisterError::DecodeMRP) + rmp_serde::from_slice(&state_bytes).map_err(SnapPersisterError::DecodeMP) } else { Ok(ChangeSet::default()) } diff --git a/src/types/error.rs b/src/types/error.rs index 44d8a13..1828ece 100644 --- a/src/types/error.rs +++ b/src/types/error.rs @@ -9,10 +9,10 @@ pub enum SnapPersisterError { ReadSnapState(JsValue), #[error("Failed to write snap state: {:?}", 0)] WriteSnapState(JsValue), - #[error("Failed to encode MRP: {0}")] - EncodeMRP(#[source] rmp_serde::encode::Error), - #[error("Failed to decode RMP: {0}")] - DecodeMRP(#[source] rmp_serde::decode::Error), + #[error("Failed to encode MessagePack: {0}")] + EncodeMP(#[source] rmp_serde::encode::Error), + #[error("Failed to decode MessagePack: {0}")] + DecodeMP(#[source] rmp_serde::decode::Error), #[error("Failed to decode base64: {0}")] DecodeBase64(#[source] bitcoin::base64::DecodeError), #[error("Failed to deserialize: {0}")] diff --git a/src/types/mod.rs b/src/types/mod.rs index 987db44..903c16b 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -7,7 +7,7 @@ mod descriptor; mod error; mod keychain; mod network; -mod slip_10; +mod slip10; pub use address::*; pub use amount::*; @@ -18,4 +18,4 @@ pub use descriptor::*; pub use error::*; pub use keychain::*; pub use network::*; -pub use slip_10::*; +pub use slip10::*; diff --git a/src/types/slip_10.rs b/src/types/slip10.rs similarity index 100% rename from src/types/slip_10.rs rename to src/types/slip10.rs From 8977894bf4e9e8bb108f78b99d43c6e93812149c Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Wed, 11 Dec 2024 12:50:39 +0100 Subject: [PATCH 12/27] typo in messagePack --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 3c4ed4d..30407c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,9 +33,9 @@ wasm-bindgen-futures = "0.4.45" anyhow = "1.0.93" thiserror = "2.0.3" serde = { version = "1.0.215", default-features = false, features = ["derive"] } +js-sys = "0.3.76" serde-wasm-bindgen = "0.6.5" rmp-serde = "1.3.0" -js-sys = "0.3.76" # Compatibility to compile to WASM getrandom = { version = "0.2.15", features = ["js"] } From 22037da63446a5db1ad751bb5a871e677e535184 Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Wed, 11 Dec 2024 13:08:59 +0100 Subject: [PATCH 13/27] add to wallet as well --- src/bitcoin/wallet.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bitcoin/wallet.rs b/src/bitcoin/wallet.rs index cc228fd..b35e2ce 100644 --- a/src/bitcoin/wallet.rs +++ b/src/bitcoin/wallet.rs @@ -8,7 +8,7 @@ use wasm_bindgen::{prelude::wasm_bindgen, JsError, JsValue}; use crate::{ bitcoin::{seed_to_descriptor, xpriv_to_descriptor, xpub_to_descriptor}, result::JsResult, - types::{AddressInfo, AddressType, Balance, KeychainKind, Network}, + types::{AddressInfo, AddressType, Balance, CheckPoint, KeychainKind, Network}, }; #[wasm_bindgen] @@ -136,6 +136,10 @@ impl Wallet { .collect() } + pub fn latest_checkpoint(&self) -> CheckPoint { + self.wallet.latest_checkpoint().into() + } + pub fn take_staged(&mut self) -> JsResult { match self.wallet.take_staged() { Some(changeset) => Ok(to_value(&changeset)?), From 39f0657c6c56dccc153ee2fe3321b46d0395c0d7 Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Wed, 11 Dec 2024 13:15:59 +0100 Subject: [PATCH 14/27] add block_height in tests --- tests/wallet.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/wallet.rs b/tests/wallet.rs index 4eae8d6..dc37aec 100644 --- a/tests/wallet.rs +++ b/tests/wallet.rs @@ -96,6 +96,9 @@ async fn test_wallet() { let balance = wallet.balance(); assert_eq!(balance.total().to_sat(), 0); + let block_height = wallet.latest_checkpoint().height(); + assert_eq!(block_height, 0); + let initial_changeset_js = wallet.take_staged().expect("take_staged"); let initial_changeset: ChangeSet = from_value(initial_changeset_js.clone()).expect("from_value"); assert_eq!(initial_changeset.descriptor.unwrap().to_string(), "wpkh([27f9035f/84'/1'/0']tpubDCkv2fHDfPg5hB6bFqJ4fNiins2Z8r5vKtD4xq5irCG2HsUXkgHYsj3gfGTdvAv41hoJeXjfxu7EBQqZMm6SVkxztKFtaaE7HuLdkuL7KNq/0/*)#wle7e0wp"); From edab32d432076676f7d520a73539b444e18dd48e Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Wed, 11 Dec 2024 13:21:42 +0100 Subject: [PATCH 15/27] remove comments in Denomination --- src/types/amount.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/types/amount.rs b/src/types/amount.rs index 454e0c0..72a000c 100644 --- a/src/types/amount.rs +++ b/src/types/amount.rs @@ -50,22 +50,6 @@ impl From for Amount { } /// A set of denominations in which amounts can be expressed. -/// -/// # Examples -/// ``` -/// # use core::str::FromStr; -/// # use bitcoin_units::Amount; -/// -/// assert_eq!(Amount::from_str("1 BTC").unwrap(), Amount::from_sat(100_000_000)); -/// assert_eq!(Amount::from_str("1 cBTC").unwrap(), Amount::from_sat(1_000_000)); -/// assert_eq!(Amount::from_str("1 mBTC").unwrap(), Amount::from_sat(100_000)); -/// assert_eq!(Amount::from_str("1 uBTC").unwrap(), Amount::from_sat(100)); -/// assert_eq!(Amount::from_str("10 nBTC").unwrap(), Amount::from_sat(1)); -/// assert_eq!(Amount::from_str("10000 pBTC").unwrap(), Amount::from_sat(1)); -/// assert_eq!(Amount::from_str("1 bit").unwrap(), Amount::from_sat(100)); -/// assert_eq!(Amount::from_str("1 sat").unwrap(), Amount::from_sat(1)); -/// assert_eq!(Amount::from_str("1000 msats").unwrap(), Amount::from_sat(1)); -/// ``` #[wasm_bindgen] #[derive(Debug)] #[non_exhaustive] From 29fbb652ae1b09a350fb8a8663a7aec2184e9af2 Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Wed, 11 Dec 2024 14:54:26 +0100 Subject: [PATCH 16/27] remove on exhaustive and add p2wsh --- src/types/address.rs | 5 ++++- src/types/amount.rs | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/types/address.rs b/src/types/address.rs index 34b4d16..4df73ea 100644 --- a/src/types/address.rs +++ b/src/types/address.rs @@ -60,7 +60,6 @@ impl From for AddressInfo { /// The different types of addresses. #[wasm_bindgen] #[derive(Debug)] -#[non_exhaustive] pub enum AddressType { /// Pay to pubkey hash. P2pkh, @@ -68,6 +67,8 @@ pub enum AddressType { P2sh, /// Pay to witness pubkey hash. P2wpkh, + /// Pay to witness script hash. + P2wsh, /// Pay to taproot. P2tr, } @@ -78,6 +79,7 @@ impl From for AddressType { BdkAddressType::P2pkh => AddressType::P2pkh, BdkAddressType::P2sh => AddressType::P2sh, BdkAddressType::P2wpkh => AddressType::P2wpkh, + BdkAddressType::P2wsh => AddressType::P2wsh, BdkAddressType::P2tr => AddressType::P2tr, _ => panic!("Unsupported address type"), } @@ -90,6 +92,7 @@ impl From for BdkAddressType { AddressType::P2pkh => BdkAddressType::P2pkh, AddressType::P2sh => BdkAddressType::P2sh, AddressType::P2wpkh => BdkAddressType::P2wpkh, + AddressType::P2wsh => BdkAddressType::P2wsh, AddressType::P2tr => BdkAddressType::P2tr, } } diff --git a/src/types/amount.rs b/src/types/amount.rs index 72a000c..efc0ffb 100644 --- a/src/types/amount.rs +++ b/src/types/amount.rs @@ -52,7 +52,6 @@ impl From for Amount { /// A set of denominations in which amounts can be expressed. #[wasm_bindgen] #[derive(Debug)] -#[non_exhaustive] pub enum Denomination { /// BTC Bitcoin, @@ -86,7 +85,7 @@ impl From for Denomination { BdkDenomination::Bit => Denomination::Bit, BdkDenomination::Satoshi => Denomination::Satoshi, BdkDenomination::MilliSatoshi => Denomination::MilliSatoshi, - _ => panic!("Unsupported address type"), + _ => panic!("Unsupported denomination"), } } } From e37cda66a98acb2dbb31ce7752f0097a7292b98d Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Wed, 11 Dec 2024 18:39:06 +0100 Subject: [PATCH 17/27] before merge --- src/bitcoin/esplora_client.rs | 43 ++++++++ src/bitcoin/esplora_wallet.rs | 198 ---------------------------------- src/bitcoin/mod.rs | 4 +- src/types/chain.rs | 126 ++++++++++++++++++++++ src/types/mod.rs | 2 + tests/esplora.rs | 4 +- 6 files changed, 175 insertions(+), 202 deletions(-) create mode 100644 src/bitcoin/esplora_client.rs delete mode 100644 src/bitcoin/esplora_wallet.rs create mode 100644 src/types/chain.rs diff --git a/src/bitcoin/esplora_client.rs b/src/bitcoin/esplora_client.rs new file mode 100644 index 0000000..dae7ef6 --- /dev/null +++ b/src/bitcoin/esplora_client.rs @@ -0,0 +1,43 @@ +use bdk_core::spk_client::{FullScanRequest as BdkFullScanRequest, SyncRequest as BdkSyncRequest}; +use bdk_esplora::{ + esplora_client::{AsyncClient, Builder}, + EsploraAsyncExt, +}; +use bdk_wallet::KeychainKind; +use wasm_bindgen::prelude::wasm_bindgen; + +use crate::{ + result::JsResult, + types::{FullScanRequest, FullScanResult, SyncRequest, SyncResult}, +}; + +#[wasm_bindgen] +pub struct EsploraClient { + client: AsyncClient, +} + +#[wasm_bindgen] +impl EsploraClient { + #[wasm_bindgen(getter)] + pub fn new(url: &str) -> JsResult { + let client = Builder::new(url).build_async()?; + Ok(EsploraClient { client }) + } + + pub async fn full_scan( + &mut self, + request: FullScanRequest, + stop_gap: usize, + parallel_requests: usize, + ) -> JsResult { + let request: BdkFullScanRequest = request.into(); + let result = self.client.full_scan(request, stop_gap, parallel_requests).await?; + Ok(result.into()) + } + + pub async fn sync(&mut self, request: SyncRequest, parallel_requests: usize) -> JsResult { + let request: BdkSyncRequest = request.into(); + let result = self.client.sync(request, parallel_requests).await?; + Ok(result.into()) + } +} diff --git a/src/bitcoin/esplora_wallet.rs b/src/bitcoin/esplora_wallet.rs deleted file mode 100644 index a0067ed..0000000 --- a/src/bitcoin/esplora_wallet.rs +++ /dev/null @@ -1,198 +0,0 @@ -use std::str::FromStr; - -use bdk_esplora::{ - esplora_client::{AsyncClient, Builder}, - EsploraAsyncExt, -}; -use bdk_wallet::{chain::Merge, descriptor::IntoWalletDescriptor, ChangeSet, Wallet}; -use bitcoin::bip32::{Fingerprint, Xpriv, Xpub}; -use js_sys::Date; -use serde_wasm_bindgen::{from_value, to_value}; -use wasm_bindgen::{prelude::wasm_bindgen, JsError, JsValue}; - -use crate::{ - bitcoin::{seed_to_descriptor, xpriv_to_descriptor, xpub_to_descriptor}, - result::JsResult, - types::{AddressInfo, AddressType, Balance, CheckPoint, KeychainKind, Network}, -}; - -#[wasm_bindgen] -pub struct EsploraWallet { - wallet: Wallet, - client: AsyncClient, -} - -#[wasm_bindgen] -impl EsploraWallet { - fn create( - network: Network, - external_descriptor: D, - internal_descriptor: D, - url: &str, - ) -> Result - where - D: IntoWalletDescriptor + Send + Clone + 'static, - { - let wallet = Wallet::create(external_descriptor, internal_descriptor) - .network(network.into()) - .create_wallet_no_persist()?; - - let client = Builder::new(url).build_async()?; - - Ok(EsploraWallet { wallet, client }) - } - - pub fn from_descriptors( - network: Network, - external_descriptor: String, - internal_descriptor: String, - url: &str, - ) -> JsResult { - Self::create(network, external_descriptor, internal_descriptor, url).map_err(|e| JsError::new(&e.to_string())) - } - - pub fn from_seed(seed: &[u8], network: Network, address_type: AddressType, url: &str) -> JsResult { - let (external_descriptor, internal_descriptor) = - seed_to_descriptor(seed, network.into(), address_type.into()).map_err(|e| JsError::new(&e.to_string()))?; - - Self::create(network, external_descriptor, internal_descriptor, url).map_err(|e| JsError::new(&e.to_string())) - } - - pub fn from_xpriv( - extended_privkey: &str, - fingerprint: &str, - network: Network, - address_type: AddressType, - url: &str, - ) -> JsResult { - let xprv = Xpriv::from_str(extended_privkey).map_err(|e| JsError::new(&e.to_string()))?; - let fingerprint = Fingerprint::from_hex(fingerprint)?; - - let (external_descriptor, internal_descriptor) = - xpriv_to_descriptor(xprv, fingerprint, network.into(), address_type.into()) - .map_err(|e| JsError::new(&e.to_string()))?; - - Self::create(network, external_descriptor, internal_descriptor, url).map_err(|e| JsError::new(&e.to_string())) - } - - pub fn from_xpub( - extended_pubkey: &str, - fingerprint: &str, - network: Network, - address_type: AddressType, - url: &str, - ) -> JsResult { - let xpub = Xpub::from_str(extended_pubkey)?; - let fingerprint = Fingerprint::from_hex(fingerprint)?; - - let (external_descriptor, internal_descriptor) = - xpub_to_descriptor(xpub, fingerprint, network.into(), address_type.into()) - .map_err(|e| JsError::new(&e.to_string()))?; - - Self::create(network, external_descriptor, internal_descriptor, url).map_err(|e| JsError::new(&e.to_string())) - } - - pub fn load(changeset: JsValue, url: &str) -> JsResult { - let changeset = from_value(changeset)?; - let wallet_opt = Wallet::load().load_wallet_no_persist(changeset)?; - - let wallet = match wallet_opt { - Some(wallet) => wallet, - None => return Err(JsError::new("Failed to load wallet, check the changeset")), - }; - - let client = Builder::new(url).build_async()?; - - Ok(EsploraWallet { wallet, client }) - } - - pub async fn full_scan(&mut self, stop_gap: usize, parallel_requests: usize) -> JsResult<()> { - let request = self.wallet.start_full_scan(); - let update = self.client.full_scan(request, stop_gap, parallel_requests).await?; - - let now = (Date::now() / 1000.0) as u64; - self.wallet.apply_update_at(update, Some(now))?; - - Ok(()) - } - - pub async fn sync(&mut self, parallel_requests: usize) -> JsResult<()> { - let request = self.wallet.start_sync_with_revealed_spks(); - let update = self.client.sync(request, parallel_requests).await?; - - let now = (Date::now() / 1000.0) as u64; - self.wallet.apply_update_at(update, Some(now))?; - - Ok(()) - } - - pub fn network(&self) -> Network { - self.wallet.network().into() - } - - pub fn balance(&self) -> Balance { - self.wallet.balance().into() - } - - pub fn next_unused_address(&mut self, keychain: KeychainKind) -> AddressInfo { - self.wallet.next_unused_address(keychain.into()).into() - } - - pub fn peek_address(&self, keychain: KeychainKind, index: u32) -> AddressInfo { - self.wallet.peek_address(keychain.into(), index).into() - } - - pub fn reveal_next_address(&mut self, keychain: KeychainKind) -> AddressInfo { - self.wallet.reveal_next_address(keychain.into()).into() - } - - pub fn reveal_addresses_to(&mut self, keychain: KeychainKind, index: u32) -> Vec { - self.wallet - .reveal_addresses_to(keychain.into(), index) - .map(Into::into) - .collect() - } - - pub fn list_unused_addresses(&self, keychain: KeychainKind) -> Vec { - self.wallet - .list_unused_addresses(keychain.into()) - .map(Into::into) - .collect() - } - - pub fn list_unspent(&self) -> JsResult> { - self.wallet - .list_unspent() - .map(|output| to_value(&output).map_err(Into::into)) - .collect() - } - - pub fn transactions(&self) -> JsResult> { - self.wallet - .transactions() - .map(|tx| to_value(&tx.tx_node.tx).map_err(Into::into)) - .collect() - } - - pub fn latest_checkpoint(&self) -> CheckPoint { - self.wallet.latest_checkpoint().into() - } - - pub fn take_staged(&mut self) -> JsResult { - match self.wallet.take_staged() { - Some(changeset) => Ok(to_value(&changeset)?), - None => Ok(JsValue::null()), - } - } - - pub fn take_merged(&mut self, previous: JsValue) -> JsResult { - match self.wallet.take_staged() { - Some(curr_changeset) => { - let mut changeset: ChangeSet = from_value(previous)?; - changeset.merge(curr_changeset); - Ok(to_value(&changeset)?) - } - None => Ok(JsValue::null()), - } - } -} diff --git a/src/bitcoin/mod.rs b/src/bitcoin/mod.rs index e18439d..c88853b 100644 --- a/src/bitcoin/mod.rs +++ b/src/bitcoin/mod.rs @@ -5,13 +5,13 @@ pub use descriptor::*; pub use wallet::*; #[cfg(feature = "esplora")] -mod esplora_wallet; +mod esplora_client; #[cfg(feature = "snap")] mod snap_wallet; #[cfg(feature = "esplora")] -pub use esplora_wallet::EsploraWallet; +pub use esplora_client::EsploraClient; #[cfg(feature = "snap")] pub use snap_wallet::SnapWallet; diff --git a/src/types/chain.rs b/src/types/chain.rs new file mode 100644 index 0000000..1b1161d --- /dev/null +++ b/src/types/chain.rs @@ -0,0 +1,126 @@ +use std::ops::Deref; + +use bdk_core::spk_client::{ + FullScanRequest as BdkFullScanRequest, FullScanResult as BdkFullScanResult, SyncRequest as BdkSyncRequest, + SyncResult as BdkSyncResult, +}; +use bdk_wallet::KeychainKind; +use wasm_bindgen::prelude::wasm_bindgen; + +/// Data required to perform a spk-based blockchain client sync. +/// +/// A client sync fetches relevant chain data for a known list of scripts, transaction ids and +/// outpoints. +#[wasm_bindgen] +pub struct SyncRequest { + request: BdkSyncRequest, +} + +impl Deref for SyncRequest { + type Target = BdkSyncRequest; + + fn deref(&self) -> &Self::Target { + &self.request + } +} + +impl From> for SyncRequest { + fn from(request: BdkSyncRequest) -> Self { + SyncRequest { request } + } +} + +impl From for BdkSyncRequest { + fn from(request: SyncRequest) -> Self { + request.request + } +} + +/// Data returned from a spk-based blockchain client sync. +/// +/// See also [`SyncRequest`]. +#[wasm_bindgen] +#[derive(Debug)] +pub struct SyncResult { + result: BdkSyncResult, +} + +impl Deref for SyncResult { + type Target = BdkSyncResult; + + fn deref(&self) -> &Self::Target { + &self.result + } +} + +impl From for SyncResult { + fn from(result: BdkSyncResult) -> Self { + SyncResult { result } + } +} + +impl From for BdkSyncResult { + fn from(result: SyncResult) -> Self { + result.result + } +} + +/// Data required to perform a spk-based blockchain client full scan. +/// +/// A client full scan iterates through all the scripts for the given keychains, fetching relevant +/// data until some stop gap number of scripts is found that have no data. This operation is +/// generally only used when importing or restoring previously used keychains in which the list of +/// used scripts is not known. +#[wasm_bindgen] +pub struct FullScanRequest { + request: BdkFullScanRequest, +} + +impl Deref for FullScanRequest { + type Target = BdkFullScanRequest; + + fn deref(&self) -> &Self::Target { + &self.request + } +} + +impl From> for FullScanRequest { + fn from(request: BdkFullScanRequest) -> Self { + FullScanRequest { request } + } +} + +impl From for BdkFullScanRequest { + fn from(request: FullScanRequest) -> Self { + request.request + } +} + +/// Data returned from a spk-based blockchain client full scan. +/// +/// See also [`FullScanRequest`]. +#[wasm_bindgen] +#[derive(Debug)] +pub struct FullScanResult { + result: BdkFullScanResult, +} + +impl Deref for FullScanResult { + type Target = BdkFullScanResult; + + fn deref(&self) -> &Self::Target { + &self.result + } +} + +impl From> for FullScanResult { + fn from(result: BdkFullScanResult) -> Self { + FullScanResult { result } + } +} + +impl From for BdkFullScanResult { + fn from(result: FullScanResult) -> Self { + result.result + } +} diff --git a/src/types/mod.rs b/src/types/mod.rs index 903c16b..b86543a 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -2,6 +2,7 @@ mod address; mod amount; mod balance; mod block; +mod chain; mod checkpoint; mod descriptor; mod error; @@ -13,6 +14,7 @@ pub use address::*; pub use amount::*; pub use balance::*; pub use block::*; +pub use chain::*; pub use checkpoint::*; pub use descriptor::*; pub use error::*; diff --git a/tests/esplora.rs b/tests/esplora.rs index 025480d..4499a3c 100644 --- a/tests/esplora.rs +++ b/tests/esplora.rs @@ -6,7 +6,7 @@ extern crate wasm_bindgen_test; use bdk_wallet::bip39::Mnemonic; use bdk_wasm::{ - bitcoin::EsploraWallet, + bitcoin::EsploraClient, set_panic_hook, types::{AddressType, KeychainKind, Network}, }; @@ -33,7 +33,7 @@ async fn test_esplora_wallet() { }; let seed = Mnemonic::parse(MNEMONIC).unwrap().to_seed(""); - let mut wallet = EsploraWallet::from_seed(&seed, NETWORK, ADDRESS_TYPE, esplora_url).expect("esplora_wallet"); + let mut wallet = EsploraClient::from_seed(&seed, NETWORK, ADDRESS_TYPE, esplora_url).expect("esplora_wallet"); wallet.full_scan(STOP_GAP, PARALLEL_REQUESTS).await.expect("full_scan"); From 0fade28a47a4f0706b7f4b3009191705edfc12dd Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Wed, 11 Dec 2024 19:23:51 +0100 Subject: [PATCH 18/27] tests --- tests/esplora.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/esplora.rs b/tests/esplora.rs index 63b50e7..f8c9e13 100644 --- a/tests/esplora.rs +++ b/tests/esplora.rs @@ -50,7 +50,7 @@ async fn test_esplora_client() { .expect("full_scan apply_update_at"); let fullscan_block_height = wallet.latest_checkpoint().height(); - assert!(block_height > 0); + assert!(fullscan_block_height > 0); let sync_request = wallet.start_sync_with_revealed_spks(); let update = blockchain_client From ffe8a13703da6b35c3f762a09dc137b2ab71f79c Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Wed, 11 Dec 2024 19:26:24 +0100 Subject: [PATCH 19/27] reveal addresses for sync --- tests/esplora.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/esplora.rs b/tests/esplora.rs index f8c9e13..c4ce039 100644 --- a/tests/esplora.rs +++ b/tests/esplora.rs @@ -8,7 +8,7 @@ use bdk_wallet::bip39::Mnemonic; use bdk_wasm::{ bitcoin::{EsploraClient, Wallet}, set_panic_hook, - types::{AddressType, Network}, + types::{AddressType, KeychainKind, Network}, }; use js_sys::Date; use wasm_bindgen_test::*; @@ -17,7 +17,7 @@ wasm_bindgen_test_configure!(run_in_browser); const STOP_GAP: usize = 5; const PARALLEL_REQUESTS: usize = 1; -const NETWORK: Network = Network::Signet; +const NETWORK: Network = Network::Testnet; const ADDRESS_TYPE: AddressType = AddressType::P2wpkh; const MNEMONIC: &str = "journey embrace permit coil indoor stereo welcome maid movie easy clock spider tent slush bright luxury awake waste legal modify awkward answer acid goose"; @@ -52,6 +52,8 @@ async fn test_esplora_client() { let fullscan_block_height = wallet.latest_checkpoint().height(); assert!(fullscan_block_height > 0); + wallet.reveal_addresses_to(KeychainKind::External, 5); + let sync_request = wallet.start_sync_with_revealed_spks(); let update = blockchain_client .sync(sync_request, PARALLEL_REQUESTS) From 3fe0686254594fac3c3d09835c40b8a166a2b7a4 Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Thu, 12 Dec 2024 15:17:48 +0100 Subject: [PATCH 20/27] remove from snap wallet --- Cargo.toml | 2 +- src/bitcoin/snap_wallet.rs | 78 +++++++++++--------------------------- 2 files changed, 24 insertions(+), 56 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 30407c5..35bb988 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ crate-type = ["cdylib", "rlib"] default = [] esplora = ["bdk_esplora"] debug = ["console_error_panic_hook"] -snap = ["esplora"] +snap = ["default"] [dependencies] wasm-bindgen = "0.2.95" diff --git a/src/bitcoin/snap_wallet.rs b/src/bitcoin/snap_wallet.rs index 21cb1e7..ecde389 100644 --- a/src/bitcoin/snap_wallet.rs +++ b/src/bitcoin/snap_wallet.rs @@ -1,12 +1,7 @@ use std::str::FromStr; -use bdk_esplora::{ - esplora_client::{AsyncClient, Builder}, - EsploraAsyncExt, -}; use bdk_wallet::{descriptor::IntoWalletDescriptor, PersistedWallet, Wallet as BdkWallet}; use bitcoin::bip32::{Fingerprint, Xpriv, Xpub}; -use js_sys::Date; use serde_wasm_bindgen::to_value; use wasm_bindgen::{prelude::wasm_bindgen, JsError, JsValue}; @@ -14,7 +9,9 @@ use crate::{ bitcoin::{seed_to_descriptor, xpriv_to_descriptor, xpub_to_descriptor}, result::JsResult, storage::SnapPersister, - types::{AddressInfo, AddressType, Balance, KeychainKind, Network}, + types::{ + AddressInfo, AddressType, Balance, CheckPoint, FullScanRequest, KeychainKind, Network, SyncRequest, Update, + }, }; const STORAGE_KEY: &str = "wallet"; @@ -22,18 +19,12 @@ const STORAGE_KEY: &str = "wallet"; #[wasm_bindgen] pub struct SnapWallet { wallet: PersistedWallet, - client: AsyncClient, persister: SnapPersister, } #[wasm_bindgen] impl SnapWallet { - async fn create( - network: Network, - external_descriptor: D, - internal_descriptor: D, - url: &str, - ) -> JsResult + async fn create(network: Network, external_descriptor: D, internal_descriptor: D) -> JsResult where D: IntoWalletDescriptor + Send + Clone + 'static, { @@ -43,16 +34,10 @@ impl SnapWallet { .create_wallet_async(&mut persister) .await?; - let client = Builder::new(url).build_async()?; - - Ok(SnapWallet { - wallet, - client, - persister, - }) + Ok(SnapWallet { wallet, persister }) } - pub async fn load(url: &str) -> JsResult { + pub async fn load() -> JsResult { let mut persister = SnapPersister::new(STORAGE_KEY); let wallet_opt = BdkWallet::load().load_wallet_async(&mut persister).await?; @@ -61,34 +46,22 @@ impl SnapWallet { None => return Err(JsError::new("Failed to load wallet, check the changeset")), }; - let client = Builder::new(url).build_async()?; - - Ok(SnapWallet { - wallet, - client, - persister, - }) + Ok(SnapWallet { wallet, persister }) } pub async fn from_descriptors( network: Network, external_descriptor: String, internal_descriptor: String, - url: &str, ) -> JsResult { - Self::create(network, external_descriptor, internal_descriptor, url).await + Self::create(network, external_descriptor, internal_descriptor).await } - pub async fn from_seed( - seed: &[u8], - network: Network, - address_type: AddressType, - url: &str, - ) -> JsResult { + pub async fn from_seed(seed: &[u8], network: Network, address_type: AddressType) -> JsResult { let (external_descriptor, internal_descriptor) = seed_to_descriptor(seed, network.into(), address_type.into()).map_err(|e| JsError::new(&e.to_string()))?; - Self::create(network, external_descriptor, internal_descriptor, url).await + Self::create(network, external_descriptor, internal_descriptor).await } pub async fn from_xpriv( @@ -96,7 +69,6 @@ impl SnapWallet { fingerprint: &str, network: Network, address_type: AddressType, - url: &str, ) -> JsResult { let xprv = Xpriv::from_str(extended_privkey).map_err(|e| JsError::new(&e.to_string()))?; let fingerprint = Fingerprint::from_hex(fingerprint)?; @@ -105,7 +77,7 @@ impl SnapWallet { xpriv_to_descriptor(xprv, fingerprint, network.into(), address_type.into()) .map_err(|e| JsError::new(&e.to_string()))?; - Self::create(network, external_descriptor, internal_descriptor, url).await + Self::create(network, external_descriptor, internal_descriptor).await } pub async fn from_xpub( @@ -113,7 +85,6 @@ impl SnapWallet { fingerprint: &str, network: Network, address_type: AddressType, - url: &str, ) -> JsResult { let xpub = Xpub::from_str(extended_pubkey)?; let fingerprint = Fingerprint::from_hex(fingerprint)?; @@ -122,26 +93,19 @@ impl SnapWallet { xpub_to_descriptor(xpub, fingerprint, network.into(), address_type.into()) .map_err(|e| JsError::new(&e.to_string()))?; - Self::create(network, external_descriptor, internal_descriptor, url).await + Self::create(network, external_descriptor, internal_descriptor).await } - pub async fn full_scan(&mut self, stop_gap: usize, parallel_requests: usize) -> JsResult<()> { - let request = self.wallet.start_full_scan(); - let update = self.client.full_scan(request, stop_gap, parallel_requests).await?; - - let now = (Date::now() / 1000.0) as u64; - self.wallet.apply_update_at(update, Some(now))?; - - Ok(()) + pub fn start_full_scan(&self) -> FullScanRequest { + self.wallet.start_full_scan().build().into() } - pub async fn sync(&mut self, parallel_requests: usize) -> JsResult<()> { - let request = self.wallet.start_sync_with_revealed_spks(); - let update = self.client.sync(request, parallel_requests).await?; - - let now = (Date::now() / 1000.0) as u64; - self.wallet.apply_update_at(update, Some(now))?; + pub fn start_sync_with_revealed_spks(&self) -> SyncRequest { + self.wallet.start_sync_with_revealed_spks().build().into() + } + pub fn apply_update_at(&mut self, update: Update, seen_at: Option) -> JsResult<()> { + self.wallet.apply_update_at(update, seen_at)?; Ok(()) } @@ -193,6 +157,10 @@ impl SnapWallet { .collect() } + pub fn latest_checkpoint(&self) -> CheckPoint { + self.wallet.latest_checkpoint().into() + } + pub async fn persist(&mut self) -> JsResult { self.wallet.persist_async(&mut self.persister).await.map_err(Into::into) } From d92eccaee5cec90fa86b2b8161e53c904621f087 Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Thu, 12 Dec 2024 16:11:07 +0100 Subject: [PATCH 21/27] apply_update --- src/bitcoin/wallet.rs | 5 +++++ tests/esplora.rs | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/bitcoin/wallet.rs b/src/bitcoin/wallet.rs index cc0066a..ad2f0b0 100644 --- a/src/bitcoin/wallet.rs +++ b/src/bitcoin/wallet.rs @@ -2,6 +2,7 @@ use std::str::FromStr; use bdk_wallet::{chain::Merge, descriptor::IntoWalletDescriptor, ChangeSet, Wallet as BdkWallet}; use bitcoin::bip32::{Fingerprint, Xpriv, Xpub}; +use js_sys::Date; use serde_wasm_bindgen::{from_value, to_value}; use wasm_bindgen::{prelude::wasm_bindgen, JsError, JsValue}; @@ -98,6 +99,10 @@ impl Wallet { self.wallet.start_sync_with_revealed_spks().build().into() } + pub fn apply_update(&mut self, update: Update) -> JsResult<()> { + self.apply_update_at(update, Some((Date::now() / 1000.0) as u64)) + } + pub fn apply_update_at(&mut self, update: Update, seen_at: Option) -> JsResult<()> { self.wallet.apply_update_at(update, seen_at)?; Ok(()) diff --git a/tests/esplora.rs b/tests/esplora.rs index c4ce039..74667b2 100644 --- a/tests/esplora.rs +++ b/tests/esplora.rs @@ -45,9 +45,7 @@ async fn test_esplora_client() { .full_scan(full_scan_request, STOP_GAP, PARALLEL_REQUESTS) .await .expect("full_scan"); - wallet - .apply_update_at(update, Some((Date::now() / 1000.0) as u64)) - .expect("full_scan apply_update_at"); + wallet.apply_update(update).expect("full_scan apply_update_at"); let fullscan_block_height = wallet.latest_checkpoint().height(); assert!(fullscan_block_height > 0); From 4cd23ef373219da28aa5362292bacf16407b400d Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Thu, 12 Dec 2024 16:31:18 +0100 Subject: [PATCH 22/27] try using --locked --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0ef7cc..9102bb2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,13 +33,13 @@ jobs: - name: Build run: | if [ "${{ matrix.features }}" = "all" ]; then - wasm-pack build --all-features + wasm-pack build --all-features -- --locked else - wasm-pack build --features ${{ matrix.features }} + wasm-pack build --features ${{ matrix.features }} -- --locked fi - name: Test if: ${{ matrix.features != 'all' }} - run: wasm-pack test --chrome --firefox --headless --features ${{ matrix.features }} + run: wasm-pack test --chrome --firefox --headless --features ${{ matrix.features }} -- --locked lint: name: Lint (fmt + clippy) From 7b8210be21497e0bb0e412363af11d50dd20a20e Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Thu, 12 Dec 2024 16:37:18 +0100 Subject: [PATCH 23/27] add locked --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9102bb2..18cce8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,4 +57,4 @@ jobs: - name: Check formatting run: cargo fmt --all -- --config format_code_in_doc_comments=true --check - name: Run Clippy - run: cargo clippy --all-features --all-targets -- -D warnings + run: cargo clippy --all-features --all-targets -- --locked -D warnings From ed33bbe1696e617317b1a4c84ec1efb1facc38cd Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Thu, 12 Dec 2024 17:00:47 +0100 Subject: [PATCH 24/27] move locked --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18cce8b..ef30904 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,13 +33,13 @@ jobs: - name: Build run: | if [ "${{ matrix.features }}" = "all" ]; then - wasm-pack build --all-features -- --locked + wasm-pack build --locked --all-features else - wasm-pack build --features ${{ matrix.features }} -- --locked + wasm-pack build --locked --features ${{ matrix.features }} fi - name: Test if: ${{ matrix.features != 'all' }} - run: wasm-pack test --chrome --firefox --headless --features ${{ matrix.features }} -- --locked + run: wasm-pack test --locked --chrome --firefox --headless --features ${{ matrix.features }} lint: name: Lint (fmt + clippy) @@ -57,4 +57,4 @@ jobs: - name: Check formatting run: cargo fmt --all -- --config format_code_in_doc_comments=true --check - name: Run Clippy - run: cargo clippy --all-features --all-targets -- --locked -D warnings + run: cargo clippy --locked --all-features --all-targets -- -D warnings From 42b43a4e8224b2818631ed76531fadc7a56dd610 Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Thu, 12 Dec 2024 17:06:36 +0100 Subject: [PATCH 25/27] push the .lock file --- .gitignore | 1 - Cargo.lock | 2249 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2249 insertions(+), 1 deletion(-) create mode 100644 Cargo.lock diff --git a/.gitignore b/.gitignore index f55087a..3ca7a41 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ /target **/*.rs.bk -Cargo.lock /.vscode .idea *.swp diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..5f791ae --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2249 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "ahash" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0453232ace82dee0dd0b4c87a59bd90f7b53b314f3e0f61fe2ee7c8a16482289" + +[[package]] +name = "anyhow" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" +dependencies = [ + "async-channel 2.3.1", + "async-executor", + "async-io", + "async-lock", + "blocking", + "futures-lite", + "once_cell", +] + +[[package]] +name = "async-io" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" +dependencies = [ + "async-lock", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener 5.3.1", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-std" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c634475f29802fde2b8f0b505b1bd00dfe4df7d4a000f0b36f7671197d5c3615" +dependencies = [ + "async-channel 1.9.0", + "async-global-executor", + "async-io", + "async-lock", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "base58ck" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c8d66485a3a2ea485c1913c4572ce0256067a5377ac8c75c4960e1cda98605f" +dependencies = [ + "bitcoin-internals 0.3.0", + "bitcoin_hashes 0.14.0", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "bdk_chain" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bee1fe68ec0015bce2e4c1754ebbf18d70750a1f0103e3785d34e8959fe8fd7" +dependencies = [ + "bdk_core", + "bitcoin", + "miniscript", + "serde", +] + +[[package]] +name = "bdk_core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be5e187ee33d5f99f1997a700cc1dfa0524fd1de31e6414c612c9e89ccdaa133" +dependencies = [ + "bitcoin", + "hashbrown 0.9.1", + "serde", +] + +[[package]] +name = "bdk_esplora" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcae78230aedb46d07f7fa68e5082504111687d9df0e384c14dbf17d8cfa405a" +dependencies = [ + "async-trait", + "bdk_core", + "esplora-client", + "futures", +] + +[[package]] +name = "bdk_wallet" +version = "1.0.0-beta.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "627ad309b5dc5adec0491141d40fcb8d032209c373dd47a870c702e9e5eba36a" +dependencies = [ + "bdk_chain", + "bip39", + "bitcoin", + "miniscript", + "rand_core", + "serde", + "serde_json", +] + +[[package]] +name = "bdk_wasm" +version = "0.1.0" +dependencies = [ + "anyhow", + "bdk_core", + "bdk_esplora", + "bdk_wallet", + "bitcoin", + "console_error_panic_hook", + "getrandom", + "js-sys", + "miniscript", + "ring", + "rmp-serde", + "serde", + "serde-wasm-bindgen", + "thiserror 2.0.4", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test", + "web-sys", +] + +[[package]] +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "bip39" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33415e24172c1b7d6066f6d999545375ab8e1d95421d6784bdfff9496f292387" +dependencies = [ + "bitcoin_hashes 0.13.0", + "serde", + "unicode-normalization", +] + +[[package]] +name = "bitcoin" +version = "0.32.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6bc65742dea50536e35ad42492b234c27904a27f0abdcbce605015cb4ea026" +dependencies = [ + "base58ck", + "base64", + "bech32", + "bitcoin-internals 0.3.0", + "bitcoin-io", + "bitcoin-units", + "bitcoin_hashes 0.14.0", + "hex-conservative 0.2.1", + "hex_lit", + "secp256k1", + "serde", +] + +[[package]] +name = "bitcoin-internals" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" + +[[package]] +name = "bitcoin-internals" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bdbe14aa07b06e6cfeffc529a1f099e5fbe249524f8125358604df99a4bed2" +dependencies = [ + "serde", +] + +[[package]] +name = "bitcoin-io" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" + +[[package]] +name = "bitcoin-units" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5285c8bcaa25876d07f37e3d30c303f2609179716e11d688f51e8f1fe70063e2" +dependencies = [ + "bitcoin-internals 0.3.0", + "serde", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals 0.2.0", + "hex-conservative 0.1.2", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" +dependencies = [ + "bitcoin-io", + "hex-conservative 0.2.1", + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "blocking" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +dependencies = [ + "async-channel 2.3.1", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" + +[[package]] +name = "cc" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "esplora-client" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23be31c97b2e505ac6af0d72a201caead71298a957639061a10314f6d4860cd7" +dependencies = [ + "async-std", + "bitcoin", + "hex-conservative 0.2.1", + "log", + "reqwest", + "serde", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "5.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" +dependencies = [ + "event-listener 5.3.1", + "pin-project-lite", +] + +[[package]] +name = "fastrand" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-lite" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "gloo-timers" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +dependencies = [ + "ahash", + "serde", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + +[[package]] +name = "hex-conservative" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" + +[[package]] +name = "hex-conservative" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "hex_lit" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd" + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] + +[[package]] +name = "ipnet" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "js-sys" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + +[[package]] +name = "libc" +version = "0.2.167" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +dependencies = [ + "value-bag", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minicov" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27fe9f1cc3c22e1687f9446c2083c4c5fc7f0bcf1c7a86bdbded14985895b4b" +dependencies = [ + "cc", + "walkdir", +] + +[[package]] +name = "miniscript" +version = "12.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bd3c9608217b0d6fa9c9c8ddd875b85ab72bd4311cfc8db35e1b5a08fc11f4d" +dependencies = [ + "bech32", + "bitcoin", + "serde", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.52.0", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.36.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "openssl" +version = "0.10.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project-lite" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "piper" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + +[[package]] +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "polling" +version = "3.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tokio-socks", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustix" +version = "0.38.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +dependencies = [ + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "secp256k1" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" +dependencies = [ + "bitcoin_hashes 0.14.0", + "rand", + "secp256k1-sys", + "serde", +] + +[[package]] +name = "secp256k1-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +dependencies = [ + "cc", +] + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.6.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.215" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.215" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.133" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "syn" +version = "2.0.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +dependencies = [ + "cfg-if", + "fastrand", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" +dependencies = [ + "thiserror-impl 2.0.4", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-socks" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d4770b8024672c1101b3f6733eab95b18007dbe0847a8afe341fcf79e06043f" +dependencies = [ + "either", + "futures-util", + "thiserror 1.0.69", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "value-bag" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" + +[[package]] +name = "wasm-bindgen-test" +version = "0.3.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d44563646eb934577f2772656c7ad5e9c90fac78aa8013d776fcdaf24625d" +dependencies = [ + "js-sys", + "minicov", + "scoped-tls", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test-macro", +] + +[[package]] +name = "wasm-bindgen-test-macro" +version = "0.3.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54171416ce73aa0b9c377b51cc3cb542becee1cd678204812e8392e5b0e4a031" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "web-sys" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] From 33652d10e27932120e17787582273eb4fbe3168f Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Thu, 12 Dec 2024 17:14:10 +0100 Subject: [PATCH 26/27] test by removing locked --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef30904..e0ef7cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,13 +33,13 @@ jobs: - name: Build run: | if [ "${{ matrix.features }}" = "all" ]; then - wasm-pack build --locked --all-features + wasm-pack build --all-features else - wasm-pack build --locked --features ${{ matrix.features }} + wasm-pack build --features ${{ matrix.features }} fi - name: Test if: ${{ matrix.features != 'all' }} - run: wasm-pack test --locked --chrome --firefox --headless --features ${{ matrix.features }} + run: wasm-pack test --chrome --firefox --headless --features ${{ matrix.features }} lint: name: Lint (fmt + clippy) @@ -57,4 +57,4 @@ jobs: - name: Check formatting run: cargo fmt --all -- --config format_code_in_doc_comments=true --check - name: Run Clippy - run: cargo clippy --locked --all-features --all-targets -- -D warnings + run: cargo clippy --all-features --all-targets -- -D warnings From aa6a41221652bd375dc68402a61c5330ea3a3712 Mon Sep 17 00:00:00 2001 From: Dario Anongba Varela Date: Fri, 13 Dec 2024 10:42:41 +0100 Subject: [PATCH 27/27] improve test Co-authored-by: River Kanies --- tests/esplora.rs | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/tests/esplora.rs b/tests/esplora.rs index 74667b2..5baf6b1 100644 --- a/tests/esplora.rs +++ b/tests/esplora.rs @@ -4,22 +4,20 @@ extern crate wasm_bindgen_test; -use bdk_wallet::bip39::Mnemonic; use bdk_wasm::{ bitcoin::{EsploraClient, Wallet}, set_panic_hook, - types::{AddressType, KeychainKind, Network}, + types::{KeychainKind, Network}, }; -use js_sys::Date; use wasm_bindgen_test::*; wasm_bindgen_test_configure!(run_in_browser); const STOP_GAP: usize = 5; const PARALLEL_REQUESTS: usize = 1; -const NETWORK: Network = Network::Testnet; -const ADDRESS_TYPE: AddressType = AddressType::P2wpkh; -const MNEMONIC: &str = "journey embrace permit coil indoor stereo welcome maid movie easy clock spider tent slush bright luxury awake waste legal modify awkward answer acid goose"; +const NETWORK: Network = Network::Signet; +const EXTERNAL_DESC: &str = "wpkh([aafa6322/84'/1'/0']tpubDCfvzhCuifJtWDVdrBcPvZU7U5uyixL7QULk8hXA7KjqiNnry9Te1nwm7yStqenPCQhy5MwzxKkLBD2GmKNgvMYqXgo53iYqQ7Vu4vQbN2N/0/*)#mlua264t"; +const INTERNAL_DESC: &str = "wpkh([aafa6322/84'/1'/0']tpubDCfvzhCuifJtWDVdrBcPvZU7U5uyixL7QULk8hXA7KjqiNnry9Te1nwm7yStqenPCQhy5MwzxKkLBD2GmKNgvMYqXgo53iYqQ7Vu4vQbN2N/1/*)#2teuh09n"; #[wasm_bindgen_test] async fn test_esplora_client() { @@ -33,23 +31,13 @@ async fn test_esplora_client() { Network::Regtest => "https://localhost:3000", }; - let seed = Mnemonic::parse(MNEMONIC).unwrap().to_seed(""); - let mut wallet = Wallet::from_seed(&seed, NETWORK, ADDRESS_TYPE).expect("wallet"); + let mut wallet = + Wallet::from_descriptors(NETWORK, EXTERNAL_DESC.to_string(), INTERNAL_DESC.to_string()).expect("wallet"); let mut blockchain_client = EsploraClient::new(esplora_url).expect("esplora_client"); let block_height = wallet.latest_checkpoint().height(); assert_eq!(block_height, 0); - let full_scan_request = wallet.start_full_scan(); - let update = blockchain_client - .full_scan(full_scan_request, STOP_GAP, PARALLEL_REQUESTS) - .await - .expect("full_scan"); - wallet.apply_update(update).expect("full_scan apply_update_at"); - - let fullscan_block_height = wallet.latest_checkpoint().height(); - assert!(fullscan_block_height > 0); - wallet.reveal_addresses_to(KeychainKind::External, 5); let sync_request = wallet.start_sync_with_revealed_spks(); @@ -57,11 +45,18 @@ async fn test_esplora_client() { .sync(sync_request, PARALLEL_REQUESTS) .await .expect("sync"); - wallet - .apply_update_at(update, Some((Date::now() / 1000.0) as u64)) - .expect("sync apply_update_at"); + wallet.apply_update(update).expect("sync apply_update"); - // TODO: Find a better way to assert that the sync was successful let sync_block_height = wallet.latest_checkpoint().height(); - assert!(sync_block_height >= fullscan_block_height); + assert!(sync_block_height > block_height); + + let full_scan_request = wallet.start_full_scan(); + let update = blockchain_client + .full_scan(full_scan_request, STOP_GAP, PARALLEL_REQUESTS) + .await + .expect("full_scan"); + wallet.apply_update(update).expect("full_scan apply_update"); + + let balance = wallet.balance(); + assert!(balance.total().to_sat() > 0); }