Skip to content

Commit 3a5da61

Browse files
fix: updated tests w new leaf hash
1 parent bf8f9db commit 3a5da61

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

contracts/test/bridge/merkle/MerkleTree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class MerkleTree {
3131
* @return node The `sha3` (A.K.A. `keccak256`) hash of `first, ...params` as a 32-byte hex string.
3232
*/
3333
public static makeLeafNode(data: string): string {
34-
const result = ethers.utils.sha256(data);
34+
const result = ethers.utils.keccak256(data);
3535

3636
if (!result) {
3737
throw new Error("Leaf node must not be empty");

contracts/test/bridge/merkle/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe("Merkle", function () {
6161
});
6262
it("Should correctly verify all nodes in the tree", async () => {
6363
for (var message of data) {
64-
const leaf = ethers.utils.sha256(message);
64+
const leaf = ethers.utils.keccak256(message);
6565
proof = mt.getHexProof(leaf);
6666
const validation = await merkleProof.validateProof(proof, message,rootOnChain);
6767
expect(validation).equal(true);

0 commit comments

Comments
 (0)