Impl zcash_deserialize for secp256k1::PublicKey
This commit is contained in:
parent
3fbfd10f2c
commit
532bbaf460
|
@ -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"))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue