Skip to content

Commit

Permalink
Improve MerkleProof tests (OpenZeppelin#4937)
Browse files Browse the repository at this point in the history
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
  • Loading branch information
alexfertel and Amxx authored Mar 1, 2024
1 parent c8369d4 commit 7a29f7d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/utils/cryptography/MerkleProof.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ describe('MerkleProof', function () {
const merkleTree = StandardMerkleTree.of(toElements('abc'), ['string']);

const root = merkleTree.root;
const leaf = merkleTree.leafHash(['a']);
const hash = merkleTree.leafHash(['a']);
const proof = merkleTree.getProof(['a']);
const badProof = proof.slice(0, proof.length - 5);
const badProof = proof.slice(0, -1);

expect(await this.mock.$verify(badProof, root, leaf)).to.be.false;
expect(await this.mock.$verifyCalldata(badProof, root, leaf)).to.be.false;
expect(await this.mock.$verify(badProof, root, hash)).to.be.false;
expect(await this.mock.$verifyCalldata(badProof, root, hash)).to.be.false;
});
});

Expand Down

0 comments on commit 7a29f7d

Please sign in to comment.