Go Fish Midnight Contract Placeholder - #1
Merged
Merged
Conversation
acedward
added a commit
that referenced
this pull request
Apr 20, 2026
…arden witnesses Phase 0 (EVM lobby alignment): - Remove maxPlayers from GoFishGameState type and in-memory state (DB column dropped per EVM_UPDATE.md; game is always 2 players) Phase 1 (critical fixes): - Fix callAfterGoFish: remove stale drewRequestedCard param (4→3 args). Contract v3 decrypts the drawn card internally (game.compact:451-510). Updated across all 6 files in the call chain (GoFishContractService, MidnightService, MidnightOnChainService, midnightBridge, GameScreen, GameScene). - Delete callGoFish / goFish: no goFish circuit exists in the compiled contract. respondToAsk handles the draw internally. Turn flow is now: askForCard → respondToAsk → (if WaitForDrawCheck) afterGoFish. - Allow empty-hand asks: contract rule-5 relaxation permits asking for any rank when hand is empty. GameScreen now shows an "Ask for a card" button instead of the old passive "Drawing will happen automatically" message that stalled the game. Phase 2 (book scoring — without this, games never end): - Add callCheckAndScoreBook to GoFishContractService (batcher delegation) - Add onChainCheckAndScoreBook to MidnightOnChainService - Add checkAndScoreBook routing to MidnightService - Add autoScoreBooks() to GameScreen: after respondToAsk and afterGoFish, scans the player's hand for ranks with ≥3 cards and submits checkAndScoreBook for each. The contract's addScore checks ≥4 books and sets phase=GameOver + winner. Phase 3 (winner display): - Update renderGameOverPanel to use ≥4 threshold for winner determination (matches the contract's early-win rule). Added TODO for reading getWinner from the contract once direct indexer access is available. Phase 5 (witness hardening): - Remove silent Math.random() fallback from witnesses.ts getSecretKey and getShuffleSeed. Both now throw immediately on a miss with a descriptive error naming the game+player that's missing. Delete the static `keys` object that powered the fallback (20-bit random values that produced wrong ec_mul results). See BACKEND_ISSUES.md #1. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Output