You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let elem_desc = "ct(slip77(ab5824f4477b4ebb00a132adfd8eb0b7935cf24f6ac151add5d1913db374ce92),elwpkh([759db348/84'/1'/0']tpubDCRMaF33e44pcJj534LXVhFbHibPbJ5vuLhSSPFAw57kYURv4tzXFL6LSnd78bkjqdmE3USedkbpXJUPA1tdzKfuYSL7PianceqAhwL2UkA/0/*))";
385
+
let elem_desc:ConfidentialDescriptor<DescriptorPublicKey> = elem_desc.parse().unwrap();
386
+
let fed_peg_desc = fed_peg_desc();
387
+
let pegin = Pegin::new(fed_peg_desc, elem_desc.descriptor);
388
+
let secp = secp256k1::Secp256k1::new();
389
+
390
+
let witness_script_0 = pegin
391
+
.derived_descriptor(0,&secp)
392
+
.unwrap()
393
+
.bitcoin_witness_script(&secp)
394
+
.unwrap();
395
+
let address_0 = bitcoin::Address::p2wsh(&witness_script_0, bitcoin::Network::Bitcoin);
Copy file name to clipboardExpand all lines: src/lib.rs
+12
Original file line number
Diff line number
Diff line change
@@ -373,6 +373,9 @@ pub enum Error {
373
373
/// At least two BIP389 key expressions in the descriptor contain tuples of
374
374
/// derivation indexes of different lengths.
375
375
MultipathDescLenMismatch,
376
+
377
+
/// Conversion error in descriptor
378
+
Conversion(descriptor::ConversionError),
376
379
}
377
380
378
381
#[doc(hidden)]
@@ -449,6 +452,12 @@ impl From<bitcoin::address::ParseError> for Error {
449
452
}
450
453
}
451
454
455
+
implFrom<descriptor::ConversionError>forError{
456
+
fnfrom(e: descriptor::ConversionError) -> Error{
457
+
Error::Conversion(e)
458
+
}
459
+
}
460
+
452
461
fnerrstr(s:&str) -> Error{
453
462
Error::Unexpected(s.to_owned())
454
463
}
@@ -530,6 +539,8 @@ impl fmt::Display for Error {
530
539
Error::TrNoScriptCode => write!(f,"No script code for Tr descriptors"),
531
540
Error::TrNoExplicitScript => write!(f,"No script code for Tr descriptors"),
532
541
Error::MultipathDescLenMismatch => write!(f,"At least two BIP389 key expressions in the descriptor contain tuples of derivation indexes of different lengths"),
0 commit comments