11// SPDX-License-Identifier: MIT
22pragma solidity 0.8.33 ;
33
4- import { IGraphPayments } from "@graphprotocol/horizon /contracts/interfaces /IGraphPayments.sol " ;
5- import { IRecurringCollector } from "@graphprotocol/horizon /contracts/interfaces /IRecurringCollector.sol " ;
6- import { IPaymentsCollector } from "@graphprotocol/horizon /contracts/interfaces /IPaymentsCollector.sol " ;
4+ import { IGraphPayments } from "@graphprotocol/interfaces /contracts/horizon /IGraphPayments.sol " ;
5+ import { IRecurringCollector } from "@graphprotocol/interfaces /contracts/horizon /IRecurringCollector.sol " ;
6+ import { IPaymentsCollector } from "@graphprotocol/interfaces /contracts/horizon /IPaymentsCollector.sol " ;
77import { PausableUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol " ;
88import { ProvisionManager } from "@graphprotocol/horizon/contracts/data-service/utilities/ProvisionManager.sol " ;
99
10- import { ISubgraphService } from "../../../../contracts/interfaces/ISubgraphService.sol " ;
10+ import { ISubgraphService } from "@graphprotocol/interfaces/contracts/subgraph-service/ISubgraphService.sol " ;
11+ import { IAllocation } from "@graphprotocol/interfaces/contracts/subgraph-service/internal/IAllocation.sol " ;
1112import { Allocation } from "../../../../contracts/libraries/Allocation.sol " ;
1213import { AllocationHandler } from "../../../../contracts/libraries/AllocationHandler.sol " ;
1314import { IndexingAgreement } from "../../../../contracts/libraries/IndexingAgreement.sol " ;
@@ -49,7 +50,7 @@ contract SubgraphServiceIndexingAgreementCollectTest is SubgraphServiceIndexingA
4950 maxSlippage: type (uint256 ).max
5051 })
5152 );
52- uint256 tokensCollected = bound (unboundedTokensCollected, 1 , indexerState.tokens / stakeToFeesRatio );
53+ uint256 tokensCollected = bound (unboundedTokensCollected, 1 , indexerState.tokens / STAKE_TO_FEES_RATIO );
5354
5455 vm.mockCall (
5556 address (recurringCollector),
@@ -68,7 +69,7 @@ contract SubgraphServiceIndexingAgreementCollectTest is SubgraphServiceIndexingA
6869
6970 assertEq (
7071 subgraphService.feesProvisionTracker (indexerState.addr),
71- tokensCollected * stakeToFeesRatio ,
72+ tokensCollected * STAKE_TO_FEES_RATIO ,
7273 "Should be exactly locked tokens "
7374 );
7475 }
@@ -122,18 +123,18 @@ contract SubgraphServiceIndexingAgreementCollectTest is SubgraphServiceIndexingA
122123 uint256 entities ,
123124 bytes32 poi
124125 ) public withSafeIndexerOrOperator (indexer) {
125- uint256 tokens = bound (unboundedTokens, 1 , minimumProvisionTokens - 1 );
126+ uint256 tokens = bound (unboundedTokens, 1 , MINIMUM_PROVISION_TOKENS - 1 );
126127 uint256 currentEpochBlock = epochManager.currentEpochBlock ();
127128 mint (indexer, tokens);
128129 resetPrank (indexer);
129- _createProvision (indexer, tokens, fishermanRewardPercentage, disputePeriod );
130+ _createProvision (indexer, tokens, FISHERMAN_REWARD_PERCENTAGE, DISPUTE_PERIOD );
130131
131132 bytes memory expectedErr = abi.encodeWithSelector (
132133 ProvisionManager.ProvisionManagerInvalidValue.selector ,
133134 "tokens " ,
134135 tokens,
135- minimumProvisionTokens ,
136- maximumProvisionTokens
136+ MINIMUM_PROVISION_TOKENS ,
137+ MAXIMUM_PROVISION_TOKENS
137138 );
138139 vm.expectRevert (expectedErr);
139140 subgraphService.collect (
@@ -150,11 +151,11 @@ contract SubgraphServiceIndexingAgreementCollectTest is SubgraphServiceIndexingA
150151 uint256 entities ,
151152 bytes32 poi
152153 ) public withSafeIndexerOrOperator (indexer) {
153- uint256 tokens = bound (unboundedTokens, minimumProvisionTokens , MAX_TOKENS);
154+ uint256 tokens = bound (unboundedTokens, MINIMUM_PROVISION_TOKENS , MAX_TOKENS);
154155 uint256 currentEpochBlock = epochManager.currentEpochBlock ();
155156 mint (indexer, tokens);
156157 resetPrank (indexer);
157- _createProvision (indexer, tokens, fishermanRewardPercentage, disputePeriod );
158+ _createProvision (indexer, tokens, FISHERMAN_REWARD_PERCENTAGE, DISPUTE_PERIOD );
158159 bytes memory expectedErr = abi.encodeWithSelector (
159160 ISubgraphService.SubgraphServiceIndexerNotRegistered.selector ,
160161 indexer
@@ -192,7 +193,7 @@ contract SubgraphServiceIndexingAgreementCollectTest is SubgraphServiceIndexingA
192193 IndexerState memory indexerState = _withIndexer (ctx);
193194 uint256 currentEpochBlock = epochManager.currentEpochBlock ();
194195
195- bytes memory expectedErr = abi.encodeWithSelector (Allocation .AllocationDoesNotExist.selector , address (0 ));
196+ bytes memory expectedErr = abi.encodeWithSelector (IAllocation .AllocationDoesNotExist.selector , address (0 ));
196197 vm.expectRevert (expectedErr);
197198 resetPrank (indexerState.addr);
198199 subgraphService.collect (
@@ -290,7 +291,7 @@ contract SubgraphServiceIndexingAgreementCollectTest is SubgraphServiceIndexingA
290291 IndexerState memory indexerState = _withIndexer (ctx);
291292 (, bytes16 acceptedAgreementId ) = _withAcceptedIndexingAgreement (ctx, indexerState);
292293
293- skip (maxPOIStaleness + 1 );
294+ skip (MAX_POI_STALENESS + 1 );
294295 resetPrank (indexerState.addr);
295296 subgraphService.closeStaleAllocation (indexerState.allocationId);
296297
0 commit comments