@@ -3,6 +3,8 @@ use crate::error::{
33 PsbtParseError , TransactionError ,
44} ;
55use crate :: error:: { ParseAmountError , PsbtFinalizeError } ;
6+ use crate :: keys:: DerivationPath ;
7+
68use crate :: { impl_from_core_type, impl_hash_like, impl_into_core_type} ;
79use std:: collections:: HashMap ;
810
@@ -510,23 +512,23 @@ pub struct TapScriptEntry {
510512 pub leaf_version : u8 ,
511513}
512514
513- #[ derive( Clone , Debug , uniffi:: Record , Hash , Eq , PartialEq ) ]
515+ #[ derive( Clone , Debug , uniffi:: Record ) ]
514516pub struct TapKeyOrigin {
515517 /// leaf hashes as hex strings
516518 pub tap_leaf_hashes : Vec < String > ,
517519 /// key source
518520 pub key_source : KeySource ,
519521}
520522
521- #[ derive( Clone , Debug , uniffi:: Record , Hash , Eq , PartialEq ) ]
523+ #[ derive( Clone , Debug , uniffi:: Record ) ]
522524pub struct KeySource {
523525 /// A fingerprint
524526 pub fingerprint : String ,
525527 /// A BIP-32 derivation path.
526- pub path : String ,
528+ pub path : Arc < DerivationPath > ,
527529}
528530
529- #[ derive( Clone , Debug , uniffi :: Record , Hash , Eq , PartialEq ) ]
531+ #[ derive( Clone , Debug , Hash , Eq , PartialEq , uniffi :: Record ) ]
530532pub struct Key {
531533 /// The type of this PSBT key.
532534 pub type_value : u8 ,
@@ -535,7 +537,7 @@ pub struct Key {
535537 pub key : Vec < u8 > ,
536538}
537539
538- #[ derive( Clone , Debug , uniffi :: Record , Hash , Eq , PartialEq ) ]
540+ #[ derive( Clone , Debug , Hash , Eq , PartialEq , uniffi :: Record ) ]
539541pub struct ProprietaryKey {
540542 /// Proprietary type prefix used for grouping together keys under some
541543 /// application and avoid namespace collision
@@ -546,7 +548,7 @@ pub struct ProprietaryKey {
546548 pub key : Vec < u8 > ,
547549}
548550
549- #[ derive( Clone , Debug , uniffi :: Record , Hash , Eq , PartialEq ) ]
551+ #[ derive( Clone , Debug , Hash , Eq , PartialEq , uniffi :: Record ) ]
550552pub struct ControlBlock {
551553 /// The internal key.
552554 pub internal_key : Vec < u8 > ,
@@ -558,7 +560,7 @@ pub struct ControlBlock {
558560 pub leaf_version : u8 ,
559561}
560562
561- #[ derive( Clone , Debug , uniffi :: Record , Hash , Eq , PartialEq ) ]
563+ #[ derive( Clone , Debug , Hash , Eq , PartialEq , uniffi :: Record ) ]
562564pub struct TapScriptSigKey {
563565 /// An x-only public key, used for verification of Taproot signatures and serialized according to BIP-340.
564566 pub xonly_pubkey : String ,
@@ -655,7 +657,7 @@ impl From<&BdkInput> for Input {
655657 pk. to_string ( ) ,
656658 KeySource {
657659 fingerprint : fingerprint. to_string ( ) ,
658- path : deriv_path. to_string ( ) ,
660+ path : Arc :: new ( deriv_path. clone ( ) . into ( ) ) ,
659661 } ,
660662 )
661663 } )
@@ -722,8 +724,11 @@ impl From<&BdkInput> for Input {
722724 let value = TapKeyOrigin {
723725 tap_leaf_hashes : v. 0 . iter ( ) . map ( |h| h. to_string ( ) ) . collect ( ) ,
724726 key_source : KeySource {
725- fingerprint : v. 1 . 0 . to_string ( ) ,
726- path : v. 1 . 1 . to_string ( ) ,
727+ // Unnecessary spaces being added by fmt. We use #[rustfmt::skip] to avoid them for now.
728+ #[ rustfmt:: skip]
729+ fingerprint : v. 1 . 0 . to_string ( ) ,
730+ #[ rustfmt:: skip]
731+ path : Arc :: new ( v. 1 . 1 . clone ( ) . into ( ) ) ,
727732 } ,
728733 } ;
729734 ( key, value)
0 commit comments