Skip to content

Commit

Permalink
rename MerkleProof.verifyProof to MerkleProof.verify (#1294)
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio authored Sep 7, 2018
1 parent a7ee54e commit df1fab5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion contracts/cryptography/MerkleProof.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ library MerkleProof {
* @param _root Merkle root
* @param _leaf Leaf of Merkle tree
*/
function verifyProof(
function verify(
bytes32[] _proof,
bytes32 _root,
bytes32 _leaf
Expand Down
4 changes: 2 additions & 2 deletions contracts/mocks/MerkleProofWrapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MerkleProof } from "../cryptography/MerkleProof.sol";

contract MerkleProofWrapper {

function verifyProof(
function verify(
bytes32[] _proof,
bytes32 _root,
bytes32 _leaf
Expand All @@ -14,6 +14,6 @@ contract MerkleProofWrapper {
pure
returns (bool)
{
return MerkleProof.verifyProof(_proof, _root, _leaf);
return MerkleProof.verify(_proof, _root, _leaf);
}
}
8 changes: 4 additions & 4 deletions test/library/MerkleProof.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 () {
Expand All @@ -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 () {
Expand All @@ -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);
});
});
});

0 comments on commit df1fab5

Please sign in to comment.