@@ -17,7 +17,7 @@ import {TestERC20} from "../../src/token/TestERC20.sol";
17
17
import {ArbitrableExample, IArbitrableV2} from "../../src/arbitration/arbitrables/ArbitrableExample.sol " ;
18
18
import {DisputeTemplateRegistry} from "../../src/arbitration/DisputeTemplateRegistry.sol " ;
19
19
import "../../src/libraries/Constants.sol " ;
20
- import {IKlerosCore, KlerosCoreSnapshotProxy} from "../../src/snapshot-proxy /KlerosCoreSnapshotProxy.sol " ;
20
+ import {IKlerosCore, KlerosCoreSnapshotProxy} from "../../src/arbitration/view /KlerosCoreSnapshotProxy.sol " ;
21
21
22
22
contract KlerosCoreTest is Test {
23
23
event Initialized (uint64 version );
@@ -156,7 +156,7 @@ contract KlerosCoreTest is Test {
156
156
assertEq (address (core.pinakion ()), address (pinakion), "Wrong pinakion address " );
157
157
assertEq (core.jurorProsecutionModule (), jurorProsecutionModule, "Wrong jurorProsecutionModule address " );
158
158
assertEq (address (core.sortitionModule ()), address (sortitionModule), "Wrong sortitionModule address " );
159
- assertEq (core.getDisputeKitsLength (), 2 , "Wrong DK array length " );
159
+ assertEq (core.getDisputeKitsLength (), 1 , "Wrong DK array length " );
160
160
(
161
161
uint96 courtParent ,
162
162
bool courtHiddenVotes ,
@@ -197,19 +197,16 @@ contract KlerosCoreTest is Test {
197
197
assertEq (courtTimesPerPeriod[i], timesPerPeriod[i], "Wrong times per period " );
198
198
}
199
199
200
- assertEq (address (core.disputeKits (NULL_DISPUTE_KIT)), address (0 ), "Wrong address NULL_DISPUTE_KIT " );
201
200
assertEq (
202
201
address (core.disputeKits (DISPUTE_KIT_CLASSIC)),
203
202
address (disputeKit),
204
203
"Wrong address DISPUTE_KIT_CLASSIC "
205
204
);
206
- assertEq (core.isSupported (FORKING_COURT, NULL_DISPUTE_KIT), false , "Forking court null dk should be false " );
207
205
assertEq (
208
206
core.isSupported (FORKING_COURT, DISPUTE_KIT_CLASSIC),
209
207
false ,
210
208
"Forking court classic dk should be false "
211
209
);
212
- assertEq (core.isSupported (GENERAL_COURT, NULL_DISPUTE_KIT), false , "General court null dk should be false " );
213
210
assertEq (core.isSupported (GENERAL_COURT, DISPUTE_KIT_CLASSIC), true , "General court classic dk should be true " );
214
211
assertEq (core.paused (), false , "Wrong paused value " );
215
212
@@ -438,18 +435,18 @@ contract KlerosCoreTest is Test {
438
435
core.addNewDisputeKit (newDK);
439
436
vm.prank (governor);
440
437
vm.expectEmit (true , true , true , true );
441
- emit KlerosCoreBase.DisputeKitCreated (2 , newDK);
438
+ emit KlerosCoreBase.DisputeKitCreated (1 , newDK);
442
439
core.addNewDisputeKit (newDK);
443
- assertEq (address (core.disputeKits (2 )), address (newDK), "Wrong address of new DK " );
444
- assertEq (core.getDisputeKitsLength (), 3 , "Wrong DK array length " );
440
+ assertEq (address (core.disputeKits (1 )), address (newDK), "Wrong address of new DK " );
441
+ assertEq (core.getDisputeKitsLength (), 2 , "Wrong DK array length " );
445
442
}
446
443
447
444
function test_createCourt () public {
448
445
vm.expectRevert (KlerosCoreBase.GovernorOnly.selector );
449
446
vm.prank (other);
450
447
uint256 [] memory supportedDK = new uint256 [](2 );
451
448
supportedDK[0 ] = DISPUTE_KIT_CLASSIC;
452
- supportedDK[1 ] = 2 ; // New DK is added below.
449
+ supportedDK[1 ] = 1 ; // New DK is added below.
453
450
core.createCourt (
454
451
GENERAL_COURT,
455
452
true , // Hidden votes
@@ -506,21 +503,6 @@ contract KlerosCoreTest is Test {
506
503
);
507
504
508
505
uint256 [] memory badSupportedDK = new uint256 [](2 );
509
- badSupportedDK[0 ] = NULL_DISPUTE_KIT; // Include NULL_DK to check that it reverts
510
- badSupportedDK[1 ] = DISPUTE_KIT_CLASSIC;
511
- vm.expectRevert (KlerosCoreBase.WrongDisputeKitIndex.selector );
512
- vm.prank (governor);
513
- core.createCourt (
514
- GENERAL_COURT,
515
- true , // Hidden votes
516
- 2000 , // min stake
517
- 10000 , // alpha
518
- 0.03 ether, // fee for juror
519
- 50 , // jurors for jump
520
- [uint256 (10 ), uint256 (20 ), uint256 (30 ), uint256 (40 )], // Times per period
521
- abi.encode (uint256 (4 )), // Sortition extra data
522
- badSupportedDK
523
- );
524
506
525
507
badSupportedDK[0 ] = DISPUTE_KIT_CLASSIC;
526
508
badSupportedDK[1 ] = 2 ; // Check out of bounds index
@@ -543,7 +525,7 @@ contract KlerosCoreTest is Test {
543
525
vm.prank (governor);
544
526
core.addNewDisputeKit (newDK);
545
527
badSupportedDK = new uint256 [](1 );
546
- badSupportedDK[0 ] = 2 ; // Include only sybil resistant dk
528
+ badSupportedDK[0 ] = 1 ; // Include only sybil resistant dk
547
529
vm.expectRevert (KlerosCoreBase.MustSupportDisputeKitClassic.selector );
548
530
vm.prank (governor);
549
531
core.createCourt (
@@ -562,7 +544,7 @@ contract KlerosCoreTest is Test {
562
544
vm.expectEmit (true , true , true , true );
563
545
emit KlerosCoreBase.DisputeKitEnabled (2 , DISPUTE_KIT_CLASSIC, true );
564
546
vm.expectEmit (true , true , true , true );
565
- emit KlerosCoreBase.DisputeKitEnabled (2 , 2 , true );
547
+ emit KlerosCoreBase.DisputeKitEnabled (2 , 1 , true );
566
548
vm.expectEmit (true , true , true , true );
567
549
emit KlerosCoreBase.CourtCreated (
568
550
2 ,
@@ -721,7 +703,7 @@ contract KlerosCoreTest is Test {
721
703
722
704
function test_enableDisputeKits () public {
723
705
DisputeKitSybilResistant newDK = new DisputeKitSybilResistant ();
724
- uint256 newDkID = 2 ;
706
+ uint256 newDkID = 1 ;
725
707
vm.prank (governor);
726
708
core.addNewDisputeKit (newDK);
727
709
@@ -733,12 +715,7 @@ contract KlerosCoreTest is Test {
733
715
734
716
vm.expectRevert (KlerosCoreBase.WrongDisputeKitIndex.selector );
735
717
vm.prank (governor);
736
- supportedDK[0 ] = NULL_DISPUTE_KIT;
737
- core.enableDisputeKits (GENERAL_COURT, supportedDK, true );
738
-
739
- vm.expectRevert (KlerosCoreBase.WrongDisputeKitIndex.selector );
740
- vm.prank (governor);
741
- supportedDK[0 ] = 3 ; // Out of bounds
718
+ supportedDK[0 ] = 2 ; // Out of bounds
742
719
core.enableDisputeKits (GENERAL_COURT, supportedDK, true );
743
720
744
721
vm.expectRevert (KlerosCoreBase.CannotDisableClassicDK.selector );
@@ -821,12 +798,12 @@ contract KlerosCoreTest is Test {
821
798
core.addNewDisputeKit (disputeKit);
822
799
core.addNewDisputeKit (disputeKit);
823
800
core.addNewDisputeKit (disputeKit);
824
- extraData = abi.encodePacked (uint256 (50 ), uint256 (41 ), uint256 (6 ));
801
+ extraData = abi.encodePacked (uint256 (50 ), uint256 (41 ), uint256 (5 ));
825
802
826
803
(courtID, minJurors, disputeKitID) = core.extraDataToCourtIDMinJurorsDisputeKit (extraData);
827
804
assertEq (courtID, GENERAL_COURT, "Wrong courtID " ); // Value in extra data is out of scope so fall back
828
805
assertEq (minJurors, 41 , "Wrong minJurors " );
829
- assertEq (disputeKitID, 6 , "Wrong disputeKitID " );
806
+ assertEq (disputeKitID, 5 , "Wrong disputeKitID " );
830
807
}
831
808
832
809
// *************************************** //
@@ -1316,7 +1293,7 @@ contract KlerosCoreTest is Test {
1316
1293
uint256 newFee = 0.01 ether ;
1317
1294
uint96 newCourtID = 2 ;
1318
1295
uint256 newNbJurors = 4 ;
1319
- uint256 newDkID = 2 ;
1296
+ uint256 newDkID = 1 ;
1320
1297
uint256 [] memory supportedDK = new uint256 [](1 );
1321
1298
supportedDK[0 ] = DISPUTE_KIT_CLASSIC;
1322
1299
bytes memory newExtraData = abi.encodePacked (uint256 (newCourtID), newNbJurors, newDkID);
@@ -2082,7 +2059,7 @@ contract KlerosCoreTest is Test {
2082
2059
DisputeKitClassic newDisputeKit = DisputeKitClassic (address (proxyDk));
2083
2060
2084
2061
uint96 newCourtID = 2 ;
2085
- uint256 newDkID = 2 ;
2062
+ uint256 newDkID = 1 ;
2086
2063
uint256 [] memory supportedDK = new uint256 [](1 );
2087
2064
supportedDK[0 ] = DISPUTE_KIT_CLASSIC;
2088
2065
bytes memory newExtraData = abi.encodePacked (uint256 (newCourtID), DEFAULT_NB_OF_JURORS, newDkID);
0 commit comments