|
@@ -13,7 +13,7 @@ contract('MerkleProof', function () {
|
|
|
merkleProof = await MerkleProofWrapper.new();
|
|
|
});
|
|
|
|
|
|
- describe('verifyProof', function () {
|
|
|
+ describe('verify', function () {
|
|
|
it('should return true for a valid Merkle proof', async function () {
|
|
|
const elements = ['a', 'b', 'c', 'd'];
|
|
|
const merkleTree = new MerkleTree(elements);
|
|
@@ -24,7 +24,7 @@ contract('MerkleProof', function () {
|
|
|
|
|
|
const leaf = bufferToHex(sha3(elements[0]));
|
|
|
|
|
|
- (await merkleProof.verifyProof(proof, root, leaf)).should.equal(true);
|
|
|
+ (await merkleProof.verify(proof, root, leaf)).should.equal(true);
|
|
|
});
|
|
|
|
|
|
it('should return false for an invalid Merkle proof', async function () {
|
|
@@ -40,7 +40,7 @@ contract('MerkleProof', function () {
|
|
|
|
|
|
const badProof = badMerkleTree.getHexProof(badElements[0]);
|
|
|
|
|
|
- (await merkleProof.verifyProof(badProof, correctRoot, correctLeaf)).should.equal(false);
|
|
|
+ (await merkleProof.verify(badProof, correctRoot, correctLeaf)).should.equal(false);
|
|
|
});
|
|
|
|
|
|
it('should return false for a Merkle proof of invalid length', async function () {
|
|
@@ -54,7 +54,7 @@ contract('MerkleProof', function () {
|
|
|
|
|
|
const leaf = bufferToHex(sha3(elements[0]));
|
|
|
|
|
|
- (await merkleProof.verifyProof(badProof, root, leaf)).should.equal(false);
|
|
|
+ (await merkleProof.verify(badProof, root, leaf)).should.equal(false);
|
|
|
});
|
|
|
});
|
|
|
});
|