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 origin_path = ifletSome((_,ref path)) = xpub.origin{
379
+
path.clone()
380
+
}else{
381
+
bip32::DerivationPath::from(vec![])
382
+
};
383
+
origin_path.extend(&xpub.derivation_path)
384
+
}
385
+
DescriptorPublicKey::SinglePub(ref single) => {
386
+
ifletSome((_,ref path)) = single.origin{
387
+
path.clone()
388
+
}else{
389
+
bip32::DerivationPath::from(vec![])
390
+
}
391
+
}
392
+
}
393
+
}
394
+
346
395
/// If this public key has a wildcard, replace it by the given index
347
396
///
348
397
/// Panics if given an index ≥ 2^31
@@ -706,21 +755,34 @@ mod test {
706
755
let secret_key = DescriptorSecretKey::from_str("tprv8ZgxMBicQKsPcwcD4gSnMti126ZiETsuX7qwrtMypr6FBwAP65puFn4v6c3jrN9VwtMRMph6nyT63NrfUL4C3nBzPcduzVSuHD7zbX2JKVc/0'/1'/2").unwrap();
707
756
let public_key = secret_key.as_public(&secp).unwrap();
let secret_key = DescriptorSecretKey::from_str("tprv8ZgxMBicQKsPcwcD4gSnMti126ZiETsuX7qwrtMypr6FBwAP65puFn4v6c3jrN9VwtMRMph6nyT63NrfUL4C3nBzPcduzVSuHD7zbX2JKVc/0'/1'/2'").unwrap();
711
762
let public_key = secret_key.as_public(&secp).unwrap();
let secret_key = DescriptorSecretKey::from_str("tprv8ZgxMBicQKsPcwcD4gSnMti126ZiETsuX7qwrtMypr6FBwAP65puFn4v6c3jrN9VwtMRMph6nyT63NrfUL4C3nBzPcduzVSuHD7zbX2JKVc/0/1/2").unwrap();
715
768
let public_key = secret_key.as_public(&secp).unwrap();
let secret_key = DescriptorSecretKey::from_str("[aabbccdd]tprv8ZgxMBicQKsPcwcD4gSnMti126ZiETsuX7qwrtMypr6FBwAP65puFn4v6c3jrN9VwtMRMph6nyT63NrfUL4C3nBzPcduzVSuHD7zbX2JKVc/0/1/2").unwrap();
719
774
let public_key = secret_key.as_public(&secp).unwrap();
let secret_key = DescriptorSecretKey::from_str("[aabbccdd/90']tprv8ZgxMBicQKsPcwcD4gSnMti126ZiETsuX7qwrtMypr6FBwAP65puFn4v6c3jrN9VwtMRMph6nyT63NrfUL4C3nBzPcduzVSuHD7zbX2JKVc/0'/1'/2").unwrap();
723
780
let public_key = secret_key.as_public(&secp).unwrap();
0 commit comments