Просмотр исходного кода

keypair: Impl from pallas::Point for PublicKey

parazyd 3 лет назад
Родитель
Сommit
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 {
     type Error = Error;
     fn try_from(address: Address) -> Result<Self> {