Improve MerkleProof tests (#4937)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
committed by
GitHub
parent
c8369d483c
commit
7a29f7df51
@ -55,12 +55,12 @@ describe('MerkleProof', function () {
|
|||||||
const merkleTree = StandardMerkleTree.of(toElements('abc'), ['string']);
|
const merkleTree = StandardMerkleTree.of(toElements('abc'), ['string']);
|
||||||
|
|
||||||
const root = merkleTree.root;
|
const root = merkleTree.root;
|
||||||
const leaf = merkleTree.leafHash(['a']);
|
const hash = merkleTree.leafHash(['a']);
|
||||||
const proof = merkleTree.getProof(['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.$verify(badProof, root, hash)).to.be.false;
|
||||||
expect(await this.mock.$verifyCalldata(badProof, root, leaf)).to.be.false;
|
expect(await this.mock.$verifyCalldata(badProof, root, hash)).to.be.false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user