Skip to content

Commit 57f549c

Browse files
committed
fix: remove redundant getDisputePeriod function.
1 parent d7484ed commit 57f549c

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

packages/subgraph-service/contracts/DisputeManager.sol

-8
Original file line numberDiff line numberDiff line change
@@ -370,14 +370,6 @@ contract DisputeManager is
370370
return fishermanRewardCut;
371371
}
372372

373-
/**
374-
* @notice Get the dispute period.
375-
* @return Dispute period in seconds
376-
*/
377-
function getDisputePeriod() external view override returns (uint64) {
378-
return disputePeriod;
379-
}
380-
381373
/**
382374
* @notice Get the stake snapshot for an indexer.
383375
* @param indexer The indexer address

packages/subgraph-service/contracts/SubgraphService.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -461,11 +461,11 @@ contract SubgraphService is
461461
/**
462462
* @notice Getter for the accepted thawing period range for provisions
463463
* @dev This override ensures {ProvisionManager} uses the thawing period from the {DisputeManager}
464-
* @return min The minimum thawing period which is defined by {DisputeManager-getDisputePeriod}
464+
* @return min The minimum thawing period which is defined by {DisputeManager-disputePeriod}
465465
* @return max The maximum is unbounded
466466
*/
467467
function _getThawingPeriodRange() internal view override returns (uint64 min, uint64 max) {
468-
uint64 disputePeriod = _disputeManager().getDisputePeriod();
468+
uint64 disputePeriod = _disputeManager().disputePeriod();
469469
return (disputePeriod, type(uint64).max);
470470
}
471471

@@ -535,7 +535,7 @@ contract SubgraphService is
535535
if (tokensCollected > 0) {
536536
// lock stake as economic security for fees
537537
uint256 tokensToLock = tokensCollected * stakeToFeesRatio;
538-
uint256 unlockTimestamp = block.timestamp + _disputeManager().getDisputePeriod();
538+
uint256 unlockTimestamp = block.timestamp + _disputeManager().disputePeriod();
539539
_lockStake(indexer, tokensToLock, unlockTimestamp);
540540

541541
if (tokensCurators > 0) {

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

-2
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,6 @@ interface IDisputeManager {
216216

217217
function getVerifierCut() external view returns (uint32);
218218

219-
function getDisputePeriod() external view returns (uint64);
220-
221219
function isDisputeCreated(bytes32 disputeId) external view returns (bool);
222220

223221
function encodeReceipt(Attestation.Receipt memory receipt) external view returns (bytes32);

packages/subgraph-service/test/subgraphService/SubgraphService.t.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ contract SubgraphServiceTest is SubgraphServiceSharedTest {
325325
LinkedList.List memory claimsList = _getClaimList(_indexer);
326326
bytes32 claimId = _buildStakeClaimId(_indexer, claimsList.nonce - 1);
327327
IDataServiceFees.StakeClaim memory stakeClaim = _getStakeClaim(claimId);
328-
uint64 disputePeriod = disputeManager.getDisputePeriod();
328+
uint64 disputePeriod = disputeManager.disputePeriod();
329329
assertEq(stakeClaim.tokens, tokensToLock);
330330
assertEq(stakeClaim.createdAt, block.timestamp);
331331
assertEq(stakeClaim.releaseAt, block.timestamp + disputePeriod);

0 commit comments

Comments
 (0)