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
3502477 Serde for DescriptorPublicKey (Scott Robinson)
Pull request description:
Save me from ever writing the following code again:
```rust
pub mod serde_descriptor_key {
use std::str::FromStr;
use miniscript::DescriptorPublicKey;
use serde::{Deserialize, Deserializer, Serializer};
pub fn serialize<S>(dpk: &DescriptorPublicKey, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
serializer.serialize_str(&dpk.to_string())
}
pub fn deserialize<'de, D>(deserializer: D) -> Result<DescriptorPublicKey, D::Error>
where
D: Deserializer<'de>,
{
let s = String::deserialize(deserializer)?;
DescriptorPublicKey::from_str(&s).map_err(serde::de::Error::custom)
}
}
```
ACKs for top commit:
apoelstra:
ACK 3502477
sanket1729:
ACK 3502477
Tree-SHA512: 0d4c13f9944d1419baf76b1443daf8f1d200b1901c7510bb44cca16967bf71a9d44825e758984ae45bc8f7a47534455b99cc355f9e421c08c3b9d32dcc677be4
0 commit comments