Commit c2d6700c authored by clabby's avatar clabby

parent a7111f0f
...@@ -32,29 +32,28 @@ DisputeGameFactory_SetImplementation_Test:test_setImplementation_notOwner_revert ...@@ -32,29 +32,28 @@ DisputeGameFactory_SetImplementation_Test:test_setImplementation_notOwner_revert
DisputeGameFactory_SetImplementation_Test:test_setImplementation_succeeds() (gas: 44243) DisputeGameFactory_SetImplementation_Test:test_setImplementation_succeeds() (gas: 44243)
DisputeGameFactory_TransferOwnership_Test:test_transferOwnership_notOwner_reverts() (gas: 15950) DisputeGameFactory_TransferOwnership_Test:test_transferOwnership_notOwner_reverts() (gas: 15950)
DisputeGameFactory_TransferOwnership_Test:test_transferOwnership_succeeds() (gas: 18642) DisputeGameFactory_TransferOwnership_Test:test_transferOwnership_succeeds() (gas: 18642)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot2:test_resolvesCorrectly_succeeds() (gas: 497412) FaultDisputeGame_ResolvesCorrectly_CorrectRoot2:test_resolvesCorrectly_succeeds() (gas: 497017)
FaultDisputeGame_ResolvesCorrectly_CorrectRoot:test_resolvesCorrectly_succeeds() (gas: 490452) FaultDisputeGame_ResolvesCorrectly_CorrectRoot:test_resolvesCorrectly_succeeds() (gas: 490057)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot2:test_resolvesCorrectly_succeeds() (gas: 494220) FaultDisputeGame_ResolvesCorrectly_IncorrectRoot2:test_resolvesCorrectly_succeeds() (gas: 493886)
FaultDisputeGame_ResolvesCorrectly_IncorrectRoot:test_resolvesCorrectly_succeeds() (gas: 487260) FaultDisputeGame_ResolvesCorrectly_IncorrectRoot:test_resolvesCorrectly_succeeds() (gas: 486926)
FaultDisputeGame_Test:test_clockTimeExceeded_reverts() (gas: 26444) FaultDisputeGame_Test:test_clockTimeExceeded_reverts() (gas: 26444)
FaultDisputeGame_Test:test_defendRoot_reverts() (gas: 13281) FaultDisputeGame_Test:test_defendRoot_reverts() (gas: 13281)
FaultDisputeGame_Test:test_duplicateClaim_reverts() (gas: 103343) FaultDisputeGame_Test:test_duplicateClaim_reverts() (gas: 103343)
FaultDisputeGame_Test:test_extraData_succeeds() (gas: 17478) FaultDisputeGame_Test:test_extraData_succeeds() (gas: 17431)
FaultDisputeGame_Test:test_gameData_succeeds() (gas: 17881) FaultDisputeGame_Test:test_gameData_succeeds() (gas: 17834)
FaultDisputeGame_Test:test_gameDepthExceeded_reverts() (gas: 407234) FaultDisputeGame_Test:test_gameDepthExceeded_reverts() (gas: 408128)
FaultDisputeGame_Test:test_gameStart_succeeds() (gas: 10359) FaultDisputeGame_Test:test_gameStart_succeeds() (gas: 10359)
FaultDisputeGame_Test:test_gameType_succeeds() (gas: 8216) FaultDisputeGame_Test:test_gameType_succeeds() (gas: 8281)
FaultDisputeGame_Test:test_initialRootClaimData_succeeds() (gas: 17669) FaultDisputeGame_Test:test_initialRootClaimData_succeeds() (gas: 17669)
FaultDisputeGame_Test:test_moveAgainstNonexistentParent_reverts() (gas: 24633) FaultDisputeGame_Test:test_moveAgainstNonexistentParent_reverts() (gas: 24611)
FaultDisputeGame_Test:test_move_gameNotInProgress_reverts() (gas: 10901) FaultDisputeGame_Test:test_move_gameNotInProgress_reverts() (gas: 10901)
FaultDisputeGame_Test:test_resolve_challengeContested() (gas: 221617) FaultDisputeGame_Test:test_resolve_challengeContested() (gas: 221222)
FaultDisputeGame_Test:test_resolve_notInProgress_reverts() (gas: 9657) FaultDisputeGame_Test:test_resolve_notInProgress_reverts() (gas: 9657)
FaultDisputeGame_Test:test_resolve_rootContested() (gas: 106539) FaultDisputeGame_Test:test_resolve_rootContested() (gas: 106144)
FaultDisputeGame_Test:test_resolve_rootUncontested() (gas: 20173) FaultDisputeGame_Test:test_resolve_rootUncontested() (gas: 23697)
FaultDisputeGame_Test:test_resolve_teamDeathmatch() (gas: 392416) FaultDisputeGame_Test:test_resolve_teamDeathmatch() (gas: 391960)
FaultDisputeGame_Test:test_rootClaim_succeeds() (gas: 8225) FaultDisputeGame_Test:test_rootClaim_succeeds() (gas: 8225)
FaultDisputeGame_Test:test_simpleAttack_succeeds() (gas: 107438) FaultDisputeGame_Test:test_simpleAttack_succeeds() (gas: 107438)
FaultDisputeGame_Test:test_version_succeeds() (gas: 9802)
FeeVault_Test:test_constructor_succeeds() (gas: 18185) FeeVault_Test:test_constructor_succeeds() (gas: 18185)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 352135) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 352135)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2950342) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2950342)
......
...@@ -306,12 +306,6 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone { ...@@ -306,12 +306,6 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone {
if (status != GameStatus.IN_PROGRESS) { if (status != GameStatus.IN_PROGRESS) {
// If the game is not in progress, it cannot be resolved. // If the game is not in progress, it cannot be resolved.
revert GameNotInProgress(); revert GameNotInProgress();
} else if (!claimData[0].countered) {
// If the root claim has never been countered, it implicitly wins.
status_ = GameStatus.DEFENDER_WINS;
status = status_;
emit Resolved(status_);
return status_;
} }
// Search for the left-most dangling non-bottom node // Search for the left-most dangling non-bottom node
...@@ -341,7 +335,9 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone { ...@@ -341,7 +335,9 @@ contract FaultDisputeGame is IFaultDisputeGame, Clone {
Position traceIndex = claimPos.rightIndex(MAX_GAME_DEPTH); Position traceIndex = claimPos.rightIndex(MAX_GAME_DEPTH);
if (Position.unwrap(traceIndex) < Position.unwrap(leftMostTraceIndex)) { if (Position.unwrap(traceIndex) < Position.unwrap(leftMostTraceIndex)) {
leftMostTraceIndex = traceIndex; leftMostTraceIndex = traceIndex;
leftMostIndex = i + 1; unchecked {
leftMostIndex = i + 1;
}
} }
} }
......
...@@ -21,10 +21,6 @@ contract FaultDisputeGame_Init is DisputeGameFactory_Init { ...@@ -21,10 +21,6 @@ contract FaultDisputeGame_Init is DisputeGameFactory_Init {
* @dev The type of the game being tested. * @dev The type of the game being tested.
*/ */
GameType internal constant GAME_TYPE = GameType.wrap(0); GameType internal constant GAME_TYPE = GameType.wrap(0);
/**
* @dev The current version of the `FaultDisputeGame` contract.
*/
string internal constant VERSION = "0.0.2";
/** /**
* @dev The implementation of the game. * @dev The implementation of the game.
...@@ -83,13 +79,6 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init { ...@@ -83,13 +79,6 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
assertEq(gameProxy.extraData(), EXTRA_DATA); assertEq(gameProxy.extraData(), EXTRA_DATA);
} }
/**
* @dev Tests that the game's version is set correctly.
*/
function test_version_succeeds() public {
assertEq(gameProxy.version(), VERSION);
}
/** /**
* @dev Tests that the game's status is set correctly. * @dev Tests that the game's status is set correctly.
*/ */
...@@ -196,10 +185,12 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init { ...@@ -196,10 +185,12 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init {
function test_gameDepthExceeded_reverts() public { function test_gameDepthExceeded_reverts() public {
Claim claim = Claim.wrap(bytes32(uint256(5))); Claim claim = Claim.wrap(bytes32(uint256(5)));
for (uint256 i = 0; i < 5; i++) { uint256 maxDepth = gameProxy.MAX_GAME_DEPTH();
for (uint256 i = 0; i <= maxDepth; i++) {
// At the max game depth, the `_move` function should revert with // At the max game depth, the `_move` function should revert with
// the `GameDepthExceeded` error. // the `GameDepthExceeded` error.
if (i == 4) { if (i == maxDepth) {
vm.expectRevert(GameDepthExceeded.selector); vm.expectRevert(GameDepthExceeded.selector);
} }
gameProxy.attack(i, claim); gameProxy.attack(i, claim);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment