Open kpp opened 5 months ago
https://github.com/penumbra-zone/jmt/blob/9ba90718d36cdf376630fa036b5a54c35447982c/src/types/proof/definition.rs#L514
#[derive(Debug, Serialize, Deserialize, borsh::BorshSerialize, borsh::BorshDeserialize)] pub struct UpdateMerkleProof<H: SimpleHasher>(Vec<SparseMerkleProof<H>>);
BorshSerialize is implemented for Vec<SparseMerkleProof<H>> for all H. Yes, it is possible to do a #[borsh(bound(deserialize = "", serialize = ""))] trick in this particular case, but for enums its not obvious.
Vec<SparseMerkleProof<H>>
H
#[borsh(bound(deserialize = "", serialize = ""))]
#[borsh(relax = "T") enum/struct A<T> { ...
Linked issue: https://github.com/penumbra-zone/jmt/issues/113
Example
https://github.com/penumbra-zone/jmt/blob/9ba90718d36cdf376630fa036b5a54c35447982c/src/types/proof/definition.rs#L514
BorshSerialize is implemented for
Vec<SparseMerkleProof<H>>
for allH
. Yes, it is possible to do a#[borsh(bound(deserialize = "", serialize = ""))]
trick in this particular case, but for enums its not obvious.Possible solution
Linked issue: https://github.com/penumbra-zone/jmt/issues/113