mirror of
https://github.com/tornadocash/tornado-core.git
synced 2025-05-02 14:26:06 -04:00
remove redundant event
This commit is contained in:
parent
66754181f2
commit
13b9a948dc
4 changed files with 18 additions and 18 deletions
|
@ -16,8 +16,6 @@ contract MerkleTreeWithHistory {
|
|||
|
||||
uint32 public next_index = 0;
|
||||
|
||||
event LeafAdded(uint256 indexed leaf, uint32 leaf_index);
|
||||
|
||||
constructor(uint256 tree_levels, uint256 zero_value) public {
|
||||
levels = tree_levels;
|
||||
|
||||
|
@ -48,7 +46,6 @@ contract MerkleTreeWithHistory {
|
|||
}
|
||||
|
||||
function _insert(uint256 leaf) internal {
|
||||
uint32 leaf_index = next_index;
|
||||
uint32 current_index = next_index;
|
||||
require(current_index != 2**(levels - 1), "Merkle tree is full");
|
||||
next_index += 1;
|
||||
|
@ -74,8 +71,6 @@ contract MerkleTreeWithHistory {
|
|||
|
||||
current_root = (current_root + 1) % ROOT_HISTORY_SIZE;
|
||||
_roots[current_root] = current_level_hash;
|
||||
|
||||
emit LeafAdded(leaf, leaf_index);
|
||||
}
|
||||
|
||||
function isKnownRoot(uint256 root) public view returns(bool) {
|
||||
|
|
|
@ -13,7 +13,7 @@ contract Mixer is MerkleTreeWithHistory {
|
|||
mapping(uint256 => bool) public commitments;
|
||||
IVerifier verifier;
|
||||
|
||||
event Deposit(address from, uint256 indexed commitment);
|
||||
event Deposit(uint256 indexed commitment, uint256 leafIndex);
|
||||
event Withdraw(address to, uint256 nullifier, uint256 fee);
|
||||
|
||||
/**
|
||||
|
@ -40,7 +40,7 @@ contract Mixer is MerkleTreeWithHistory {
|
|||
require(!commitments[commitment], "The commitment has been submitted");
|
||||
_insert(commitment);
|
||||
commitments[commitment] = true;
|
||||
emit Deposit(msg.sender, commitment);
|
||||
emit Deposit(commitment, next_index - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue