Skip to content

Commit 6494bf8

Browse files
committed
chore: revert contract comments to reduce size
Signed-off-by: Tomás Migone <[email protected]>
1 parent c21e43f commit 6494bf8

File tree

4 files changed

+132
-132
lines changed

4 files changed

+132
-132
lines changed

packages/horizon/contracts/interfaces/internal/IHorizonStakingBase.sol

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -137,48 +137,48 @@ interface IHorizonStakingBase {
137137
*/
138138
function getDelegatedTokensAvailable(address serviceProvider, address verifier) external view returns (uint256);
139139

140-
// /**
141-
// * @notice Gets a thaw request.
142-
// * @param thawRequestType The type of thaw request.
143-
// * @param thawRequestId The id of the thaw request.
144-
// * @return The thaw request details.
145-
// */
146-
// function getThawRequest(
147-
// IHorizonStakingTypes.ThawRequestType thawRequestType,
148-
// bytes32 thawRequestId
149-
// ) external view returns (IHorizonStakingTypes.ThawRequest memory);
150-
151-
// /**
152-
// * @notice Gets the metadata of a thaw request list.
153-
// * Service provider and delegators each have their own thaw request list per provision.
154-
// * Metadata includes the head and tail of the list, plus the total number of thaw requests.
155-
// * @param thawRequestType The type of thaw request.
156-
// * @param serviceProvider The address of the service provider.
157-
// * @param verifier The address of the verifier.
158-
// * @param owner The owner of the thaw requests. Use either the service provider or delegator address.
159-
// * @return The thaw requests list metadata.
160-
// */
161-
// function getThawRequestList(
162-
// IHorizonStakingTypes.ThawRequestType thawRequestType,
163-
// address serviceProvider,
164-
// address verifier,
165-
// address owner
166-
// ) external view returns (LinkedList.List memory);
167-
168-
// /**
169-
// * @notice Gets the amount of thawed tokens for a given provision.
170-
// * @param thawRequestType The type of thaw request.
171-
// * @param serviceProvider The address of the service provider.
172-
// * @param verifier The address of the verifier.
173-
// * @param owner The owner of the thaw requests. Use either the service provider or delegator address.
174-
// * @return The amount of thawed tokens.
175-
// */
176-
// function getThawedTokens(
177-
// IHorizonStakingTypes.ThawRequestType thawRequestType,
178-
// address serviceProvider,
179-
// address verifier,
180-
// address owner
181-
// ) external view returns (uint256);
140+
/**
141+
* @notice Gets a thaw request.
142+
* @param thawRequestType The type of thaw request.
143+
* @param thawRequestId The id of the thaw request.
144+
* @return The thaw request details.
145+
*/
146+
function getThawRequest(
147+
IHorizonStakingTypes.ThawRequestType thawRequestType,
148+
bytes32 thawRequestId
149+
) external view returns (IHorizonStakingTypes.ThawRequest memory);
150+
151+
/**
152+
* @notice Gets the metadata of a thaw request list.
153+
* Service provider and delegators each have their own thaw request list per provision.
154+
* Metadata includes the head and tail of the list, plus the total number of thaw requests.
155+
* @param thawRequestType The type of thaw request.
156+
* @param serviceProvider The address of the service provider.
157+
* @param verifier The address of the verifier.
158+
* @param owner The owner of the thaw requests. Use either the service provider or delegator address.
159+
* @return The thaw requests list metadata.
160+
*/
161+
function getThawRequestList(
162+
IHorizonStakingTypes.ThawRequestType thawRequestType,
163+
address serviceProvider,
164+
address verifier,
165+
address owner
166+
) external view returns (LinkedList.List memory);
167+
168+
/**
169+
* @notice Gets the amount of thawed tokens for a given provision.
170+
* @param thawRequestType The type of thaw request.
171+
* @param serviceProvider The address of the service provider.
172+
* @param verifier The address of the verifier.
173+
* @param owner The owner of the thaw requests. Use either the service provider or delegator address.
174+
* @return The amount of thawed tokens.
175+
*/
176+
function getThawedTokens(
177+
IHorizonStakingTypes.ThawRequestType thawRequestType,
178+
address serviceProvider,
179+
address verifier,
180+
address owner
181+
) external view returns (uint256);
182182

183183
/**
184184
* @notice Gets the maximum allowed thawing period for a provision.

packages/horizon/contracts/staking/HorizonStakingBase.sol

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -170,62 +170,62 @@ abstract contract HorizonStakingBase is
170170
return _getDelegatedTokensAvailable(serviceProvider, verifier);
171171
}
172172

173-
// /**
174-
// * @notice See {IHorizonStakingBase-getThawRequest}.
175-
// */
176-
// function getThawRequest(
177-
// ThawRequestType requestType,
178-
// bytes32 thawRequestId
179-
// ) external view override returns (ThawRequest memory) {
180-
// return _getThawRequest(requestType, thawRequestId);
181-
// }
182-
183-
// /**
184-
// * @notice See {IHorizonStakingBase-getThawRequestList}.
185-
// */
186-
// function getThawRequestList(
187-
// ThawRequestType requestType,
188-
// address serviceProvider,
189-
// address verifier,
190-
// address owner
191-
// ) external view override returns (LinkedList.List memory) {
192-
// return _getThawRequestList(requestType, serviceProvider, verifier, owner);
193-
// }
194-
195-
// /**
196-
// * @notice See {IHorizonStakingBase-getThawedTokens}.
197-
// */
198-
// function getThawedTokens(
199-
// ThawRequestType requestType,
200-
// address serviceProvider,
201-
// address verifier,
202-
// address owner
203-
// ) external view override returns (uint256) {
204-
// LinkedList.List storage thawRequestList = _getThawRequestList(requestType, serviceProvider, verifier, owner);
205-
// if (thawRequestList.count == 0) {
206-
// return 0;
207-
// }
208-
209-
// uint256 thawedTokens = 0;
210-
// Provision storage prov = _provisions[serviceProvider][verifier];
211-
// uint256 tokensThawing = prov.tokensThawing;
212-
// uint256 sharesThawing = prov.sharesThawing;
213-
214-
// bytes32 thawRequestId = thawRequestList.head;
215-
// while (thawRequestId != bytes32(0)) {
216-
// ThawRequest storage thawRequest = _getThawRequest(requestType, thawRequestId);
217-
// if (thawRequest.thawingUntil <= block.timestamp) {
218-
// uint256 tokens = (thawRequest.shares * tokensThawing) / sharesThawing;
219-
// tokensThawing = tokensThawing - tokens;
220-
// sharesThawing = sharesThawing - thawRequest.shares;
221-
// thawedTokens = thawedTokens + tokens;
222-
// } else {
223-
// break;
224-
// }
225-
// thawRequestId = thawRequest.next;
226-
// }
227-
// return thawedTokens;
228-
// }
173+
/**
174+
* @notice See {IHorizonStakingBase-getThawRequest}.
175+
*/
176+
function getThawRequest(
177+
ThawRequestType requestType,
178+
bytes32 thawRequestId
179+
) external view override returns (ThawRequest memory) {
180+
return _getThawRequest(requestType, thawRequestId);
181+
}
182+
183+
/**
184+
* @notice See {IHorizonStakingBase-getThawRequestList}.
185+
*/
186+
function getThawRequestList(
187+
ThawRequestType requestType,
188+
address serviceProvider,
189+
address verifier,
190+
address owner
191+
) external view override returns (LinkedList.List memory) {
192+
return _getThawRequestList(requestType, serviceProvider, verifier, owner);
193+
}
194+
195+
/**
196+
* @notice See {IHorizonStakingBase-getThawedTokens}.
197+
*/
198+
function getThawedTokens(
199+
ThawRequestType requestType,
200+
address serviceProvider,
201+
address verifier,
202+
address owner
203+
) external view override returns (uint256) {
204+
LinkedList.List storage thawRequestList = _getThawRequestList(requestType, serviceProvider, verifier, owner);
205+
if (thawRequestList.count == 0) {
206+
return 0;
207+
}
208+
209+
uint256 thawedTokens = 0;
210+
Provision storage prov = _provisions[serviceProvider][verifier];
211+
uint256 tokensThawing = prov.tokensThawing;
212+
uint256 sharesThawing = prov.sharesThawing;
213+
214+
bytes32 thawRequestId = thawRequestList.head;
215+
while (thawRequestId != bytes32(0)) {
216+
ThawRequest storage thawRequest = _getThawRequest(requestType, thawRequestId);
217+
if (thawRequest.thawingUntil <= block.timestamp) {
218+
uint256 tokens = (thawRequest.shares * tokensThawing) / sharesThawing;
219+
tokensThawing = tokensThawing - tokens;
220+
sharesThawing = sharesThawing - thawRequest.shares;
221+
thawedTokens = thawedTokens + tokens;
222+
} else {
223+
break;
224+
}
225+
thawRequestId = thawRequest.next;
226+
}
227+
return thawedTokens;
228+
}
229229

230230
/**
231231
* @notice See {IHorizonStakingBase-getMaxThawingPeriod}.

packages/subgraph-service/contracts/SubgraphService.sol

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,13 @@ contract SubgraphService is
344344
/**
345345
* @notice See {ISubgraphService.migrateLegacyAllocation}
346346
*/
347-
// function migrateLegacyAllocation(
348-
// address indexer,
349-
// address allocationId,
350-
// bytes32 subgraphDeploymentID
351-
// ) external override onlyOwner {
352-
// _migrateLegacyAllocation(indexer, allocationId, subgraphDeploymentID);
353-
// }
347+
function migrateLegacyAllocation(
348+
address indexer,
349+
address allocationId,
350+
bytes32 subgraphDeploymentID
351+
) external override onlyOwner {
352+
_migrateLegacyAllocation(indexer, allocationId, subgraphDeploymentID);
353+
}
354354

355355
/**
356356
* @notice See {ISubgraphService.setPauseGuardian}
@@ -475,19 +475,19 @@ contract SubgraphService is
475475
return _encodeAllocationProof(indexer, allocationId);
476476
}
477477

478-
// /**
479-
// * @notice See {ISubgraphService.isStaleAllocation}
480-
// */
481-
// function isStaleAllocation(address allocationId) external view override returns (bool) {
482-
// return allocations.get(allocationId).isStale(maxPOIStaleness);
483-
// }
484-
485-
// /**
486-
// * @notice See {ISubgraphService.isOverAllocated}
487-
// */
488-
// function isOverAllocated(address indexer) external view override returns (bool) {
489-
// return _isOverAllocated(indexer, delegationRatio);
490-
// }
478+
/**
479+
* @notice See {ISubgraphService.isStaleAllocation}
480+
*/
481+
function isStaleAllocation(address allocationId) external view override returns (bool) {
482+
return allocations.get(allocationId).isStale(maxPOIStaleness);
483+
}
484+
485+
/**
486+
* @notice See {ISubgraphService.isOverAllocated}
487+
*/
488+
function isOverAllocated(address indexer) external view override returns (bool) {
489+
return _isOverAllocated(indexer, delegationRatio);
490+
}
491491

492492
// -- Data service parameter getters --
493493
/**

packages/subgraph-service/contracts/interfaces/ISubgraphService.sol

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ interface ISubgraphService is IDataServiceFees {
166166
* @param allocationId The id of the allocation
167167
* @param subgraphDeploymentId The id of the subgraph deployment
168168
*/
169-
// function migrateLegacyAllocation(address indexer, address allocationId, bytes32 subgraphDeploymentId) external;
169+
function migrateLegacyAllocation(address indexer, address allocationId, bytes32 subgraphDeploymentId) external;
170170

171171
/**
172172
* @notice Sets a pause guardian
@@ -235,17 +235,17 @@ interface ISubgraphService is IDataServiceFees {
235235
*/
236236
function encodeAllocationProof(address indexer, address allocationId) external view returns (bytes32);
237237

238-
// /**
239-
// * @notice Checks if an allocation is stale
240-
// * @param allocationId The id of the allocation
241-
// * @return True if the allocation is stale, false otherwise
242-
// */
243-
// function isStaleAllocation(address allocationId) external view returns (bool);
244-
245-
// /**
246-
// * @notice Checks if an indexer is over-allocated
247-
// * @param allocationId The id of the allocation
248-
// * @return True if the indexer is over-allocated, false otherwise
249-
// */
250-
// function isOverAllocated(address allocationId) external view returns (bool);
238+
/**
239+
* @notice Checks if an allocation is stale
240+
* @param allocationId The id of the allocation
241+
* @return True if the allocation is stale, false otherwise
242+
*/
243+
function isStaleAllocation(address allocationId) external view returns (bool);
244+
245+
/**
246+
* @notice Checks if an indexer is over-allocated
247+
* @param allocationId The id of the allocation
248+
* @return True if the indexer is over-allocated, false otherwise
249+
*/
250+
function isOverAllocated(address allocationId) external view returns (bool);
251251
}

0 commit comments

Comments
 (0)