remove redundant event

This commit is contained in:
Alexey 2019-07-19 20:08:47 +03:00
parent 66754181f2
commit 13b9a948dc
4 changed files with 18 additions and 18 deletions

View file

@ -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) {

View file

@ -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);
}
/**