From 226f3c175f8c69c2ac5bd2c3f865f057d20ab322 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Thu, 6 Sep 2018 21:00:36 -0300 Subject: [PATCH] rename MerkleProof.verifyProof to MerkleProof.verify --- contracts/cryptography/MerkleProof.sol | 2 +- contracts/mocks/MerkleProofWrapper.sol | 4 ++-- test/library/MerkleProof.test.js | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/contracts/cryptography/MerkleProof.sol b/contracts/cryptography/MerkleProof.sol index 26a8b350c93..e46d08de597 100644 --- a/contracts/cryptography/MerkleProof.sol +++ b/contracts/cryptography/MerkleProof.sol @@ -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 diff --git a/contracts/mocks/MerkleProofWrapper.sol b/contracts/mocks/MerkleProofWrapper.sol index fe72d75f87f..5458acc94ea 100644 --- a/contracts/mocks/MerkleProofWrapper.sol +++ b/contracts/mocks/MerkleProofWrapper.sol @@ -5,7 +5,7 @@ import { MerkleProof } from "../cryptography/MerkleProof.sol"; contract MerkleProofWrapper { - function verifyProof( + function verify( bytes32[] _proof, bytes32 _root, bytes32 _leaf @@ -14,6 +14,6 @@ contract MerkleProofWrapper { pure returns (bool) { - return MerkleProof.verifyProof(_proof, _root, _leaf); + return MerkleProof.verify(_proof, _root, _leaf); } } diff --git a/test/library/MerkleProof.test.js b/test/library/MerkleProof.test.js index cba5d69f5f1..6674880b742 100644 --- a/test/library/MerkleProof.test.js +++ b/test/library/MerkleProof.test.js @@ -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); }); }); });