Skip to content

fix(examples): correct blackjack scoring/bust logic and enforce patie…#47

Open
arihantbansal wants to merge 13 commits intomainfrom
fix-logic
Open

fix(examples): correct blackjack scoring/bust logic and enforce patie…#47
arihantbansal wants to merge 13 commits intomainfrom
fix-logic

Conversation

@arihantbansal
Copy link
Member

@arihantbansal arihantbansal commented Dec 18, 2025

Summary

  • Blackjack: Fix hand value scoring (aces, pip cards, face cards), correct bust state machine (deal then check, bust -> Resolving not DealerTurn), add player ownership constraints on all game actions, bound hand size to prevent OOB
  • Sealed bid auction: Enforce auction timing (reject bids after end, reject close before end), widen bid_count u8->u16 with overflow protection, require at least one bid before resolving
  • Voting: Prevent double-voting via VoterRecord PDA with idempotent callback handling, add double-vote test
  • Share medical records: Constrain patient_data PDA derivation
  • Ed25519/Blackjack tests: Fix MXE pubkey fetch ordering

…cross examples

Blackjack: fix hand value calculation (ace downgrade, pip values, face card
threshold), deal card before bust check, transition to Resolving on bust,
add player ownership constraints, bound hand size to 11.

Sealed bid auction: enforce auction timing (no bids after end, no close
before end), widen bid_count to u16 with checked_add, require bids before
resolving, document known limitations.

Voting: add VoterRecord PDA for double-vote prevention with idempotent
callback, add PDA derivation validation, add double-vote rejection test.

Misc: constrain patient_data PDA in share_medical_records, reorder
getMXEPublicKeyWithRetry before comp def init in ed25519/blackjack tests.
- Remove redundant preflightCommitment when skipPreflight is true
- Add event timeout handling to prevent tests hanging indefinitely
- Add shutdown_wait and upgradeable=false to Anchor.toml configs
- Box large account types to reduce stack usage
- Sequentialize blackjack comp def inits and remove unnecessary sleep
Box MXEAccount in Vote struct to prevent stack overflow.
Increase auction end_time to 60s and wait to 65s for CI reliability.
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.

1 participant