Răsfoiți Sursa

keypair: Impl from pallas::Point for PublicKey

parazyd 3 ani în urmă
părinte
comite
8ba0fc207e
1 a modificat fișierele cu 6 adăugiri și 0 ștergeri
  1. 6 0
      src/crypto/keypair.rs

+ 6 - 0
src/crypto/keypair.rs

@@ -163,6 +163,12 @@ impl FromStr for PublicKey {
     }
 }
 
+impl From<pallas::Point> for PublicKey {
+    fn from(x: pallas::Point) -> Self {
+        Self(x)
+    }
+}
+
 impl TryFrom<Address> for PublicKey {
     type Error = Error;
     fn try_from(address: Address) -> Result<Self> {