From fd1c8ef99913663eb801576a9b13a31523861d87 Mon Sep 17 00:00:00 2001 From: Preston Evans <32944016+preston-evans98@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:31:22 -0500 Subject: [PATCH] jmt: remove spurious Hasher: BorshSerialize + BorshDeserialize bounds (#116) `borsh` changed their macro logic for bound inference in their 1.0 release. Unforunatley, the change causes borsh to infer spurious bounds on generic types in some cases. This PR removes the unnecessary bounds on types which are generic over a Hasher. --- src/types/proof/definition.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/types/proof/definition.rs b/src/types/proof/definition.rs index 79bf519..c29d2b1 100644 --- a/src/types/proof/definition.rs +++ b/src/types/proof/definition.rs @@ -37,6 +37,7 @@ pub struct SparseMerkleProof { siblings: Vec, /// A marker type showing which hash function is used in this proof. + #[borsh(bound(serialize = "", deserialize = ""))] phantom_hasher: PhantomData, } @@ -511,7 +512,9 @@ impl SparseMerkleProof { } #[derive(Debug, Serialize, Deserialize, borsh::BorshSerialize, borsh::BorshDeserialize)] -pub struct UpdateMerkleProof(Vec>); +pub struct UpdateMerkleProof( + #[borsh(bound(serialize = "", deserialize = ""))] Vec>, +); impl UpdateMerkleProof { pub fn new(merkle_proofs: Vec>) -> Self {