Skip to content

Commit

Permalink
Fix signing probrem for P2C script
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamaguchi committed Aug 21, 2024
1 parent 5d23c9d commit 2d55a71
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions crates/wallet/src/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
//! Wallet
//!
//! This module defines the [`Wallet`].
use crate::collections::{BTreeMap, HashMap};
use crate::{
collections::{BTreeMap, HashMap},
keys::DescriptorKey,
};
use alloc::{
borrow::ToOwned,
boxed::Box,
Expand Down Expand Up @@ -2351,8 +2354,14 @@ impl Wallet {
c.contract.clone(),
&self.secp_ctx(),
);
if let Ok(ddk) = DefiniteDescriptorKey::from_str(&public_key.to_string()) {
return Some(Descriptor::<DefiniteDescriptorKey>::new_pk(ddk));

if let Ok(ddk) = DefiniteDescriptorKey::from_str(
&public_key.inner.serialize().to_lower_hex_string(),
) {
return Some(
Descriptor::<DefiniteDescriptorKey>::new_pkh(ddk)
.expect("can not create new descriptor"),
);
}
}
return None;
Expand Down

0 comments on commit 2d55a71

Please sign in to comment.