Skip to content

Commit cae435e

Browse files
fix(KC): remove try catch
1 parent cb492fd commit cae435e

File tree

2 files changed

+1
-62
lines changed

2 files changed

+1
-62
lines changed

contracts/src/arbitration/KlerosCore.sol

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,6 @@ contract KlerosCore is IArbitratorV2, Initializable, UUPSProxiable {
139139
/// @param _voteID ID of the vote given to the drawn juror.
140140
event Draw(address indexed _address, uint256 indexed _disputeID, uint256 _roundID, uint256 _voteID);
141141

142-
/// @notice Emitted when the dispute is successfully appealed.
143-
/// @param _disputeID ID of the related dispute.
144-
/// @param _arbitrable The arbitrable contract.
145-
event ArbitrableReverted(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);
146-
147142
/// @notice Emitted when a new court is created.
148143
/// @param _courtID ID of the new court.
149144
/// @param _parent ID of the parent court.
@@ -1073,9 +1068,7 @@ contract KlerosCore is IArbitratorV2, Initializable, UUPSProxiable {
10731068
(uint256 winningChoice, , ) = currentRuling(_disputeID);
10741069
dispute.ruled = true;
10751070
emit Ruling(dispute.arbitrated, _disputeID, winningChoice);
1076-
try dispute.arbitrated.rule(_disputeID, winningChoice) {} catch {
1077-
emit ArbitrableReverted(_disputeID, dispute.arbitrated);
1078-
}
1071+
dispute.arbitrated.rule(_disputeID, winningChoice);
10791072
}
10801073

10811074
// ************************************* //

contracts/test/foundry/KlerosCore_Execution.t.sol

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -665,60 +665,6 @@ contract KlerosCore_ExecutionTest is KlerosCore_TestBase {
665665
assertEq(ruled, true, "Should be ruled");
666666
}
667667

668-
function test_executeRuling_arbitrableRevert() public {
669-
MaliciousArbitrableMock maliciousArbitrable = new MaliciousArbitrableMock(
670-
core,
671-
templateData,
672-
templateDataMappings,
673-
arbitratorExtraData,
674-
registry,
675-
feeToken
676-
);
677-
uint256 disputeID = 0;
678-
679-
vm.prank(staker1);
680-
core.setStake(GENERAL_COURT, 20000);
681-
vm.prank(disputer);
682-
maliciousArbitrable.createDispute{value: feeForJuror * DEFAULT_NB_OF_JURORS}("Action");
683-
vm.warp(block.timestamp + minStakingTime);
684-
sortitionModule.passPhase(); // Generating
685-
vm.warp(block.timestamp + rngLookahead);
686-
sortitionModule.passPhase(); // Drawing phase
687-
688-
core.draw(disputeID, DEFAULT_NB_OF_JURORS);
689-
vm.warp(block.timestamp + timesPerPeriod[0]);
690-
core.passPeriod(disputeID); // Vote
691-
692-
uint256[] memory voteIDs = new uint256[](3);
693-
voteIDs[0] = 0;
694-
voteIDs[1] = 1;
695-
voteIDs[2] = 2;
696-
697-
vm.prank(staker1);
698-
disputeKit.castVote(disputeID, voteIDs, 2, 0, "XYZ");
699-
core.passPeriod(disputeID); // Appeal
700-
701-
vm.warp(block.timestamp + timesPerPeriod[3]);
702-
core.passPeriod(disputeID); // Execution
703-
704-
core.executeRuling(disputeID);
705-
706-
(, , , bool ruled, ) = core.disputes(disputeID);
707-
assertEq(ruled, true, "Should be ruled");
708-
709-
(bool isRuled, , ) = maliciousArbitrable.disputes(disputeID);
710-
assertEq(isRuled, false, "Should be false");
711-
712-
vm.expectRevert(KlerosCore.RulingAlreadyExecuted.selector);
713-
core.executeRuling(disputeID);
714-
715-
maliciousArbitrable.changeBehaviour(false);
716-
717-
// If the first revert was accidental arbitrable will be locked out.
718-
vm.expectRevert(KlerosCore.RulingAlreadyExecuted.selector);
719-
core.executeRuling(disputeID);
720-
}
721-
722668
function test_executeRuling_appealSwitch() public {
723669
// Check that the ruling switches if only one side was funded
724670
uint256 disputeID = 0;

0 commit comments

Comments
 (0)