Skip to content

Commit

Permalink
fix: remove redundant getDisputePeriod function
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonBoi9001 committed Oct 2, 2024
1 parent cf2109f commit f79dc2e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
8 changes: 0 additions & 8 deletions packages/subgraph-service/contracts/DisputeManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,6 @@ contract DisputeManager is
return fishermanRewardCut;
}

/**
* @notice Get the dispute period.
* @return Dispute period in seconds
*/
function getDisputePeriod() external view override returns (uint64) {
return disputePeriod;
}

/**
* @notice Get the stake snapshot for an indexer.
* @param indexer The indexer address
Expand Down
6 changes: 3 additions & 3 deletions packages/subgraph-service/contracts/SubgraphService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -475,11 +475,11 @@ contract SubgraphService is
/**
* @notice Getter for the accepted thawing period range for provisions
* @dev This override ensures {ProvisionManager} uses the thawing period from the {DisputeManager}
* @return min The minimum thawing period which is defined by {DisputeManager-getDisputePeriod}
* @return min The minimum thawing period which is defined by {DisputeManager-disputePeriod}
* @return max The maximum is unbounded
*/
function _getThawingPeriodRange() internal view override returns (uint64 min, uint64 max) {
uint64 disputePeriod = _disputeManager().getDisputePeriod();
uint64 disputePeriod = _disputeManager().disputePeriod();
return (disputePeriod, type(uint64).max);
}

Expand Down Expand Up @@ -549,7 +549,7 @@ contract SubgraphService is
if (tokensCollected > 0) {
// lock stake as economic security for fees
uint256 tokensToLock = tokensCollected * stakeToFeesRatio;
uint256 unlockTimestamp = block.timestamp + _disputeManager().getDisputePeriod();
uint256 unlockTimestamp = block.timestamp + _disputeManager().disputePeriod();
_lockStake(indexer, tokensToLock, unlockTimestamp);

if (tokensCurators > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@ interface IDisputeManager {

function getVerifierCut() external view returns (uint32);

function getDisputePeriod() external view returns (uint64);

function isDisputeCreated(bytes32 disputeId) external view returns (bool);

function encodeReceipt(Attestation.Receipt memory receipt) external view returns (bytes32);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ contract SubgraphServiceTest is SubgraphServiceSharedTest {
LinkedList.List memory claimsList = _getClaimList(_indexer);
bytes32 claimId = _buildStakeClaimId(_indexer, claimsList.nonce - 1);
IDataServiceFees.StakeClaim memory stakeClaim = _getStakeClaim(claimId);
uint64 disputePeriod = disputeManager.getDisputePeriod();
uint64 disputePeriod = disputeManager.disputePeriod();
assertEq(stakeClaim.tokens, tokensToLock);
assertEq(stakeClaim.createdAt, block.timestamp);
assertEq(stakeClaim.releaseAt, block.timestamp + disputePeriod);
Expand Down

0 comments on commit f79dc2e

Please sign in to comment.