mirror of
https://github.com/privacy-scaling-explorations/zk-kit.git
synced 2026-04-22 03:00:15 -04:00
style: format code with prettier
Former-commit-id: 614571923b8edff39cb3708c4a04ba4f5fc9e6c3 [formerly 5a3f2e274644f4fc3c803d84b6d66a8de3631afe] [formerly fa0d85f650cb2d40872a2d22f45faf73966fe682 [formerly 10f253454a0076fe2a82f98cbf92ecdcd3a09302]] [formerly f79e4c90beb48fc2d374e07fad19bbeb70303e19 [formerly 39b34a35914614107e4686661679748b9f1a242b] [formerly 676acdda0af16b55e54920dc3c1ca84ea19a9d03 [formerly f13da3344b]]]
Former-commit-id: ece91cf9fab5bc9990dd81914bc144d447e973a8 [formerly 3b83e4763b0200ffcbd747599684b92196ceb1c3] [formerly 7222cc16b8bd1f2a0c541f95f656805c53509c50 [formerly 57ac440a55bf35b8e833c0dd6c2312563fb78209]]
Former-commit-id: 9e4917258accc4e9c0f5976ec8e5bdf054bb8a12 [formerly 2b76d6e36ea0e543e59421f34a4aba0e7620f54b]
Former-commit-id: 29bced0ce6beca04a726b9a97ce0815273286b15
This commit is contained in:
2
.github/ISSUE_TEMPLATE/package_request.md
vendored
2
.github/ISSUE_TEMPLATE/package_request.md
vendored
@@ -8,7 +8,7 @@ labels: ""
|
||||
**Describe the package**
|
||||
A clear and concise description of what the package should be.
|
||||
|
||||
**Describe why it may be useful**
|
||||
**Describe why it may be useful**
|
||||
A clear and concise description of the context in which this package could be used and why it may be usefulp.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
|
||||
@@ -5,40 +5,40 @@ pragma solidity ^0.8.4;
|
||||
import "./IncrementalBinaryTree.sol";
|
||||
|
||||
contract BinaryTreeTest {
|
||||
using IncrementalBinaryTree for IncrementalTreeData;
|
||||
using IncrementalBinaryTree for IncrementalTreeData;
|
||||
|
||||
event TreeCreated(bytes32 id, uint8 depth);
|
||||
event LeafInserted(bytes32 indexed treeId, uint256 leaf, uint256 root);
|
||||
event LeafRemoved(bytes32 indexed treeId, uint256 leaf, uint256 root);
|
||||
event TreeCreated(bytes32 id, uint8 depth);
|
||||
event LeafInserted(bytes32 indexed treeId, uint256 leaf, uint256 root);
|
||||
event LeafRemoved(bytes32 indexed treeId, uint256 leaf, uint256 root);
|
||||
|
||||
mapping(bytes32 => IncrementalTreeData) public trees;
|
||||
mapping(bytes32 => IncrementalTreeData) public trees;
|
||||
|
||||
function createTree(bytes32 _id, uint8 _depth) external {
|
||||
require(trees[_id].depth == 0, "BinaryTreeTest: tree already exists");
|
||||
function createTree(bytes32 _id, uint8 _depth) external {
|
||||
require(trees[_id].depth == 0, "BinaryTreeTest: tree already exists");
|
||||
|
||||
trees[_id].init(_depth, 0);
|
||||
trees[_id].init(_depth, 0);
|
||||
|
||||
emit TreeCreated(_id, _depth);
|
||||
}
|
||||
emit TreeCreated(_id, _depth);
|
||||
}
|
||||
|
||||
function insertLeaf(bytes32 _treeId, uint256 _leaf) external {
|
||||
require(trees[_treeId].depth != 0, "BinaryTreeTest: tree does not exist");
|
||||
function insertLeaf(bytes32 _treeId, uint256 _leaf) external {
|
||||
require(trees[_treeId].depth != 0, "BinaryTreeTest: tree does not exist");
|
||||
|
||||
trees[_treeId].insert(_leaf);
|
||||
trees[_treeId].insert(_leaf);
|
||||
|
||||
emit LeafInserted(_treeId, _leaf, trees[_treeId].root);
|
||||
}
|
||||
emit LeafInserted(_treeId, _leaf, trees[_treeId].root);
|
||||
}
|
||||
|
||||
function removeLeaf(
|
||||
bytes32 _treeId,
|
||||
uint256 _leaf,
|
||||
uint256[] memory _proofSiblings,
|
||||
uint8[] memory _proofPathIndices
|
||||
) external {
|
||||
require(trees[_treeId].depth != 0, "BinaryTreeTest: tree does not exist");
|
||||
function removeLeaf(
|
||||
bytes32 _treeId,
|
||||
uint256 _leaf,
|
||||
uint256[] memory _proofSiblings,
|
||||
uint8[] memory _proofPathIndices
|
||||
) external {
|
||||
require(trees[_treeId].depth != 0, "BinaryTreeTest: tree does not exist");
|
||||
|
||||
trees[_treeId].remove(_leaf, _proofSiblings, _proofPathIndices);
|
||||
trees[_treeId].remove(_leaf, _proofSiblings, _proofPathIndices);
|
||||
|
||||
emit LeafRemoved(_treeId, _leaf, trees[_treeId].root);
|
||||
}
|
||||
emit LeafRemoved(_treeId, _leaf, trees[_treeId].root);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
pragma solidity ^0.8.4;
|
||||
|
||||
library PoseidonT3 {
|
||||
function poseidon(uint256[2] memory) public pure returns (uint256) {}
|
||||
function poseidon(uint256[2] memory) public pure returns (uint256) {}
|
||||
}
|
||||
|
||||
library PoseidonT6 {
|
||||
function poseidon(uint256[5] memory) public pure returns (uint256) {}
|
||||
function poseidon(uint256[5] memory) public pure returns (uint256) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user