Skip to content

Commit 49df3e6

Browse files
committed
Adjust test_should_produce_an_invalid_root_for_a_non_existent_leaf for lazy Merkle tree expansion.
1 parent 212419e commit 49df3e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contracts/test/state/CommitmentTree.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ contract CommitmentTreeTest is Test, MerkleTreeExample {
8080
function test_should_produce_an_invalid_root_for_a_non_existent_leaf() public {
8181
bytes32 nonExistentCommitment = sha256("NON_EXISTENT");
8282

83-
for (uint256 i = 0; i < _N_LEAVES; ++i) {
83+
for (uint256 i = 1; i < _N_LEAVES; ++i) {
8484
bytes32 root = _cmAcc.addCommitment(_leaves[i + 1][i]);
8585

86-
for (uint256 j = 0; j <= i; ++j) {
86+
for (uint256 j = 0; j < i; ++j) {
8787
bytes32 computedRoot = MerkleTree.processProof({
8888
siblings: _siblings[i + 1][j],
8989
directionBits: _directionBits[_cmAcc.commitmentTreeCapacity()][j],

0 commit comments

Comments
 (0)