]> Untitled Git - bdk-cli/commitdiff
feat(hwi): Add hidapi to workflows
authorVihiga Tyonum <withtvpeter@gmail.com>
Mon, 3 Aug 2026 16:38:10 +0000 (17:38 +0100)
committerVihiga Tyonum <withtvpeter@gmail.com>
Mon, 19 Oct 2026 09:24:07 +0000 (10:24 +0100)
- add hidapi dependencies to workflows to fix
failing compilation

.github/workflows/code_coverage.yml
.github/workflows/cont_integration.yml
Cargo.lock
Cargo.toml
src/handlers/offline.rs
src/utils/hwi.rs

index 55e9dfdb34ac94a05b4a15ba39b67dfcedde1aed..16240530a40834c2a8e31ebabd28ad12e4733619 100644 (file)
@@ -16,6 +16,10 @@ jobs:
         uses: actions/checkout@v7
         with:
           persist-credentials: false
+      - name: Install system dependencies
+        run: |
+          sudo apt-get update
+          sudo apt-get install -y libudev-dev libusb-1.0-0-dev pkg-config
       - name: Install Rust toolchain
         uses: actions-rust-lang/setup-rust-toolchain@v2
         with:
index cf299408fdf91f5c227cd87ca8c6cb9d164eed73..b87c7e5b32a6ffd8fbdc2166fcff8970284f0a97 100644 (file)
@@ -22,6 +22,10 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v7
+      - name: Install system dependencies
+        run: |
+          sudo apt-get update
+          sudo apt-get install -y libudev-dev libusb-1.0-0-dev pkg-config
       - name: Setup Rust Toolchain
         uses: actions-rust-lang/setup-rust-toolchain@v2
         with:
@@ -45,7 +49,10 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v7
-      
+      - name: Install system dependencies
+        run: |
+          sudo apt-get update
+          sudo apt-get install -y libudev-dev libusb-1.0-0-dev pkg-config
       - name: Install Rust toolchain
         uses: actions-rust-lang/setup-rust-toolchain@v2
         with:
index 5c55509e8ac244387d38437a54ff31eb4bd5be31..25baa30c54aab203a465c9789abdb3dc25ef8f22 100644 (file)
@@ -3447,7 +3447,7 @@ dependencies = [
  "quinn-udp",
  "rustc-hash",
  "rustls 0.23.45",
- "socket2",
+ "socket2 0.5.10",
  "thiserror 2.0.18",
  "tokio",
  "tracing",
index ab7118e97a1ed7e836b0f026923ed7324b7961b1..d5f37680c58e6e2bf04d536eb0dc2e4e8f88fdd5 100644 (file)
@@ -40,7 +40,7 @@ reqwest = { version = "0.13.2", default-features = false, features = ["rustls"],
 url = { version = "2.5.8", optional = true }
 bdk_message_signer = { version = "0.2.0", optional = true }
 bitcoin-payment-instructions = { version = "0.7.0", optional = true}
-async-hwi = { version = "0.0.32", features = ["specter", "coldcard", "ledger", "jade", "bitbox", "services"], optional = true}
+async-hwi = { version = "0.0.32", features = ["specter", "coldcard", "ledger", "jade", "bitbox", "service"], optional = true}
 
 [features]
 default = ["repl", "sqlite"]
index 6f86ca3a7ee40a9ccda2340823ce770fe6d689bc..971d68e7e92dabe1b97c1375945643bf791411ef 100644 (file)
@@ -42,7 +42,6 @@ const DEFAULT_OFFLINE_SIGNER: bool = true;
 #[cfg(not(feature = "hwi"))]
 const DEFAULT_OFFLINE_SIGNER: bool = false;
 
-
 impl OfflineWalletSubCommand {
     pub fn execute(&self, ctx: &mut AppContext<OfflineOperations<'_>>) -> Result<(), Error> {
         match self {
@@ -551,7 +550,7 @@ pub struct BumpFeeCommand {
     pub shrink_address: Option<Address>,
 
     /// Make a PSBT that can be signed by offline signers and hardware wallets. Forces the addition of `non_witness_utxo` and more details to let the signer identify the change output.
-    #[arg(long = "offline_signer", default_value_t = DEFAULT_OFFLINE_SIGNER))]
+    #[arg(long = "offline_signer", default_value_t = DEFAULT_OFFLINE_SIGNER)]
     pub offline_signer: bool,
 
     /// Selects which utxos *must* be added to the tx. Unconfirmed utxos cannot be used.
index 81e48c27b7ac1a42245a4c44564a85c99b5214fa..987784508cdcb68b844bcc522b86be8c094d2cc0 100644 (file)
@@ -57,11 +57,11 @@ pub async fn enumerate_hwi_devices(
                 let device = device.with_network(network);
                 match device.get_info().await {
                     Ok(info) => {
-                        if info.jade_state == jade::api::JadeState::Locked {
-                            if let Err(e) = device.auth().await {
-                                warn!("Jade authentication failed: {e:?}");
-                                continue;
-                            }
+                        if info.jade_state == jade::api::JadeState::Locked
+                            && let Err(e) = device.auth().await
+                        {
+                            warn!("Jade authentication failed: {e:?}");
+                            continue;
                         }
                         devices.push(device.into());
                     }
@@ -82,38 +82,33 @@ pub async fn enumerate_hwi_devices(
 
     for device_info in api.device_list() {
         // BitBox02
-        if async_hwi::bitbox::is_bitbox02(device_info) {
-            if let Ok(handle) = device_info.open_device(&api) {
-                if let Ok(pairing) =
-                    PairingBitbox02WithLocalCache::<runtime::TokioRuntime>::connect(handle, None)
-                        .await
-                {
-                    if let Ok((device, _)) = pairing.wait_confirm().await {
-                        let mut bb02 = BitBox02::from(device).with_network(network);
-                        if let Some(policy) = wallet.policy {
-                            bb02 = bb02.with_policy(policy).map_err(map_device_err)?;
-                        }
-                        devices.push(bb02.into());
-                    }
-                }
+        if async_hwi::bitbox::is_bitbox02(device_info)
+            && let Ok(handle) = device_info.open_device(&api)
+            && let Ok(pairing) =
+                PairingBitbox02WithLocalCache::<runtime::TokioRuntime>::connect(handle, None).await
+            && let Ok((device, _)) = pairing.wait_confirm().await
+        {
+            let mut bb02 = BitBox02::from(device).with_network(network);
+            if let Some(policy) = wallet.policy {
+                bb02 = bb02.with_policy(policy).map_err(map_device_err)?;
             }
+            devices.push(bb02.into());
         }
 
         // Coldcard
         if device_info.vendor_id() == coldcard::api::COINKITE_VID
             && device_info.product_id() == coldcard::api::CKCC_PID
+            && let Some(sn) = device_info.serial_number()
         {
-            if let Some(sn) = device_info.serial_number() {
-                match coldcard::api::Coldcard::open(&api, sn, None) {
-                    Ok((cc, _)) => {
-                        let mut hw = coldcard::Coldcard::from(cc);
-                        if let Some(name) = wallet.name {
-                            hw = hw.with_wallet_name(name.to_string());
-                        }
-                        devices.push(hw.into());
+            match coldcard::api::Coldcard::open(&api, sn, None) {
+                Ok((cc, _)) => {
+                    let mut hw = coldcard::Coldcard::from(cc);
+                    if let Some(name) = wallet.name {
+                        hw = hw.with_wallet_name(name.to_string());
                     }
-                    Err(e) => warn!("Failed to open Coldcard (SN {sn}): {e:?}"),
+                    devices.push(hw.into());
                 }
+                Err(e) => warn!("Failed to open Coldcard (SN {sn}): {e:?}"),
             }
         }
     }