mirror of
https://github.com/privacy-scaling-explorations/zk-kit.git
synced 2026-04-22 03:00:15 -04:00
style(incremental-merkle-tree.sol): format code with prettier
This commit is contained in:
@@ -102,7 +102,7 @@ library IncrementalBinaryTree {
|
||||
|
||||
uint256 updateIndex;
|
||||
for (uint8 i = 0; i < depth; ) {
|
||||
updateIndex |= uint(proofPathIndices[i] & 1) << uint(i);
|
||||
updateIndex |= uint256(proofPathIndices[i] & 1) << uint256(i);
|
||||
if (proofPathIndices[i] == 0) {
|
||||
if (proofSiblings[i] == self.lastSubtrees[i][1]) {
|
||||
self.lastSubtrees[i][0] = hash;
|
||||
|
||||
@@ -119,7 +119,7 @@ library IncrementalQuinTree {
|
||||
uint256 updateIndex;
|
||||
for (uint8 i = 0; i < depth; ) {
|
||||
uint256[5] memory nodes;
|
||||
updateIndex += proofPathIndices[i] * 5 ** i;
|
||||
updateIndex += proofPathIndices[i] * 5**i;
|
||||
for (uint8 j = 0; j < 5; ) {
|
||||
if (j < proofPathIndices[i]) {
|
||||
nodes[j] = proofSiblings[i][j];
|
||||
|
||||
@@ -217,13 +217,7 @@ describe("IncrementalQuinTreeTest", () => {
|
||||
// now we can make a merkle proof of zero being included at the uninitialized index
|
||||
const { pathIndices, siblings } = tree.createProof(6)
|
||||
|
||||
const transaction = contract.updateLeaf(
|
||||
treeId,
|
||||
BigInt(0),
|
||||
leaf,
|
||||
siblings,
|
||||
pathIndices
|
||||
)
|
||||
const transaction = contract.updateLeaf(treeId, BigInt(0), leaf, siblings, pathIndices)
|
||||
await expect(transaction).to.be.revertedWith("IncrementalQuinTree: leaf index out of range")
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user