Closed afck closed 6 years ago
That would indeed be nice to have, though I wonder if there is indeed a better way to handle proof deserialization without having ProofData
. Perhaps by writing manual Serialize
/Deserialize
instances for Proof
, and encoding the Algorithm
as eg. a string equals to the name of the corresponding static in ring::digest
, ie. SHA1
, SHA256
, SHA384
, SHA512
, SHA512_256
.
What do you think?
Good idea! Supporting the constants in ring::digest
should be sufficient for most use-cases. I'll give it a try.
@afck Thank you for the PR! Just published v1.7.0 to crates.io with your changes :)
We're using
merkle
'sProof
s in messages that need to be serialized, and want to support Serde in addition to protobuf, so I added a very crudeserialization-serde
feature in my fork: https://github.com/afck/merkle.rs/commit/dd41698a8a012643c7b9273e51943ac704524c70Unfortunately
Proof
can't just be deserialized, so we added aProofData
that doesn't contain thealgorithm
field, and conversion functions.Would you be interested in merging something like that into master? Is there a better way to handle proof deserialization?