Skip to content

docs(rps/against-player): fix code snippets to match actual implementation#63

Merged
arihantbansal merged 1 commit intoarcium-hq:mainfrom
giwaov:fix/rps-against-player-readme-snippets
Mar 8, 2026
Merged

docs(rps/against-player): fix code snippets to match actual implementation#63
arihantbansal merged 1 commit intoarcium-hq:mainfrom
giwaov:fix/rps-against-player-readme-snippets

Conversation

@giwaov
Copy link
Contributor

@giwaov giwaov commented Feb 25, 2026

Summary

  • Fixed variable names in player_move and compare_moves README snippets to match actual code
  • Fixed a shadowing bug where game.owner.from_arcis(game) wouldn't compile (original Enc consumed by shadowing)

Issue

The README snippets used simplified variable names that differed from the actual implementation. More critically, the player_move snippet had a shadowing bug: after let mut game = game.to_arcis(), calling game.owner would reference the decrypted GameMoves struct (which has no owner field), not the original Enc<Mxe, GameMoves>.

Changes

player_move:

  • players_moveplayers_move_ctxt, gamegame_ctxt (parameters)
  • inputplayers_move, gamegame_moves (local variables)
  • game.owner.from_arcis(game)game_ctxt.owner.from_arcis(game_moves)

compare_moves:

  • gamegame_ctxt (parameter)
  • movesgame_moves (local variable)

Verification

Confirmed against actual code in rock_paper_scissors/against-player/encrypted-ixs/src/lib.rs.

Test plan

  • Verify README snippets now match actual source code

…ation

Fixed variable names and a shadowing bug in player_move and compare_moves
snippets where game.owner.from_arcis(game) wouldn't compile due to the
original Enc being consumed by shadowing.
@arihantbansal arihantbansal merged commit 3b000b9 into arcium-hq:main Mar 8, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants