Impl zcash_deserialize for secp256k1::PublicKey
@@ -12,7 +12,10 @@ impl ZcashSerialize for PublicKey {
}
impl ZcashDeserialize for PublicKey {
- fn zcash_deserialize<R: io::Read>(mut _reader: R) -> Result<Self, SerializationError> {
- unimplemented!();
+ fn zcash_deserialize<R: io::Read>(mut reader: R) -> Result<Self, SerializationError> {
+ let mut bytes = [0; 33];
+ reader.read_exact(&mut bytes[..])?;
+ Self::from_slice(&bytes[..])
+ .map_err(|_| SerializationError::Parse("weird secp256k1 compressed public key"))
}
}
