Skip to content

Commit 42cc971

Browse files
committed
feat: added the current dispute kit as parameter to getNbVotesAfterAppeal()
1 parent 208e009 commit 42cc971

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

contracts/src/arbitration/KlerosCoreBase.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,10 @@ abstract contract KlerosCoreBase is IArbitratorV2, Initializable, UUPSProxiable
930930

931931
(, uint256 newDisputeKitID, bool courtJump, ) = _getCourtAndDisputeKitJumps(dispute, round, court, _disputeID);
932932

933-
uint256 nbVotesAfterAppeal = disputeKits[newDisputeKitID].getNbVotesAfterAppeal(round.nbVotes);
933+
uint256 nbVotesAfterAppeal = disputeKits[newDisputeKitID].getNbVotesAfterAppeal(
934+
disputeKits[round.disputeKitID],
935+
round.nbVotes
936+
);
934937

935938
if (courtJump) {
936939
// Jump to parent court.

contracts/src/arbitration/dispute-kits/DisputeKitClassicBase.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,10 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
636636
/// @dev Returns the number of votes after the appeal.
637637
/// @param _currentNbVotes The number of votes before the appeal.
638638
/// @return The number of votes after the appeal.
639-
function getNbVotesAfterAppeal(uint256 _currentNbVotes) external pure override returns (uint256) {
639+
function getNbVotesAfterAppeal(
640+
IDisputeKit /* _previousDisputeKit */,
641+
uint256 _currentNbVotes
642+
) external pure override returns (uint256) {
640643
return (_currentNbVotes * 2) + 1;
641644
}
642645

contracts/src/arbitration/interfaces/IDisputeKit.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,13 @@ interface IDisputeKit {
119119
function earlyCourtJump(uint256 _coreDisputeID) external view returns (bool);
120120

121121
/// @dev Returns the number of votes after the appeal.
122+
/// @param _previousDisputeKit The previous Dispute Kit.
122123
/// @param _currentNbVotes The number of votes before the appeal.
123124
/// @return The number of votes after the appeal.
124-
function getNbVotesAfterAppeal(uint256 _currentNbVotes) external view returns (uint256);
125+
function getNbVotesAfterAppeal(
126+
IDisputeKit _previousDisputeKit,
127+
uint256 _currentNbVotes
128+
) external view returns (uint256); // TODO: remove previousDisputeKit
125129

126130
/// @dev Returns true if the specified voter was active in this round.
127131
/// @param _coreDisputeID The ID of the dispute in Kleros Core, not in the Dispute Kit.

0 commit comments

Comments
 (0)