Skip to content

Commit fd1c8ef

Browse files
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.
1 parent fe03c66 commit fd1c8ef

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/types/proof/definition.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pub struct SparseMerkleProof<H: SimpleHasher> {
3737
siblings: Vec<SparseMerkleNode>,
3838

3939
/// A marker type showing which hash function is used in this proof.
40+
#[borsh(bound(serialize = "", deserialize = ""))]
4041
phantom_hasher: PhantomData<H>,
4142
}
4243

@@ -511,7 +512,9 @@ impl<H: SimpleHasher> SparseMerkleProof<H> {
511512
}
512513

513514
#[derive(Debug, Serialize, Deserialize, borsh::BorshSerialize, borsh::BorshDeserialize)]
514-
pub struct UpdateMerkleProof<H: SimpleHasher>(Vec<SparseMerkleProof<H>>);
515+
pub struct UpdateMerkleProof<H: SimpleHasher>(
516+
#[borsh(bound(serialize = "", deserialize = ""))] Vec<SparseMerkleProof<H>>,
517+
);
515518

516519
impl<H: SimpleHasher> UpdateMerkleProof<H> {
517520
pub fn new(merkle_proofs: Vec<SparseMerkleProof<H>>) -> Self {

0 commit comments

Comments
 (0)