From 3465513c1ebfde2fd35d7a29a748f771f2a9bb0e Mon Sep 17 00:00:00 2001 From: Vihiga Tyonum Date: Wed, 24 Jun 2026 20:10:27 +0100 Subject: [PATCH] ref(verbose): Drop `verbose` flag from tests --- src/handlers/config.rs | 1 - src/handlers/offline.rs | 4 +++- src/main.rs | 12 +++++++++--- tests/cli.rs | 2 +- tests/common/mod.rs | 6 ------ 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/handlers/config.rs b/src/handlers/config.rs index f3b1772..5564969 100644 --- a/src/handlers/config.rs +++ b/src/handlers/config.rs @@ -95,7 +95,6 @@ impl AppCommand> 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")] diff --git a/src/handlers/offline.rs b/src/handlers/offline.rs index 96e23cf..fc2e087 100644 --- a/src/handlers/offline.rs +++ b/src/handlers/offline.rs @@ -311,6 +311,8 @@ impl AppCommand>> for CreateTxCommand { let psbt = tx_builder.finish()?; + // let psbt_base64 = BASE64_STANDARD.encode(psbt.serialize()); + Ok(PsbtResult::new(&psbt, Some(false))) } } @@ -761,7 +763,7 @@ impl AppCommand>> for CombinePsbtCommand { Ok(acc) })?; - Ok(PsbtResult::new(&final_psbt, None)) + Ok(PsbtResult::new(&final_psbt, Some(false))) } } diff --git a/src/main.rs b/src/main.rs index a79492e..06e3ea2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,7 +29,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() { @@ -199,8 +199,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); diff --git a/tests/cli.rs b/tests/cli.rs index 1e06133..8f59717 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -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, diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 19be698..4322016 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -19,7 +19,6 @@ use std::path::PathBuf; pub struct BdkCli { pub network: String, pub datadir: Option, - pub verbosity: bool, pub recv_desc: Option, pub change_desc: Option, pub server_url: Option, @@ -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); } -- 2.49.0