style(incremental-merkle-tree.sol): format code with prettier

This commit is contained in:
twister-dev
2022-10-04 11:17:01 -07:00
parent 2e69d2b03b
commit 9ebe75535d
3 changed files with 3 additions and 9 deletions

View File

@@ -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;

View File

@@ -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];

View File

@@ -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")
})