diff --git a/packages/horizon/test/data-service/DataService.t.sol b/packages/horizon/test/data-service/DataService.t.sol index d79733bf7..b608d2b7d 100644 --- a/packages/horizon/test/data-service/DataService.t.sol +++ b/packages/horizon/test/data-service/DataService.t.sol @@ -362,7 +362,7 @@ contract DataServiceTest is HorizonStakingSharedTest { } function _assert_delegationRatio(uint32 ratio) internal view { - uint32 _delegationRatio = ProvisionManager.delegationRatio(); + uint32 _delegationRatio = delegationRatio; assertEq(_delegationRatio, ratio); } diff --git a/packages/horizon/test/data-service/DataServiceUpgradeable.t.sol b/packages/horizon/test/data-service/DataServiceUpgradeable.t.sol index 190ebe3f0..d53a76ddd 100644 --- a/packages/horizon/test/data-service/DataServiceUpgradeable.t.sol +++ b/packages/horizon/test/data-service/DataServiceUpgradeable.t.sol @@ -13,7 +13,7 @@ contract DataServiceUpgradeableTest is GraphBaseTest { // via proxy - ensure that the proxy was initialized correctly // these calls validate proxy storage was correctly initialized - uint32 delegationRatio = ProvisionManager.delegationRatio(); + uint32 delegationRatio = dataService.delegationRatio(); assertEq(delegationRatio, type(uint32).min); (uint256 minTokens, uint256 maxTokens) = dataService.getProvisionTokensRange(); diff --git a/packages/horizon/test/data-service/extensions/DataServicePausableUpgradeable.t.sol b/packages/horizon/test/data-service/extensions/DataServicePausableUpgradeable.t.sol index d85615227..444fa0e1e 100644 --- a/packages/horizon/test/data-service/extensions/DataServicePausableUpgradeable.t.sol +++ b/packages/horizon/test/data-service/extensions/DataServicePausableUpgradeable.t.sol @@ -16,7 +16,7 @@ contract DataServicePausableUpgradeableTest is GraphBaseTest { // via proxy - ensure that the proxy was initialized correctly // these calls validate proxy storage was correctly initialized - uint32 delegationRatio = ProvisionManager.delegationRatio(); + uint32 delegationRatio = dataService.delegationRatio(); assertEq(delegationRatio, type(uint32).min); (uint256 minTokens, uint256 maxTokens) = dataService.getProvisionTokensRange(); diff --git a/packages/subgraph-service/contracts/DisputeManager.sol b/packages/subgraph-service/contracts/DisputeManager.sol index 6dea631eb..4f69c7422 100644 --- a/packages/subgraph-service/contracts/DisputeManager.sol +++ b/packages/subgraph-service/contracts/DisputeManager.sol @@ -18,6 +18,7 @@ import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/I import { GraphDirectory } from "@graphprotocol/horizon/contracts/utilities/GraphDirectory.sol"; import { DisputeManagerV1Storage } from "./DisputeManagerStorage.sol"; import { AttestationManager } from "./utilities/AttestationManager.sol"; +import { ProvisionManager } from "@graphprotocol/packages/horizon/contracts/data-service/utilities/ProvisionManager.sol"; /* * @title DisputeManager @@ -47,7 +48,8 @@ contract DisputeManager is GraphDirectory, AttestationManager, DisputeManagerV1Storage, - IDisputeManager + IDisputeManager, + ProvisionManager { using TokenUtils for IGraphToken; using PPMMath for uint256; @@ -713,7 +715,7 @@ contract DisputeManager is */ function _getStakeSnapshot(address _indexer, uint256 _indexerStake) private view returns (uint256) { uint256 delegatorsStake = _graphStaking().getDelegationPool(_indexer, address(subgraphService)).tokens; - uint256 delegatorsStakeMax = _indexerStake * uint256(ProvisionManager.delegationRatio()); + uint256 delegatorsStakeMax = _indexerStake * uint256(delegationRatio); uint256 stakeSnapshot = _indexerStake + MathUtils.min(delegatorsStake, delegatorsStakeMax); return stakeSnapshot; }