From: Vihiga Tyonum Date: Sun, 5 Jul 2026 02:37:46 +0000 (+0100) Subject: feat(sp): fix command_requires_db fn match arm X-Git-Tag: v4.0.0~8^2~5 X-Git-Url: http://internal-gitweb-vhost/blockdata/script/encode/-script/ui-kit/FromScriptException.UnrecognizedScript.html?a=commitdiff_plain;h=b3fe86098e6b35e5280a715e0ff2902161975c4b;p=bdk-cli feat(sp): fix command_requires_db fn match arm --- diff --git a/src/handlers/descriptor.rs b/src/handlers/descriptor.rs index 1c949cd..e52863a 100644 --- a/src/handlers/descriptor.rs +++ b/src/handlers/descriptor.rs @@ -112,9 +112,10 @@ impl AppCommand> for CompileCommand { .map_err(|e| Error::Generic(format!("Invalid NUMS key: {e}")))?; let nums_point = PublicKey::from_x_only_public_key(nums_key, Parity::Even); - let internal_key_point = nums_point - .add_exp_tweak(&secp, &Scalar::from(r_secret)) - .map_err(|e| Error::Generic(format!("Failed to tweak NUMS key: {e}")))?; + let internal_key_point = + nums_point + .add_exp_tweak(&secp, &Scalar::from(r_secret)) + .map_err(|e| Error::Generic(format!("Failed to tweak NUMS key: {e}")))?; let (xonly_internal_key, _) = internal_key_point.x_only_public_key(); let tree = TapTree::Leaf(Arc::new(taproot_policy)); diff --git a/src/handlers/online.rs b/src/handlers/online.rs index 885fd61..f520451 100644 --- a/src/handlers/online.rs +++ b/src/handlers/online.rs @@ -16,6 +16,8 @@ use { #[cfg(any(feature = "electrum", feature = "esplora"))] use {bdk_wallet::KeychainKind, std::collections::HashSet, std::io::Write}; +#[cfg(any(feature = "electrum", feature = "esplora", feature = "rpc"))] +use crate::utils::print_wallet_events; #[cfg(any( feature = "electrum", feature = "esplora", @@ -35,8 +37,6 @@ use { consensus::Decodable, hex::FromHex, }, }; -#[cfg(any(feature = "electrum", feature = "esplora", feature = "rpc"))] -use crate::utils::print_wallet_events; #[cfg(any( feature = "electrum", feature = "esplora", diff --git a/src/handlers/repl.rs b/src/handlers/repl.rs index a93b2f5..c2a5ae8 100644 --- a/src/handlers/repl.rs +++ b/src/handlers/repl.rs @@ -7,11 +7,14 @@ use { clap::Parser, }; -#[cfg(any( - feature = "electrum", - feature = "esplora", - feature = "rpc", - feature = "cbf" +#[cfg(all( + feature = "repl", + any( + feature = "electrum", + feature = "esplora", + feature = "rpc", + feature = "cbf" + ) ))] use crate::client::BlockchainClient; #[cfg(feature = "repl")] diff --git a/src/utils/common.rs b/src/utils/common.rs index 4a2fad5..8a4089a 100644 --- a/src/utils/common.rs +++ b/src/utils/common.rs @@ -5,6 +5,7 @@ use bdk_bip322::SignatureFormat; use bdk_kyoto::{Info, Receiver, UnboundedReceiver, Warning}; #[cfg(feature = "silent-payments")] use bdk_sp::encoding::SilentPaymentCode; +use bdk_wallet::bitcoin::{Address, Network, OutPoint, ScriptBuf}; #[cfg(any( feature = "electrum", feature = "esplora", @@ -12,7 +13,6 @@ use bdk_sp::encoding::SilentPaymentCode; feature = "rpc" ))] use bdk_wallet::{bitcoin::Psbt, event::WalletEvent}; -use bdk_wallet::bitcoin::{Address, Network, OutPoint, ScriptBuf}; use crate::commands::OfflineWalletSubCommand; use std::{ @@ -240,9 +240,9 @@ pub fn command_requires_db(command: &OfflineWalletSubCommand) -> bool { OfflineWalletSubCommand::SignMessage(_) => true, #[cfg(feature = "bip322")] - OfflineWalletSubCommand::VerifyMessage(_) => false, + OfflineWalletSubCommand::VerifyMessage(_) => true, #[cfg(feature = "silent-payments")] - OfflineWalletSubCommand::CreateSpTx(_) => false, + OfflineWalletSubCommand::CreateSpTx(_) => true, } }