Skip to content

Commit

Permalink
fixup: Smart contract -- stale comments in shared.move
Browse files Browse the repository at this point in the history
  • Loading branch information
amnn committed Jul 8, 2024
1 parent 440c4e2 commit 83f55b9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions examples/tic-tac-toe/move/sources/shared.move
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ module tic_tac_toe::shared {
assert!(game.ended() == TROPHY_NONE, EAlreadyFinished);
assert!(row < 3 && col < 3, EInvalidLocation);

// Confirm that the mark is from the player we expect -- it should not
// be possible to hit this assertion, because the `Mark`s can only be
// created by the address that owns the `TurnCap` which cannot be
// transferred, and is always held by `game.next_player()`.
// Confirm that the mark is from the player we expect.
let (me, them, sentinel) = game.next_player();
assert!(me == ctx.sender(), EWrongPlayer);

Expand All @@ -122,8 +119,7 @@ module tic_tac_toe::shared {
*(&mut game[row, col]) = sentinel;
game.turn = game.turn + 1;

// Check win condition -- if there is a winner, send them the trophy,
// otherwise, create a new turn cap and send that to the next player.
// Check win condition -- if there is a winner, send them the trophy.
let end = game.ended();
if (end == TROPHY_WIN) {
transfer::transfer(game.mint_trophy(end, them, ctx), me);
Expand Down

0 comments on commit 83f55b9

Please sign in to comment.