many improvements

This commit is contained in:
William Casarin
2022-12-12 14:33:37 -08:00
parent e629402d11
commit 48af3dde9d
15 changed files with 334 additions and 118 deletions

22
enostr/src/pubkey.rs Normal file
View File

@@ -0,0 +1,22 @@
use serde_derive::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Clone, Hash)]
pub struct Pubkey(String);
impl AsRef<str> for Pubkey {
fn as_ref(&self) -> &str {
&self.0
}
}
impl From<String> for Pubkey {
fn from(s: String) -> Self {
Pubkey(s)
}
}
impl From<Pubkey> for String {
fn from(pk: Pubkey) -> Self {
pk.0
}
}