question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update to latest `merkletreejs` version will break a unit test in `MerkleProof.test.js`

See original GitHub issue

I just wanted to let you know that if you update to the latest merkletreejs version (0.3.2), the following line will break (at least it did for me 😄):

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

I realised it since I used the same test setup for my Vyper Snekmake foundry tests. You can fix it by adding the index of 2. See my commit here: https://github.com/pcaversaccio/snekmate/commit/0f66c3eabbd5e5a8865eab057084749ce1d6c48d:

const badProof = badMerkleTree.getHexProof(badElements[0], 2);
// or the following will produce the same result as well
const badProof = badMerkleTree.getHexProof(badElements[2], 2);

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pcaversacciocommented, Nov 14, 2022

@miguelmota awesome - just upgraded and can confirm it runs smoothly. Ok, I will upgrade my Merkle proof verification tests to @openzeppelin/merkle-tree once my time permits. Closing the issue now as it’s resolved.

0reactions
miguelmotacommented, Nov 14, 2022

As frangio pointed out, the oz lib @openzeppelin/merkle-tree will supersede merkletreejs since it’ll be more well maintained in the longer term

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unit test breaks after dependencies update for Node 16
It seems that it took that locale and used that format. Is interesting that before the upgrade above, I was calling toLocaleString with ......
Read more >
The Ultimate Merkle Tree Guide in Solidity
Merkle trees are used everywhere in the world of blockchains. Learn how they work, how to use them yourself and what might be...
Read more >
Testing MerkeProof - Support - OpenZeppelin Forum
I 've migrated to hardhat (waffle & ethers) and merkletreejs and I'm having some issue testing the MerkeProof.sol code with addresses as ...
Read more >
merkletreejs - npm
Construct Merkle Trees and verify proofs. Latest version: 0.3.9, last published: a month ago. Start using merkletreejs in your project by ...
Read more >
Understanding Merkle Trees - Why Use Them, Who Uses ...
Changing the Number of Leaves; Testing an Audit Proof; Testing a ... (like a NoSQL database) where a record is allowed to change...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found