Skip to content

docs(escrow): add warning on is_funded usage for in-progress match gating - #1883

Merged
famvilianity-eng merged 1 commit into
StellarCheckMate:mainfrom
shobhamerabacha-star:fix/issue-1791-is-funded-warning
Oct 23, 2026
Merged

famvilianity-eng merged 1 commit into
StellarCheckMate:mainfrom
shobhamerabacha-star:fix/issue-1791-is-funded-warning

Conversation

@shobhamerabacha-star

Copy link
Copy Markdown
Contributor

Summary of Changes

This PR resolves the security documentation ambiguity around is_funded where callers could mistakenly assume a match is in progress when it has already completed.

  • README.md: Replaced the misleading sentence gating game-start logic with a prominent warning callout:
    > **Warning:** Do not use this function to determine if a match is in progress — check match.state instead.
  • contracts/escrow/src/lib.rs: Added a matching # Warning section in the doc comment above pub fn is_funded.
  • contracts/escrow/src/tests/lifecycle.rs: Added explicit assertion in test_is_funded_returns_true_after_payout validating that callers must inspect match.state rather than is_funded to determine if a match is active.
  • docs/architecture.md: Updated the is_funded row in the public function reference table to ensure full doc-conformance.

Closes #1791

…ting

- Add warning to README is_funded section advising callers to check match.state instead of is_funded

- Add # Warning doc comment to is_funded in contracts/escrow/src/lib.rs

- Add assertion in test_is_funded_returns_true_after_payout to verify match.state != Active

- Update docs/architecture.md is_funded reference table

Closes StellarCheckMate#1791
@famvilianity-eng
famvilianity-eng merged commit 3490aef into StellarCheckMate:main Oct 23, 2026
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.

Security: is_funded can return true for a Completed match, misleading callers into skipping game-start logic

2 participants