From 3e5a1689dd15fc9ef1183d0dbd3e3e86ff57a574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Fri, 6 Sep 2024 17:33:15 -0300 Subject: [PATCH] fix: remove comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- .../HorizonStakingShared.t.sol | 54 ++----------------- .../test/staking/allocation/allocation.t.sol | 23 -------- 2 files changed, 5 insertions(+), 72 deletions(-) diff --git a/packages/horizon/test/shared/horizon-staking/HorizonStakingShared.t.sol b/packages/horizon/test/shared/horizon-staking/HorizonStakingShared.t.sol index 83980c3a9..2f81bb0d1 100644 --- a/packages/horizon/test/shared/horizon-staking/HorizonStakingShared.t.sol +++ b/packages/horizon/test/shared/horizon-staking/HorizonStakingShared.t.sol @@ -1711,12 +1711,6 @@ abstract contract HorizonStakingSharedTest is GraphBaseTest { return vm.load(address(staking), bytes32(slot)) == bytes32(uint256(1)); } - // function _setStorage_DeprecatedThawingPeriod(uint32 _thawingPeriod) internal { - // uint256 slot = 13; - // bytes32 value = bytes32(uint256(_thawingPeriod)); - // vm.store(address(staking), bytes32(slot), value); - // } - function _setStorage_DeprecatedThawingPeriod(uint32 _thawingPeriod) internal { uint256 slot = 13; @@ -1960,44 +1954,6 @@ abstract contract HorizonStakingSharedTest is GraphBaseTest { vm.store(address(staking), tokensSlot, bytes32(tokens)); } - // function _setStorage_RebateParameters( - // uint32 alphaNumerator, - // uint32 alphaDenominator, - // uint32 lambdaNumerator, - // uint32 lambdaDenominator - // ) internal { - // // Store alpha numerator and denominator - // uint256 alphaSlot = 13; - // uint256 alphaNumeratorOffset = 20; - // uint256 alphaDenominatorOffset = 24; - // bytes32 alphaValues = bytes32( - // (uint256(alphaNumerator) << (8 * alphaNumeratorOffset)) | - // (uint256(alphaDenominator) << (8 * alphaDenominatorOffset)) - // ); - // vm.store(address(staking), bytes32(alphaSlot), alphaValues); - - // // Store lambda numerator and denominator - // uint256 lambdaSlot = 25; - // uint256 lambdaNumeratorOffset = 20; - // uint256 lambdaDenominatorOffset = 24; - // bytes32 lambdaValues = bytes32( - // (uint256(lambdaNumerator) << (8 * lambdaNumeratorOffset)) | - // (uint256(lambdaDenominator) << (8 * lambdaDenominatorOffset)) - // ); - // vm.store(address(staking), bytes32(lambdaSlot), lambdaValues); - - // ( - // uint32 readAlphaNumerator, - // uint32 readAlphaDenominator, - // uint32 readLambdaNumerator, - // uint32 readLambdaDenominator - // ) = _getStorage_RebateParameters(); - // assertEq(readAlphaNumerator, alphaNumerator); - // assertEq(readAlphaDenominator, alphaDenominator); - // assertEq(readLambdaNumerator, lambdaNumerator); - // assertEq(readLambdaDenominator, lambdaDenominator); - // } - function _setStorage_RebateParameters( uint32 alphaNumerator, uint32 alphaDenominator, @@ -2061,16 +2017,16 @@ abstract contract HorizonStakingSharedTest is GraphBaseTest { // Read alpha numerator and denominator uint256 alphaSlot = 13; uint256 alphaValues = uint256(vm.load(address(staking), bytes32(alphaSlot))); - uint32 alphaNumerator = uint32(alphaValues >> 160); - uint32 alphaDenominator = uint32(alphaValues >> 192); + uint32 alphaNumerator_ = uint32(alphaValues >> 160); + uint32 alphaDenominator_ = uint32(alphaValues >> 192); // Read lambda numerator and denominator uint256 lambdaSlot = 25; uint256 lambdaValues = uint256(vm.load(address(staking), bytes32(lambdaSlot))); - uint32 lambdaNumerator = uint32(lambdaValues >> 160); - uint32 lambdaDenominator = uint32(lambdaValues >> 192); + uint32 lambdaNumerator_ = uint32(lambdaValues >> 160); + uint32 lambdaDenominator_ = uint32(lambdaValues >> 192); - return (alphaNumerator, alphaDenominator, lambdaNumerator, lambdaDenominator); + return (alphaNumerator_, alphaDenominator_, lambdaNumerator_, lambdaDenominator_); } // function _setStorage_ProtocolTaxAndCuration(uint32 curationPercentage, uint32 taxPercentage) private { diff --git a/packages/horizon/test/staking/allocation/allocation.t.sol b/packages/horizon/test/staking/allocation/allocation.t.sol index 1c611ddaa..c5cb92609 100644 --- a/packages/horizon/test/staking/allocation/allocation.t.sol +++ b/packages/horizon/test/staking/allocation/allocation.t.sol @@ -12,29 +12,6 @@ contract HorizonStakingAllocationTest is HorizonStakingTest { * TESTS */ - // function testAllocation_GetAllocation(uint256 tokens) public useIndexer useAllocation(tokens) { - // IHorizonStakingExtension.Allocation memory allocation = staking.getAllocation(_allocationId); - // assertEq(allocation.indexer, _allocation.indexer); - // assertEq(allocation.subgraphDeploymentID, _allocation.subgraphDeploymentID); - // assertEq(allocation.tokens, _allocation.tokens); - // assertEq(allocation.createdAtEpoch, _allocation.createdAtEpoch); - // assertEq(allocation.closedAtEpoch, _allocation.closedAtEpoch); - // assertEq(allocation.collectedFees, _allocation.collectedFees); - // assertEq(allocation.__DEPRECATED_effectiveAllocation, _allocation.__DEPRECATED_effectiveAllocation); - // assertEq(allocation.accRewardsPerAllocatedToken, _allocation.accRewardsPerAllocatedToken); - // assertEq(allocation.distributedRebates, _allocation.distributedRebates); - // } - - // function testAllocation_GetAllocationData(uint256 tokens) public useIndexer useAllocation(tokens) { - // (address indexer, bytes32 subgraphDeploymentID, uint256 tokens_, uint256 accRewardsPerAllocatedToken, uint256 accRewardsPending) = - // staking.getAllocationData(_allocationId); - // assertEq(indexer, _allocation.indexer); - // assertEq(subgraphDeploymentID, _allocation.subgraphDeploymentID); - // assertEq(tokens_, _allocation.tokens); - // assertEq(accRewardsPerAllocatedToken, _allocation.accRewardsPerAllocatedToken); - // assertEq(accRewardsPending, 0); - // } - function testAllocation_GetAllocationState_Active(uint256 tokens) public useIndexer useAllocation(tokens) { IHorizonStakingExtension.AllocationState state = staking.getAllocationState(_allocationId); assertEq(uint16(state), uint16(IHorizonStakingExtension.AllocationState.Active));