@@ -10,14 +10,9 @@ use std::sync::Mutex;
10
10
use anyhow:: bail;
11
11
use anyhow:: Context ;
12
12
use bdk_chain:: bitcoin:: {
13
- absolute,
14
- address:: NetworkUnchecked ,
15
- bip32, consensus, constants,
16
- hex:: DisplayHex ,
17
- relative,
18
- secp256k1:: { rand:: prelude:: * , Secp256k1 } ,
19
- transaction, Address , Amount , Network , NetworkKind , PrivateKey , Psbt , PublicKey , Sequence ,
20
- Transaction , TxIn , TxOut ,
13
+ absolute, address:: NetworkUnchecked , bip32, consensus, constants, hex:: DisplayHex , relative,
14
+ secp256k1:: Secp256k1 , transaction, Address , Amount , Network , NetworkKind , PrivateKey , Psbt ,
15
+ PublicKey , Sequence , Transaction , TxIn , TxOut ,
21
16
} ;
22
17
use bdk_chain:: miniscript:: {
23
18
descriptor:: { DescriptorSecretKey , SinglePubKey } ,
@@ -37,6 +32,7 @@ use bdk_coin_select::{
37
32
} ;
38
33
use bdk_file_store:: Store ;
39
34
use clap:: { Parser , Subcommand } ;
35
+ use rand:: prelude:: * ;
40
36
41
37
pub use anyhow;
42
38
pub use clap;
@@ -675,7 +671,7 @@ pub fn handle_commands<CS: clap::Subcommand, S: clap::Args>(
675
671
Ok ( ( ) )
676
672
}
677
673
PsbtCmd :: Sign { psbt, descriptor } => {
678
- let mut psbt = Psbt :: from_str ( & psbt. unwrap_or_default ( ) ) ?;
674
+ let mut psbt = Psbt :: from_str ( psbt. unwrap_or_default ( ) . as_str ( ) ) ?;
679
675
680
676
let desc_str = match descriptor {
681
677
Some ( s) => s,
@@ -717,7 +713,7 @@ pub fn handle_commands<CS: clap::Subcommand, S: clap::Args>(
717
713
chain_specific,
718
714
psbt,
719
715
} => {
720
- let mut psbt = Psbt :: from_str ( & psbt) ?;
716
+ let mut psbt = Psbt :: from_str ( psbt. as_str ( ) ) ?;
721
717
psbt. finalize_mut ( & Secp256k1 :: new ( ) )
722
718
. map_err ( |errors| anyhow:: anyhow!( "failed to finalize PSBT {errors:?}" ) ) ?;
723
719
0 commit comments