From 0f0c039282660acfff346b406641de8fa9107081 Mon Sep 17 00:00:00 2001 From: Miguel de Elias Date: Wed, 2 Oct 2024 16:19:09 -0300 Subject: [PATCH] fix: subgraph service tests --- packages/horizon/test/staking/provision/parameters.t.sol | 2 +- .../test/subgraphService/provision/accept.t.sol | 4 ++-- packages/subgraph-service/test/utils/Constants.sol | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/horizon/test/staking/provision/parameters.t.sol b/packages/horizon/test/staking/provision/parameters.t.sol index f50094743..6eccca06e 100644 --- a/packages/horizon/test/staking/provision/parameters.t.sol +++ b/packages/horizon/test/staking/provision/parameters.t.sol @@ -83,7 +83,7 @@ contract HorizonStakingProvisionParametersTest is HorizonStakingTest { vm.stopPrank(); } - function test_ProvisionParameters_RevertWhen_InvalidMaxVerifierCut( + function test_ProvisionParameters_RevertIf_InvalidMaxVerifierCut( uint256 amount, uint32 maxVerifierCut, uint64 thawingPeriod diff --git a/packages/subgraph-service/test/subgraphService/provision/accept.t.sol b/packages/subgraph-service/test/subgraphService/provision/accept.t.sol index 44ce19b5f..5d5d25a08 100644 --- a/packages/subgraph-service/test/subgraphService/provision/accept.t.sol +++ b/packages/subgraph-service/test/subgraphService/provision/accept.t.sol @@ -22,7 +22,7 @@ contract SubgraphServiceProvisionAcceptTest is SubgraphServiceTest { tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); vm.assume(newVerifierCut >= fishermanRewardPercentage); vm.assume(newVerifierCut <= MAX_PPM); - vm.assume(newDisputePeriod >= disputePeriod); + newDisputePeriod = uint64(bound(newDisputePeriod, disputePeriod, MAX_THAWING_PERIOD)); // Setup indexer _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); @@ -58,7 +58,7 @@ contract SubgraphServiceProvisionAcceptTest is SubgraphServiceTest { uint32 newVerifierCut ) public useIndexer { tokens = bound(tokens, minimumProvisionTokens, MAX_TOKENS); - vm.assume(newVerifierCut > MAX_PPM); + vm.assume(newVerifierCut < maxSlashingPercentage); // Setup indexer _createProvision(users.indexer, tokens, fishermanRewardPercentage, disputePeriod); diff --git a/packages/subgraph-service/test/utils/Constants.sol b/packages/subgraph-service/test/utils/Constants.sol index eabf5e7b2..f1aac3d16 100644 --- a/packages/subgraph-service/test/utils/Constants.sol +++ b/packages/subgraph-service/test/utils/Constants.sol @@ -6,7 +6,7 @@ abstract contract Constants { uint256 internal constant MAX_PPM = 1_000_000; uint256 internal constant EPOCH_LENGTH = 1; // Dispute Manager - uint64 internal constant disputePeriod = 300; // 5 minutes + uint64 internal constant disputePeriod = 7 days; uint256 internal constant disputeDeposit = 100 ether; // 100 GRT uint32 internal constant fishermanRewardPercentage = 500000; // 50% uint32 internal constant maxSlashingPercentage = 500000; // 50%