@@ -92,8 +92,15 @@ contract DisputeManagerTest is Test {
9292 );
9393 disputeManager = DisputeManager (disputeManagerProxy);
9494
95- subgraphService = new SubgraphService (address (controller), address (disputeManager), tapVerifier, curation);
96- subgraphService.initialize (1000 ether, 16 );
95+ address subgraphServiceImplementation = address (
96+ new SubgraphService (address (controller), address (disputeManager), tapVerifier, curation)
97+ );
98+ address subgraphServiceProxy = UnsafeUpgrades.deployTransparentProxy (
99+ subgraphServiceImplementation,
100+ governor,
101+ abi.encodeCall (SubgraphService.initialize, (1000 ether, 16 ))
102+ );
103+ subgraphService = SubgraphService (subgraphServiceProxy);
97104
98105 disputeManager.setSubgraphService (address (subgraphService));
99106 }
@@ -108,18 +115,18 @@ contract DisputeManagerTest is Test {
108115 bytes32 digest = subgraphService.encodeAllocationProof (indexer, _allocationID);
109116 (uint8 v , bytes32 r , bytes32 s ) = vm.sign (allocationIDPrivateKey, digest);
110117
111- subgraphService.register (indexer, abi.encode ("url " , "geoHash " ));
118+ subgraphService.register (indexer, abi.encode ("url " , "geoHash " , address ( 0 ) ));
112119
113120 bytes memory data = abi.encode (subgraphDeployment, tokens, _allocationID, abi.encodePacked (r, s, v));
114121 subgraphService.startService (indexer, data);
115122 vm.stopPrank ();
116123 }
117124
118- function createIndexingDispute (address _allocationID , uint256 tokens ) private returns (bytes32 disputeID ) {
125+ function createIndexingDispute (address _allocationID , bytes32 _poi , uint256 tokens ) private returns (bytes32 disputeID ) {
119126 vm.startPrank (fisherman);
120127 graphToken.mint (fisherman, tokens);
121128 graphToken.approve (address (disputeManager), tokens);
122- bytes32 _disputeID = disputeManager.createIndexingDispute (_allocationID, bytes32 ( " POI1234 " ) , tokens);
129+ bytes32 _disputeID = disputeManager.createIndexingDispute (_allocationID, _poi , tokens);
123130 vm.stopPrank ();
124131 return _disputeID;
125132 }
@@ -181,7 +188,7 @@ contract DisputeManagerTest is Test {
181188 function testCreateIndexingDispute () public {
182189 createProvisionAndAllocate (allocationID, 10000 ether);
183190
184- bytes32 disputeID = createIndexingDispute (allocationID, 200 ether);
191+ bytes32 disputeID = createIndexingDispute (allocationID, bytes32 ( " POI1 " ), 200 ether);
185192 assertTrue (disputeManager.isDisputeCreated (disputeID), "Dispute should be created. " );
186193 }
187194
@@ -217,7 +224,7 @@ contract DisputeManagerTest is Test {
217224
218225 function test_RevertWhen_DisputeAlreadyCreated () public {
219226 createProvisionAndAllocate (allocationID, 10000 ether);
220- bytes32 disputeID = createIndexingDispute (allocationID, 200 ether);
227+ bytes32 disputeID = createIndexingDispute (allocationID, bytes32 ( " POI1 " ), 200 ether);
221228
222229 // Create another dispute with different fisherman
223230 address otherFisherman = address (0x5 );
@@ -227,7 +234,7 @@ contract DisputeManagerTest is Test {
227234 graphToken.approve (address (disputeManager), tokens);
228235 bytes memory expectedError = abi.encodeWithSignature ("DisputeManagerDisputeAlreadyCreated(bytes32) " , disputeID);
229236 vm.expectRevert (expectedError);
230- disputeManager.createIndexingDispute (allocationID, bytes32 ("POI1234 " ), tokens);
237+ disputeManager.createIndexingDispute (allocationID, bytes32 ("POI1 " ), tokens);
231238 vm.stopPrank ();
232239 }
233240
@@ -241,7 +248,7 @@ contract DisputeManagerTest is Test {
241248 100 ether
242249 );
243250 vm.expectRevert (expectedError);
244- disputeManager.createIndexingDispute (allocationID, bytes32 ("POI1234 " ), 50 ether);
251+ disputeManager.createIndexingDispute (allocationID, bytes32 ("POI3 " ), 50 ether);
245252 vm.stopPrank ();
246253 }
247254
@@ -253,7 +260,7 @@ contract DisputeManagerTest is Test {
253260 graphToken.approve (address (disputeManager), tokens);
254261 bytes memory expectedError = abi.encodeWithSignature ("DisputeManagerIndexerNotFound(address) " , allocationID);
255262 vm.expectRevert (expectedError);
256- disputeManager.createIndexingDispute (allocationID, bytes32 ("POI1234 " ), tokens);
263+ disputeManager.createIndexingDispute (allocationID, bytes32 ("POI4 " ), tokens);
257264 vm.stopPrank ();
258265 }
259266
@@ -316,7 +323,7 @@ contract DisputeManagerTest is Test {
316323
317324 function testAcceptIndexingDispute () public {
318325 createProvisionAndAllocate (allocationID, 10000 ether);
319- bytes32 disputeID = createIndexingDispute (allocationID, 200 ether);
326+ bytes32 disputeID = createIndexingDispute (allocationID, bytes32 ( " POI1 " ), 200 ether);
320327
321328 vm.prank (arbitrator);
322329 disputeManager.acceptDispute (disputeID, 5000 ether);
@@ -371,7 +378,7 @@ contract DisputeManagerTest is Test {
371378 function test_RevertIf_CallerIsNotArbitrator_AcceptDispute () public {
372379 createProvisionAndAllocate (allocationID, 10000 ether);
373380
374- bytes32 disputeID = createIndexingDispute (allocationID, 200 ether);
381+ bytes32 disputeID = createIndexingDispute (allocationID, bytes32 ( " POI1 " ), 200 ether);
375382
376383 // attempt to accept dispute as fisherman
377384 vm.prank (fisherman);
@@ -381,11 +388,11 @@ contract DisputeManagerTest is Test {
381388
382389 function test_RevertIf_SlashingOverMaxSlashPercentage () public {
383390 createProvisionAndAllocate (allocationID, 10000 ether);
384- bytes32 disputeID = createIndexingDispute (allocationID, 200 ether);
391+ bytes32 disputeID = createIndexingDispute (allocationID, bytes32 ( " POI101 " ), 200 ether);
385392
386393 // max slashing percentage is 50%
387394 vm.prank (arbitrator);
388- bytes memory expectedError = abi.encodeWithSignature ("DisputeManagerInvalidSlashAmount (uint256) " , 6000 ether);
395+ bytes memory expectedError = abi.encodeWithSignature ("DisputeManagerInvalidTokensSlash (uint256) " , 6000 ether);
389396 vm.expectRevert (expectedError);
390397 disputeManager.acceptDispute (disputeID, 6000 ether);
391398 }
@@ -394,7 +401,7 @@ contract DisputeManagerTest is Test {
394401
395402 function testCancelDispute () public {
396403 createProvisionAndAllocate (allocationID, 10000 ether);
397- bytes32 disputeID = createIndexingDispute (allocationID, 200 ether);
404+ bytes32 disputeID = createIndexingDispute (allocationID, bytes32 ( " POI1 " ), 200 ether);
398405
399406 // skip to end of dispute period
400407 skip (disputePeriod + 1 );
@@ -442,7 +449,7 @@ contract DisputeManagerTest is Test {
442449
443450 function test_RevertIf_CallerIsNotFisherman_CancelDispute () public {
444451 createProvisionAndAllocate (allocationID, 10000 ether);
445- bytes32 disputeID = createIndexingDispute (allocationID, 200 ether);
452+ bytes32 disputeID = createIndexingDispute (allocationID, bytes32 ( " POI1 " ), 200 ether);
446453
447454 vm.prank (arbitrator);
448455 vm.expectRevert (bytes4 (keccak256 ("DisputeManagerNotFisherman() " )));
@@ -453,7 +460,7 @@ contract DisputeManagerTest is Test {
453460
454461 function testDrawDispute () public {
455462 createProvisionAndAllocate (allocationID, 10000 ether);
456- bytes32 disputeID = createIndexingDispute (allocationID, 200 ether);
463+ bytes32 disputeID = createIndexingDispute (allocationID, bytes32 ( " POI32 " ), 200 ether);
457464
458465 vm.prank (arbitrator);
459466 disputeManager.drawDispute (disputeID);
@@ -495,7 +502,7 @@ contract DisputeManagerTest is Test {
495502
496503 function test_RevertIf_CallerIsNotArbitrator_DrawDispute () public {
497504 createProvisionAndAllocate (allocationID, 10000 ether);
498- bytes32 disputeID = createIndexingDispute (allocationID, 200 ether);
505+ bytes32 disputeID = createIndexingDispute (allocationID,bytes32 ( " POI1 " ), 200 ether);
499506
500507 // attempt to draw dispute as fisherman
501508 vm.prank (fisherman);
0 commit comments