]> Untitled Git - bdk-cli/commitdiff
ref(verbose): Dropped `verbose` flag from tests
authorVihiga Tyonum <withtvpeter@gmail.com>
Wed, 24 Jun 2026 19:10:27 +0000 (20:10 +0100)
committerVihiga Tyonum <withtvpeter@gmail.com>
Wed, 24 Jun 2026 19:10:27 +0000 (20:10 +0100)
src/commands.rs
src/config.rs
src/handlers/config.rs
src/handlers/offline.rs
src/main.rs
src/utils/types.rs
tests/cli.rs
tests/common/mod.rs

index d5ae053fd8d976782750c6d1354d36d1dd2ae118..ac35877e0c702f3aa014cc2f1c4d833e759b0053 100644 (file)
@@ -223,9 +223,6 @@ pub struct WalletOpts {
     /// Selects the wallet to use.
     #[arg(skip)]
     pub wallet: Option<String>,
-    /// Adds verbosity, returns PSBT in JSON format alongside serialized, displays expanded objects.
-    #[arg(env = "VERBOSE", short = 'v', long = "verbose")]
-    pub verbose: bool,
     /// Sets the descriptor to use for the external addresses.
     #[arg(env = "EXT_DESCRIPTOR", short = 'e', long, required = true)]
     pub ext_descriptor: String,
index ec6adfaa237cc6a1222e6a7ec469d89fb8d0ce4c..6865ee0915d7e65b5d3847b9007ae7eeaa0216d6 100644 (file)
@@ -117,7 +117,6 @@ impl TryFrom<&WalletConfigInner> for WalletOpts {
 
         Ok(WalletOpts {
             wallet: Some(config.wallet.clone()),
-            verbose: false,
             ext_descriptor: config.ext_descriptor.clone(),
             int_descriptor: config.int_descriptor.clone(),
 
index 3bd302c07d244d3677d4ed65cca65c2671e16ae8..8fe1c9d4c6581f9ab833bb368634401b99e766f2 100644 (file)
@@ -95,7 +95,6 @@ impl AppCommand<AppContext<Init>> for SaveConfigCommand {
             network: ctx.network.to_string(),
             ext_descriptor: self.wallet_opts.ext_descriptor.clone(),
             int_descriptor: self.wallet_opts.int_descriptor.clone(),
-
             #[cfg(any(feature = "sqlite", feature = "redb"))]
             database_type: match self.wallet_opts.database_type {
                 #[cfg(feature = "sqlite")]
index b4412301854f1b8d907387cef5a710397abc6c4e..6839b9b0988c7e9ed5ce9b002c2c86692a664841 100644 (file)
@@ -303,7 +303,7 @@ impl AppCommand<AppContext<OfflineOperations<'_>>> for CreateTxCommand {
 
         // let psbt_base64 = BASE64_STANDARD.encode(psbt.serialize());
 
-        Ok(PsbtResult::new(&psbt, false, Some(false)))
+        Ok(PsbtResult::new(&psbt, Some(false)))
     }
 }
 
@@ -594,7 +594,7 @@ impl AppCommand<AppContext<OfflineOperations<'_>>> for BumpFeeCommand {
 
         // let psbt_base64 = BASE64_STANDARD.encode(psbt.serialize());
 
-        Ok(PsbtResult::new(&psbt, false, Some(false)))
+        Ok(PsbtResult::new(&psbt, Some(false)))
     }
 }
 
@@ -662,7 +662,7 @@ impl AppCommand<AppContext<OfflineOperations<'_>>> for SignCommand {
             ..Default::default()
         };
         let finalized = wallet.sign(&mut psbt, signopt)?;
-        Ok(PsbtResult::new(&psbt, false, Some(finalized)))
+        Ok(PsbtResult::new(&psbt, Some(finalized)))
     }
 }
 
@@ -718,7 +718,7 @@ impl AppCommand<AppContext<OfflineOperations<'_>>> for FinalizePsbtCommand {
 
         let finalized = wallet.finalize_psbt(&mut psbt, signopt)?;
 
-        Ok(PsbtResult::new(&psbt, false, Some(finalized)))
+        Ok(PsbtResult::new(&psbt, Some(finalized)))
     }
 }
 
@@ -753,7 +753,7 @@ impl AppCommand<AppContext<OfflineOperations<'_>>> for CombinePsbtCommand {
                     Ok(acc)
                 })?;
 
-        Ok(PsbtResult::new(&final_psbt, false, None))
+        Ok(PsbtResult::new(&final_psbt, Some(false)))
     }
 }
 
index 3f399dc7394d1324edf8da798bc2ad764f06a4e4..261d9fec0139e408fb2cb663a0ad7b4a6aac4751 100644 (file)
@@ -34,7 +34,7 @@ use crate::handlers::{AppCommand, AppContext};
 use crate::utils::output::FormatOutput;
 use crate::utils::runtime::WalletRuntime;
 use crate::utils::{command_requires_db, prepare_home_dir};
-use clap::Parser;
+use clap::{CommandFactory, Parser};
 
 #[tokio::main]
 async fn main() {
@@ -187,8 +187,14 @@ async fn run(cli_opts: CliOpts) -> Result<(), Error> {
 
             cmd.execute(&mut ctx)?.write_out(std::io::stdout())?;
         }
-        CliSubCommand::Completions { shell: _ } => unimplemented!(),
-
+        CliSubCommand::Completions { shell } => {
+            clap_complete::generate(
+                shell,
+                &mut CliOpts::command(),
+                "bdk-cli",
+                &mut std::io::stdout(),
+            );
+        }
         #[cfg(feature = "silent-payments")]
         CliSubCommand::SilentPaymentCode(cmd) => {
             let mut ctx = AppContext::new(cli_opts.network, home_dir);
index a8e29984c1f2af500d18dca1fe6cd0470b64b9b8..99bdcbd9394b7fb02a4a8865230843f7d3cceb2b 100644 (file)
@@ -78,21 +78,13 @@ pub struct PsbtResult {
 
     #[serde(skip_serializing_if = "Option::is_none")]
     pub is_finalized: Option<bool>,
-
-    #[serde(skip_serializing_if = "Option::is_none")]
-    pub details: Option<serde_json::Value>,
 }
 
 impl PsbtResult {
-    pub fn new(psbt: &Psbt, verbose: bool, finalized: Option<bool>) -> Self {
+    pub fn new(psbt: &Psbt, finalized: Option<bool>) -> Self {
         Self {
             psbt: bdk_wallet::bitcoin::base64::prelude::BASE64_STANDARD.encode(psbt.serialize()),
             is_finalized: finalized,
-            details: if verbose {
-                Some(serde_json::to_value(psbt).unwrap_or_default())
-            } else {
-                None
-            },
         }
     }
 }
index 1e06133244a5efaad4850b4c4ee08834c0a08ad2..8f5971760e186ad9cde214117f6d6c86c84d994d 100644 (file)
@@ -552,7 +552,7 @@ mod test_offline {
         let sign_json: Value = serde_json::from_slice(&sign_output.stdout).unwrap();
         let proof = sign_json["proof"].as_str().unwrap();
 
-        // A tampered message should fail verification gracefully (valid: false)
+        // A tampered message should fail
         cli.wallet_cmd(&[
             "--wallet",
             WALLET_NAME,
index 19be69891472fdba02358024a1e06cf51f1f3e36..4322016671e39167b640d461e6f219392d7dae86 100644 (file)
@@ -19,7 +19,6 @@ use std::path::PathBuf;
 pub struct BdkCli {
     pub network: String,
     pub datadir: Option<PathBuf>,
-    pub verbosity: bool,
     pub recv_desc: Option<String>,
     pub change_desc: Option<String>,
     pub server_url: Option<String>,
@@ -31,7 +30,6 @@ impl BdkCli {
         Self {
             network: network.to_string(),
             datadir,
-            verbosity: false,
             recv_desc: None,
             change_desc: None,
             server_url: None,
@@ -48,10 +46,6 @@ impl BdkCli {
             cmd.arg("--datadir").arg(dir);
         }
 
-        if self.verbosity {
-            cmd.arg("--verbose");
-        }
-
         if let Some(url) = &self.server_url {
             cmd.arg("--server").arg(url);
         }