@@ -13,9 +13,7 @@ import { ILegacyAllocation } from "@graphprotocol/interfaces/contracts/subgraph-
1313import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol " ;
1414import { MulticallUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol " ;
1515import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol " ;
16- import {
17- DataServicePausableUpgradeable
18- } from "@graphprotocol/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol " ;
16+ import { DataServicePausableUpgradeable } from "@graphprotocol/horizon/contracts/data-service/extensions/DataServicePausableUpgradeable.sol " ;
1917import { DataService } from "@graphprotocol/horizon/contracts/data-service/DataService.sol " ;
2018import { DataServiceFees } from "@graphprotocol/horizon/contracts/data-service/extensions/DataServiceFees.sol " ;
2119import { Directory } from "./utilities/Directory.sol " ;
@@ -54,7 +52,7 @@ contract SubgraphService is
5452 * @param indexer The address of the indexer
5553 */
5654 modifier onlyRegisteredIndexer (address indexer ) {
57- require (indexers[indexer].registeredAt != 0 , SubgraphServiceIndexerNotRegistered (indexer));
55+ require (bytes ( indexers[indexer].url). length > 0 , SubgraphServiceIndexerNotRegistered (indexer));
5856 _;
5957 }
6058
@@ -98,7 +96,6 @@ contract SubgraphService is
9896 * @dev Implements {IDataService.register}
9997 *
10098 * Requirements:
101- * - The indexer must not be already registered
10299 * - The URL must not be empty
103100 * - The provision must be valid according to the subgraph service rules
104101 *
@@ -123,13 +120,10 @@ contract SubgraphService is
123120
124121 require (bytes (url).length > 0 , SubgraphServiceEmptyUrl ());
125122 require (bytes (geohash).length > 0 , SubgraphServiceEmptyGeohash ());
126- require (indexers[indexer].registeredAt == 0 , SubgraphServiceIndexerAlreadyRegistered ());
127123
128124 // Register the indexer
129- indexers[indexer] = Indexer ({ registeredAt: block .timestamp , url: url, geoHash: geohash });
130- if (paymentsDestination_ != address (0 )) {
131- _setPaymentsDestination (indexer, paymentsDestination_);
132- }
125+ indexers[indexer] = Indexer ({ url: url, geoHash: geohash });
126+ _setPaymentsDestination (indexer, paymentsDestination_);
133127
134128 emit ServiceProviderRegistered (indexer, data);
135129 }
0 commit comments