Skip to content

Commit

Permalink
fix: Clock test (make lib call external)
Browse files Browse the repository at this point in the history
  • Loading branch information
guidanoli committed Jan 29, 2025
1 parent 4dc5078 commit 63c413f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion prt/contracts/test/Clock.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ import "src/tournament/libs/Clock.sol";

pragma solidity ^0.8.0;

library ExternalClock {
function advanceClockExternal(Clock.State storage state) external {
Clock.advanceClock(state);
}
}

contract ClockTest is Test {
using Clock for Clock.State;
using ExternalClock for Clock.State;
using Time for Time.Instant;

Clock.State clock1;
Expand Down Expand Up @@ -69,6 +76,6 @@ contract ClockTest is Test {
assertTrue(!clock1.hasTimeLeft(), "clock1 should run out of time");

vm.expectRevert("can't advance clock with no time left");
clock1.advanceClock();
clock1.advanceClockExternal();
}
}

0 comments on commit 63c413f

Please sign in to comment.