瀏覽代碼

keypair: Impl from pallas::Point for PublicKey

parazyd 3 年之前
父節點
當前提交
8ba0fc207e
共有 1 個文件被更改,包括 6 次插入0 次删除
  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 {
 impl TryFrom<Address> for PublicKey {
     type Error = Error;
     type Error = Error;
     fn try_from(address: Address) -> Result<Self> {
     fn try_from(address: Address) -> Result<Self> {