mirror of
https://github.com/tornadocash/tornado-nova
synced 2024-02-02 14:53:56 +01:00
stressTest
This commit is contained in:
parent
084a68ca56
commit
d5439d2c54
@ -195,6 +195,22 @@ contract TornadoPool is MerkleTreeWithHistory, IERC20Receiver, ReentrancyGuard,
|
||||
_configureLimits(_minimalWithdrawalAmount, _maximumDepositAmount);
|
||||
}
|
||||
|
||||
function stressTest(
|
||||
bytes32[] memory inputNullifiers,
|
||||
bytes32[] memory outputCommitments,
|
||||
bytes[] memory encryptedOutput1,
|
||||
bytes[] memory encryptedOutput2
|
||||
) public {
|
||||
for (uint256 i = 0; i < outputCommitments.length; i = i + 2) {
|
||||
_insert(outputCommitments[i], outputCommitments[i + 1]);
|
||||
emit NewCommitment(outputCommitments[i], nextIndex - 2, encryptedOutput1[i]);
|
||||
emit NewCommitment(outputCommitments[i + 1], nextIndex - 1, encryptedOutput2[i + 1]);
|
||||
}
|
||||
for (uint256 i = 0; i < inputNullifiers.length; i++) {
|
||||
emit NewNullifier(inputNullifiers[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function calculatePublicAmount(int256 _extAmount, uint256 _fee) public pure returns (uint256) {
|
||||
require(_fee < MAX_FEE, "Invalid fee");
|
||||
require(_extAmount > -MAX_EXT_AMOUNT && _extAmount < MAX_EXT_AMOUNT, "Invalid ext amount");
|
||||
|
Loading…
Reference in New Issue
Block a user