mirror of
https://github.com/tornadocash/tornado-core.git
synced 2024-12-24 22:09:24 -05:00
rename withdraw event
This commit is contained in:
parent
c92ac97ff2
commit
27a00bfd5f
@ -37,7 +37,7 @@ contract Mixer is MerkleTreeWithHistory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
event Deposit(uint256 indexed commitment, uint256 leafIndex, uint256 timestamp);
|
event Deposit(uint256 indexed commitment, uint256 leafIndex, uint256 timestamp);
|
||||||
event Withdraw(address to, uint256 nullifierHash, address indexed relayer, uint256 fee);
|
event Withdrawal(address to, uint256 nullifierHash, address indexed relayer, uint256 fee);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@dev The constructor
|
@dev The constructor
|
||||||
@ -98,7 +98,7 @@ contract Mixer is MerkleTreeWithHistory {
|
|||||||
require(verifier.verifyProof(proof, input), "Invalid withdraw proof");
|
require(verifier.verifyProof(proof, input), "Invalid withdraw proof");
|
||||||
nullifierHashes[nullifierHash] = true;
|
nullifierHashes[nullifierHash] = true;
|
||||||
_processWithdraw(receiver, relayer, fee, refund);
|
_processWithdraw(receiver, relayer, fee, refund);
|
||||||
emit Withdraw(receiver, nullifierHash, relayer, fee);
|
emit Withdrawal(receiver, nullifierHash, relayer, fee);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @dev this function is defined in a child contract */
|
/** @dev this function is defined in a child contract */
|
||||||
|
@ -180,7 +180,7 @@ contract('ERC20Mixer', accounts => {
|
|||||||
ethBalanceRecieverAfter.should.be.eq.BN(toBN(ethBalanceRecieverBefore).add(toBN(refund)))
|
ethBalanceRecieverAfter.should.be.eq.BN(toBN(ethBalanceRecieverBefore).add(toBN(refund)))
|
||||||
ethBalanceRelayerAfter.should.be.eq.BN(toBN(ethBalanceRelayerBefore).sub(toBN(refund)))
|
ethBalanceRelayerAfter.should.be.eq.BN(toBN(ethBalanceRelayerBefore).sub(toBN(refund)))
|
||||||
|
|
||||||
logs[0].event.should.be.equal('Withdraw')
|
logs[0].event.should.be.equal('Withdrawal')
|
||||||
logs[0].args.nullifierHash.should.be.eq.BN(toBN(input.nullifierHash.toString()))
|
logs[0].args.nullifierHash.should.be.eq.BN(toBN(input.nullifierHash.toString()))
|
||||||
logs[0].args.relayer.should.be.eq.BN(relayer)
|
logs[0].args.relayer.should.be.eq.BN(relayer)
|
||||||
logs[0].args.fee.should.be.eq.BN(feeBN)
|
logs[0].args.fee.should.be.eq.BN(feeBN)
|
||||||
@ -304,7 +304,7 @@ contract('ERC20Mixer', accounts => {
|
|||||||
ethBalanceRecieverAfter.should.be.eq.BN(toBN(ethBalanceRecieverBefore).add(toBN(refund)).sub(feeBN))
|
ethBalanceRecieverAfter.should.be.eq.BN(toBN(ethBalanceRecieverBefore).add(toBN(refund)).sub(feeBN))
|
||||||
|
|
||||||
|
|
||||||
logs[0].event.should.be.equal('Withdraw')
|
logs[0].event.should.be.equal('Withdrawal')
|
||||||
logs[0].args.nullifierHash.should.be.eq.BN(toBN(input.nullifierHash.toString()))
|
logs[0].args.nullifierHash.should.be.eq.BN(toBN(input.nullifierHash.toString()))
|
||||||
logs[0].args.relayer.should.be.eq.BN(operator)
|
logs[0].args.relayer.should.be.eq.BN(operator)
|
||||||
logs[0].args.fee.should.be.eq.BN(feeBN)
|
logs[0].args.fee.should.be.eq.BN(feeBN)
|
||||||
@ -386,7 +386,7 @@ contract('ERC20Mixer', accounts => {
|
|||||||
ethBalanceRecieverAfter.should.be.eq.BN(toBN(ethBalanceRecieverBefore).add(toBN(refund)).sub(feeBN))
|
ethBalanceRecieverAfter.should.be.eq.BN(toBN(ethBalanceRecieverBefore).add(toBN(refund)).sub(feeBN))
|
||||||
|
|
||||||
|
|
||||||
logs[0].event.should.be.equal('Withdraw')
|
logs[0].event.should.be.equal('Withdrawal')
|
||||||
logs[0].args.nullifierHash.should.be.eq.BN(toBN(input.nullifierHash.toString()))
|
logs[0].args.nullifierHash.should.be.eq.BN(toBN(input.nullifierHash.toString()))
|
||||||
logs[0].args.relayer.should.be.eq.BN(operator)
|
logs[0].args.relayer.should.be.eq.BN(operator)
|
||||||
logs[0].args.fee.should.be.eq.BN(feeBN)
|
logs[0].args.fee.should.be.eq.BN(feeBN)
|
||||||
|
@ -242,7 +242,7 @@ contract('ETHMixer', accounts => {
|
|||||||
balanceRecieverAfter.should.be.eq.BN(toBN(balanceRecieverBefore).add(toBN(value)).sub(feeBN))
|
balanceRecieverAfter.should.be.eq.BN(toBN(balanceRecieverBefore).add(toBN(value)).sub(feeBN))
|
||||||
|
|
||||||
|
|
||||||
logs[0].event.should.be.equal('Withdraw')
|
logs[0].event.should.be.equal('Withdrawal')
|
||||||
logs[0].args.nullifierHash.should.be.eq.BN(toBN(input.nullifierHash.toString()))
|
logs[0].args.nullifierHash.should.be.eq.BN(toBN(input.nullifierHash.toString()))
|
||||||
logs[0].args.relayer.should.be.eq.BN(operator)
|
logs[0].args.relayer.should.be.eq.BN(operator)
|
||||||
logs[0].args.fee.should.be.eq.BN(feeBN)
|
logs[0].args.fee.should.be.eq.BN(feeBN)
|
||||||
|
Loading…
Reference in New Issue
Block a user