Skip to content

Commit

Permalink
feat: set via_ir to true
Browse files Browse the repository at this point in the history
  • Loading branch information
guidanoli committed Dec 12, 2024
1 parent dd918b6 commit 6c58d83
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions prt/contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
src = "src"
out = "out"
libs = ["lib"]
via_ir = true

allow_paths = ['../../machine/step/']
remappings = [
Expand Down
4 changes: 2 additions & 2 deletions prt/contracts/test/Clock.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ contract ClockTest is Test {
clock1.advanceClock();
assertTrue(clock1.hasTimeLeft(), "clock1 should have time left");

vm.warp(block.timestamp + clock1Allowance - 1);
vm.warp(vm.getBlockTimestamp() + clock1Allowance - 1);
assertTrue(clock1.hasTimeLeft(), "clock1 should have time left");

vm.warp(block.timestamp + clock1Allowance);
vm.warp(vm.getBlockTimestamp() + clock1Allowance);
assertTrue(!clock1.hasTimeLeft(), "clock1 should run out of time");

vm.expectRevert("can't advance clock with no time left");
Expand Down
8 changes: 4 additions & 4 deletions prt/contracts/test/MultiTournament.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ contract MultiTournamentTest is Util, Test {
);

// player 0 should win after fast forward time to tournament finishes
uint256 _t = block.timestamp;
uint256 _t = vm.getBlockTimestamp();
uint256 _tournamentFinish =
_t + Time.Duration.unwrap(ArbitrationConstants.MAX_ALLOWANCE);

Expand Down Expand Up @@ -298,7 +298,7 @@ contract MultiTournamentTest is Util, Test {
assertFalse(_finished, "winner should be zero node");

// player 0 should win after fast forward time to inner tournament finishes
uint256 _t = block.timestamp;
uint256 _t = vm.getBlockTimestamp();
// the delay is increased when a match is created
uint256 _rootTournamentFinish = _t
+ Time.Duration.unwrap(ArbitrationConstants.MAX_ALLOWANCE)
Expand Down Expand Up @@ -370,7 +370,7 @@ contract MultiTournamentTest is Util, Test {
(_finished, _winner,) = middleTournament.innerTournamentWinner();
assertTrue(_winner.isZero(), "winner should be zero node");

_t = block.timestamp;
_t = vm.getBlockTimestamp();
// the delay is increased when a match is created
_rootTournamentFinish =
_t + Time.Duration.unwrap(ArbitrationConstants.MAX_ALLOWANCE);
Expand Down Expand Up @@ -450,7 +450,7 @@ contract MultiTournamentTest is Util, Test {
topTournament.getMatch(_matchId.hashFromId());
assertTrue(_match.exists(), "match should exist");

uint256 _t = block.timestamp;
uint256 _t = vm.getBlockTimestamp();
// the delay is increased when a match is created
uint256 _rootTournamentFinish =
_t + 2 * Time.Duration.unwrap(ArbitrationConstants.MAX_ALLOWANCE);
Expand Down
4 changes: 2 additions & 2 deletions prt/contracts/test/Tournament.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ contract TournamentTest is Util, Test {
function testTimeout() public {
topTournament = Util.initializePlayer0Tournament(factory);

uint256 _t = block.timestamp;
uint256 _t = vm.getBlockTimestamp();
// the delay is increased when a match is created
uint256 _tournamentFinishWithMatch = _t
+ Time.Duration.unwrap(ArbitrationConstants.MAX_ALLOWANCE)
Expand Down Expand Up @@ -114,7 +114,7 @@ contract TournamentTest is Util, Test {
);

topTournament = Util.initializePlayer0Tournament(factory);
_t = block.timestamp;
_t = vm.getBlockTimestamp();

// the delay is increased when a match is created
_tournamentFinishWithMatch = _t
Expand Down

0 comments on commit 6c58d83

Please sign in to comment.