From 63c413f6833a6e478d02e1582e447ec6b825dac5 Mon Sep 17 00:00:00 2001 From: Guilherme Dantas Date: Tue, 28 Jan 2025 23:49:55 -0300 Subject: [PATCH] fix: Clock test (make lib call external) --- prt/contracts/test/Clock.t.sol | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/prt/contracts/test/Clock.t.sol b/prt/contracts/test/Clock.t.sol index d9aef43..c2f3bbd 100644 --- a/prt/contracts/test/Clock.t.sol +++ b/prt/contracts/test/Clock.t.sol @@ -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; @@ -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(); } }