Skip to content

Commit fecbed3

Browse files
committed
fix: forge fmt
1 parent d6da25c commit fecbed3

3 files changed

Lines changed: 12 additions & 17 deletions

File tree

script/game/duel/CheckDuelResult.s.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,8 @@ contract CheckDuelResultScript is Script {
3131
DuelGame duelGame = DuelGame(payable(duelGameAddr));
3232

3333
// Get challenge details
34-
(
35-
uint32 challengerId,
36-
uint32 defenderId,
37-
uint256 vrfRequestTimestamp,,,
38-
DuelGame.ChallengeState state
39-
) = duelGame.challenges(challengeId);
34+
(uint32 challengerId, uint32 defenderId, uint256 vrfRequestTimestamp,,, DuelGame.ChallengeState state) =
35+
duelGame.challenges(challengeId);
4036

4137
console2.log("Challenge ID:", challengeId);
4238
console2.log("Challenger ID:", challengerId);

src/game/modes/DuelGame.sol

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,6 @@ contract DuelGame is BaseGame, VRFConsumerBaseV2Plus {
215215
return challenge.challengerId != 0 && challenge.state == ChallengeState.PENDING;
216216
}
217217

218-
219-
220218
/// @notice Creates a new duel challenge using a DUEL_TICKET
221219
/// @param challengerLoadout Loadout for the challenger
222220
/// @param defenderId ID of the defender
@@ -309,7 +307,6 @@ contract DuelGame is BaseGame, VRFConsumerBaseV2Plus {
309307
);
310308
}
311309

312-
313310
/// @notice Allows players to recover from a timed-out VRF request
314311
/// @param challengeId ID of the challenge to recover
315312
function recoverTimedOutVRF(uint256 challengeId) external {
@@ -349,7 +346,6 @@ contract DuelGame is BaseGame, VRFConsumerBaseV2Plus {
349346
isGameEnabled = enabled;
350347
}
351348

352-
353349
/// @notice Updates the timeout period for VRF requests
354350
/// @param newValue The new timeout period in seconds
355351
function setVrfRequestTimeout(uint256 newValue) external onlyOwner {

test/game/DuelGame.t.sol

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ contract DuelGameTest is TestBase {
146146
assertEq(defenderLoadout.playerId, PLAYER_TWO_ID, "Defender loadout incorrect");
147147
}
148148

149-
150149
function testCompleteDuelWorkflow() public {
151150
// Complete end-to-end duel workflow
152151
vm.startPrank(PLAYER_ONE);
@@ -197,7 +196,6 @@ contract DuelGameTest is TestBase {
197196
vm.stopPrank();
198197
}
199198

200-
201199
function test_RevertWhen_WrongDefenderAccepts() public {
202200
// First create a valid challenge
203201
vm.startPrank(PLAYER_ONE);
@@ -268,7 +266,9 @@ contract DuelGameTest is TestBase {
268266
assertFalse(game.isChallengeActive(challengeId2), "Challenge should not be active after acceptance");
269267
assertTrue(game.isChallengePending(challengeId2), "Challenge should be pending after acceptance");
270268
(,,,,, DuelGame.ChallengeState acceptedState) = game.challenges(challengeId2);
271-
assertFalse(acceptedState == DuelGame.ChallengeState.COMPLETED, "Challenge should not be completed after acceptance");
269+
assertFalse(
270+
acceptedState == DuelGame.ChallengeState.COMPLETED, "Challenge should not be completed after acceptance"
271+
);
272272

273273
// 4. First challenge should still be active (no expiry)
274274
assertTrue(game.isChallengeActive(challengeId), "Challenge should remain active (no expiry)");
@@ -280,7 +280,9 @@ contract DuelGameTest is TestBase {
280280
assertFalse(game.isChallengeActive(challengeId2), "Challenge should not be active after completion");
281281
assertFalse(game.isChallengePending(challengeId2), "Challenge should not be pending after completion");
282282
(,,,,, DuelGame.ChallengeState fulfilledState) = game.challenges(challengeId2);
283-
assertTrue(fulfilledState == DuelGame.ChallengeState.COMPLETED, "Challenge should be completed after fulfillment");
283+
assertTrue(
284+
fulfilledState == DuelGame.ChallengeState.COMPLETED, "Challenge should be completed after fulfillment"
285+
);
284286
}
285287

286288
function testDuelsDoNotUpdateWinLossRecords() public {
@@ -356,8 +358,7 @@ contract DuelGameTest is TestBase {
356358
vm.stopPrank();
357359

358360
// Get current challenge state
359-
(,,,,, DuelGame.ChallengeState state) =
360-
game.challenges(challengeId);
361+
(,,,,, DuelGame.ChallengeState state) = game.challenges(challengeId);
361362
console2.log("Initial state:", uint256(state));
362363
console2.log("Current block:", block.number);
363364
console2.log("Current timestamp:", block.timestamp);
@@ -587,7 +588,9 @@ contract DuelGameTest is TestBase {
587588

588589
// Challenge completed successfully with override loadouts
589590
(,,,,, DuelGame.ChallengeState overrideState) = game.challenges(challengeId);
590-
assertTrue(overrideState == DuelGame.ChallengeState.COMPLETED, "Challenge should complete with override loadouts");
591+
assertTrue(
592+
overrideState == DuelGame.ChallengeState.COMPLETED, "Challenge should complete with override loadouts"
593+
);
591594
}
592595

593596
function testDuelFeeAmountConfiguration() public {

0 commit comments

Comments
 (0)