Skip to content

Commit df1fab5

Browse files
authored
rename MerkleProof.verifyProof to MerkleProof.verify (#1294)
1 parent a7ee54e commit df1fab5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

contracts/cryptography/MerkleProof.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ library MerkleProof {
1414
* @param _root Merkle root
1515
* @param _leaf Leaf of Merkle tree
1616
*/
17-
function verifyProof(
17+
function verify(
1818
bytes32[] _proof,
1919
bytes32 _root,
2020
bytes32 _leaf

contracts/mocks/MerkleProofWrapper.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { MerkleProof } from "../cryptography/MerkleProof.sol";
55

66
contract MerkleProofWrapper {
77

8-
function verifyProof(
8+
function verify(
99
bytes32[] _proof,
1010
bytes32 _root,
1111
bytes32 _leaf
@@ -14,6 +14,6 @@ contract MerkleProofWrapper {
1414
pure
1515
returns (bool)
1616
{
17-
return MerkleProof.verifyProof(_proof, _root, _leaf);
17+
return MerkleProof.verify(_proof, _root, _leaf);
1818
}
1919
}

test/library/MerkleProof.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ contract('MerkleProof', function () {
1313
merkleProof = await MerkleProofWrapper.new();
1414
});
1515

16-
describe('verifyProof', function () {
16+
describe('verify', function () {
1717
it('should return true for a valid Merkle proof', async function () {
1818
const elements = ['a', 'b', 'c', 'd'];
1919
const merkleTree = new MerkleTree(elements);
@@ -24,7 +24,7 @@ contract('MerkleProof', function () {
2424

2525
const leaf = bufferToHex(sha3(elements[0]));
2626

27-
(await merkleProof.verifyProof(proof, root, leaf)).should.equal(true);
27+
(await merkleProof.verify(proof, root, leaf)).should.equal(true);
2828
});
2929

3030
it('should return false for an invalid Merkle proof', async function () {
@@ -40,7 +40,7 @@ contract('MerkleProof', function () {
4040

4141
const badProof = badMerkleTree.getHexProof(badElements[0]);
4242

43-
(await merkleProof.verifyProof(badProof, correctRoot, correctLeaf)).should.equal(false);
43+
(await merkleProof.verify(badProof, correctRoot, correctLeaf)).should.equal(false);
4444
});
4545

4646
it('should return false for a Merkle proof of invalid length', async function () {
@@ -54,7 +54,7 @@ contract('MerkleProof', function () {
5454

5555
const leaf = bufferToHex(sha3(elements[0]));
5656

57-
(await merkleProof.verifyProof(badProof, root, leaf)).should.equal(false);
57+
(await merkleProof.verify(badProof, root, leaf)).should.equal(false);
5858
});
5959
});
6060
});

0 commit comments

Comments
 (0)