11use crate :: { commands:: WalletOpts , config:: WalletConfig , error:: BDKCliError as Error } ;
2- // #[cfg(feature = "bip322")]
3- // use bdk_bip322::SignatureFormat;
42#[ cfg( feature = "cbf" ) ]
53use bdk_kyoto:: { Info , Receiver , UnboundedReceiver , Warning } ;
4+ #[ cfg( feature = "bip322" ) ]
5+ use bdk_message_signer:: SignatureFormat ;
66#[ cfg( feature = "silent-payments" ) ]
77use bdk_sp:: encoding:: SilentPaymentCode ;
88use bdk_wallet:: bitcoin:: { Address , Network , OutPoint , ScriptBuf } ;
@@ -197,20 +197,20 @@ pub(crate) fn parse_sp_code_value_pairs(s: &str) -> Result<(SilentPaymentCode, u
197197 Ok ( ( key, value) )
198198}
199199
200- // // / Function to parse the signature format from a string
201- // #[cfg(feature = "bip322")]
202- // pub(crate) fn parse_signature_format(format_str: &str) -> Result<SignatureFormat, Error> {
203- // match format_str.to_lowercase().as_str() {
204- // "legacy" => Ok(SignatureFormat::Legacy),
205- // "simple" => Ok(SignatureFormat::Simple),
206- // "full" => Ok(SignatureFormat::Full),
207- // "fullproofoffunds" => Ok(SignatureFormat::FullProofOfFunds),
208- // _ => Err(Error::Generic(
209- // "Invalid signature format. Use 'legacy', 'simple', 'full', or 'fullproofoffunds'"
210- // .to_string(),
211- // )),
212- // }
213- // }
200+ /// Function to parse the signature format from a string
201+ #[ cfg( feature = "bip322" ) ]
202+ pub ( crate ) fn parse_signature_format ( format_str : & str ) -> Result < SignatureFormat , Error > {
203+ match format_str. to_lowercase ( ) . as_str ( ) {
204+ "legacy" => Ok ( SignatureFormat :: Legacy ) ,
205+ "simple" => Ok ( SignatureFormat :: Simple ) ,
206+ "full" => Ok ( SignatureFormat :: Full ) ,
207+ "fullproofoffunds" => Ok ( SignatureFormat :: FullProofOfFunds ) ,
208+ _ => Err ( Error :: Generic (
209+ "Invalid signature format. Use 'legacy', 'simple', 'full', or 'fullproofoffunds'"
210+ . to_string ( ) ,
211+ ) ) ,
212+ }
213+ }
214214
215215pub fn command_requires_db ( command : & OfflineWalletSubCommand ) -> bool {
216216 match command {
@@ -232,11 +232,11 @@ pub fn command_requires_db(command: &OfflineWalletSubCommand) -> bool {
232232 | OfflineWalletSubCommand :: FinalizePsbt ( _)
233233 | OfflineWalletSubCommand :: CombinePsbt ( _) => false ,
234234
235- // #[cfg(feature = "bip322")]
236- // OfflineWalletSubCommand::SignMessage(_) => true,
235+ #[ cfg( feature = "bip322" ) ]
236+ OfflineWalletSubCommand :: SignMessage ( _) => true ,
237237
238- // #[cfg(feature = "bip322")]
239- // OfflineWalletSubCommand::VerifyMessage(_) => true,
238+ #[ cfg( feature = "bip322" ) ]
239+ OfflineWalletSubCommand :: VerifyMessage ( _) => true ,
240240 #[ cfg( feature = "silent-payments" ) ]
241241 OfflineWalletSubCommand :: CreateSpTx ( _) => true ,
242242 #[ cfg( feature = "dns_payment" ) ]
0 commit comments