@@ -47,20 +47,10 @@ use bdk_wallet::{
4747use cli_table:: { Cell , CellStruct , Style , Table , format:: Justify } ;
4848use serde_json:: json;
4949#[ cfg( feature = "cbf" ) ]
50- use {
51- crate :: utils:: BlockchainClient :: KyotoClient ,
52- bdk_kyoto:: { Info , LightClient } ,
53- tokio:: select,
54- } ;
50+ use { crate :: utils:: BlockchainClient :: KyotoClient , bdk_kyoto:: LightClient , tokio:: select} ;
5551
5652#[ cfg( feature = "electrum" ) ]
5753use crate :: utils:: BlockchainClient :: Electrum ;
58- #[ cfg( feature = "cbf" ) ]
59- use bdk_kyoto:: LightClient ;
60- #[ cfg( feature = "compiler" ) ]
61- use bdk_wallet:: bitcoin:: XOnlyPublicKey ;
62- use bdk_wallet:: bitcoin:: base64:: prelude:: * ;
63- use serde_json:: Value ;
6454use std:: collections:: BTreeMap ;
6555#[ cfg( any( feature = "electrum" , feature = "esplora" ) ) ]
6656use std:: collections:: HashSet ;
@@ -1352,44 +1342,23 @@ pub fn handle_descriptor_subcommand(
13521342 pretty : bool ,
13531343) -> Result < String , Error > {
13541344 let result = match subcommand {
1355- DescriptorSubCommand :: Generate {
1356- r#type,
1357- multipath,
1358- key,
1359- } => {
1360- let descriptor_type = DescriptorType :: from_bip32_num ( r#type)
1361- . ok_or_else ( || Error :: Generic ( format ! ( "Unsupported script type: {type}" ) ) ) ?;
1362-
1363- match ( multipath, key) {
1364- // generate multipath descriptors with a key
1365- ( true , Some ( key) ) => {
1366- if is_mnemonic ( & key) {
1367- return Err ( Error :: Generic (
1368- "Mnemonic not supported for multipath descriptors" . to_string ( ) ,
1369- ) ) ;
1370- }
1371- generate_descriptors ( descriptor_type, & key, true )
1372- }
1345+ DescriptorSubCommand :: Generate { desc_type, key } => {
1346+ match key {
13731347 // generate descriptors with a key or mnemonic
1374- ( false , Some ( key) ) => {
1348+ Some ( key) => {
13751349 if is_mnemonic ( & key) {
1376- generate_descriptor_from_mnemonic_string ( & key, network, descriptor_type )
1350+ generate_descriptor_from_mnemonic ( & key, network, & desc_type )
13771351 } else {
1378- generate_descriptors ( descriptor_type , & key, false )
1352+ generate_descriptors ( & desc_type , & key, network )
13791353 }
13801354 }
13811355 // Generate new mnemonic and descriptors
1382- ( false , None ) => generate_new_descriptor_with_mnemonic ( network, descriptor_type) ,
1383- // Invalid case
1384- ( true , None ) => Err ( Error :: Generic (
1385- "A key is required for multipath descriptors" . to_string ( ) ,
1386- ) ) ,
1356+ None => generate_descriptor_with_mnemonic ( network, & desc_type) ,
13871357 }
13881358 }
13891359 } ?;
13901360 format_descriptor_output ( & result, pretty)
13911361}
1392-
13931362#[ cfg( any(
13941363 feature = "electrum" ,
13951364 feature = "esplora" ,
0 commit comments