|
@@ -1,5 +1,5 @@
|
|
|
const { MerkleTree } = require('../helpers/merkleTree.js');
|
|
|
-const { sha3, bufferToHex } = require('ethereumjs-util');
|
|
|
+const { keccak256, bufferToHex } = require('ethereumjs-util');
|
|
|
|
|
|
const MerkleProofWrapper = artifacts.require('MerkleProofWrapper');
|
|
|
|
|
@@ -20,7 +20,7 @@ contract('MerkleProof', function () {
|
|
|
|
|
|
const proof = merkleTree.getHexProof(elements[0]);
|
|
|
|
|
|
- const leaf = bufferToHex(sha3(elements[0]));
|
|
|
+ const leaf = bufferToHex(keccak256(elements[0]));
|
|
|
|
|
|
(await this.merkleProof.verify(proof, root, leaf)).should.equal(true);
|
|
|
});
|
|
@@ -31,7 +31,7 @@ contract('MerkleProof', function () {
|
|
|
|
|
|
const correctRoot = correctMerkleTree.getHexRoot();
|
|
|
|
|
|
- const correctLeaf = bufferToHex(sha3(correctElements[0]));
|
|
|
+ const correctLeaf = bufferToHex(keccak256(correctElements[0]));
|
|
|
|
|
|
const badElements = ['d', 'e', 'f'];
|
|
|
const badMerkleTree = new MerkleTree(badElements);
|
|
@@ -50,7 +50,7 @@ contract('MerkleProof', function () {
|
|
|
const proof = merkleTree.getHexProof(elements[0]);
|
|
|
const badProof = proof.slice(0, proof.length - 5);
|
|
|
|
|
|
- const leaf = bufferToHex(sha3(elements[0]));
|
|
|
+ const leaf = bufferToHex(keccak256(elements[0]));
|
|
|
|
|
|
(await this.merkleProof.verify(badProof, root, leaf)).should.equal(false);
|
|
|
});
|