File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed
prt/contracts/src/tournament Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -357,8 +357,8 @@ abstract contract Tournament {
357357 Clock.State storage _firstClock = clocks[_danglingCommitment];
358358
359359 // grant extra match effort for both clocks
360- _firstClock.addMatchEffort (matchEffort);
361- _newClock.addMatchEffort (matchEffort);
360+ _firstClock.addMatchEffort (matchEffort, maxAllowance );
361+ _newClock.addMatchEffort (matchEffort, maxAllowance );
362362
363363 _firstClock.advanceClock ();
364364
Original file line number Diff line number Diff line change @@ -128,17 +128,15 @@ library Clock {
128128 }
129129
130130 /// @notice Add matchEffort to a clock and set it to paused.
131- /// The new clock allowance is capped by `MAX_ALLOWANCE`.
132- function addMatchEffort (State storage state , Time.Duration matchEffort )
133- internal
134- {
131+ /// The new clock allowance is capped by maxAllowance.
132+ function addMatchEffort (
133+ State storage state ,
134+ Time.Duration matchEffort ,
135+ Time.Duration maxAllowance
136+ ) internal {
135137 Time.Duration _timeLeft = timeLeft (state);
136138
137- Time.Duration _allowance = _timeLeft.add (matchEffort);
138-
139- if (_allowance.gt (ArbitrationConstants.MAX_ALLOWANCE)) {
140- _allowance = ArbitrationConstants.MAX_ALLOWANCE;
141- }
139+ Time.Duration _allowance = _timeLeft.add (matchEffort).min (maxAllowance);
142140
143141 _setNewPaused (state, _allowance);
144142 }
You can’t perform that action at this time.
0 commit comments