Browse Source

keypair: Impl from pallas::Point for PublicKey

parazyd 3 years ago
parent
commit
8ba0fc207e
1 changed files with 6 additions and 0 deletions
  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> {