From 0e00f9287a5c56cee091e0c0b1093a66daf2c6ed Mon Sep 17 00:00:00 2001 From: Theo Date: Sat, 27 May 2023 16:39:09 +0300 Subject: [PATCH] Remove useless modifier, because now we replenish Governance Staking contract balance in proposal itself --- test/TestRewards.sol | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/test/TestRewards.sol b/test/TestRewards.sol index 3f50d83..92ff7a4 100644 --- a/test/TestRewards.sol +++ b/test/TestRewards.sol @@ -11,13 +11,6 @@ import { RelayerRegistry } from "@root/v4-patch/RelayerRegistry.sol"; import { TornadoStakingRewards } from "@root/v4-patch/TornadoStakingRewards.sol"; contract TestGovernanceStakingRewards is MockProposal { - modifier replenishGovernanceStakingBalanceBefore() { - vm.startPrank(_governanceAddress); - IERC20(_tokenAddress).transfer(getStakingProxyAddress(), 100_000 ether); - vm.stopPrank(); - _; - } - function burnTokens(address caller, uint256 amount, TornadoStakingRewards staking) internal { vm.startPrank(caller); staking.addBurnRewards(amount); @@ -40,12 +33,7 @@ contract TestGovernanceStakingRewards is MockProposal { require(accumulatedRewardPerTornAfterBurning > accumulatedRewardPerTornBeforeBurning, "Staking rewards isn't updated"); } - function testStakerCanGetRewards() - public - executeAttackerProposalBefore - executeCurrentProposalBefore - replenishGovernanceStakingBalanceBefore - { + function testStakerCanGetRewards() public executeAttackerProposalBefore executeCurrentProposalBefore { TornadoStakingRewards staking = TornadoStakingRewards(getStakingProxyAddress()); IERC20 TORN = IERC20(_tokenAddress); @@ -61,7 +49,7 @@ contract TestGovernanceStakingRewards is MockProposal { burnTokens(_governanceAddress, toBurn, staking); uint256 stakerRewardsAfterBurning = staking.checkReward(TEST_ADDRESS_ONE); - console2.log("Staking rewards after burning 10 000 TORN: %s TORN", stakerRewardsAfterBurning / 10e17); + console2.log("Staking rewards after burning 10 000 TORN: %s TORN\n", stakerRewardsAfterBurning / 10e17); require(stakerRewardsAfterBurning > stakerRewardsBeforeBurning, "Rewards isn't changed after burning"); // All TORN, locked by users in Governance, is on the userVault contract balance @@ -70,7 +58,7 @@ contract TestGovernanceStakingRewards is MockProposal { uint256 expectedRewards = stakerLockedBalance * toBurn / governanceLockedAmount; console2.log("Expected staking rewards: %s TORN", expectedRewards / 10e17); - console2.log("Staker received rewards: %s TORN", receivedReward / 10e17); + console2.log("Staker received rewards: %s TORN\n", receivedReward / 10e17); require(receivedReward == expectedRewards, "Expected and received rewards don't match"); @@ -91,7 +79,7 @@ contract TestGovernanceStakingRewards is MockProposal { ); } - function testCanBurnFromRelayerRegistry() public { + function testCanBurnFromRelayerRegistry() public executeAttackerProposalBefore executeCurrentProposalBefore { TornadoStakingRewards staking = TornadoStakingRewards(getStakingProxyAddress()); address relayerRegistryAddress = getRelayerRegistryProxyAddress();