Skip to content

fix: reject empty game_id in create_match and add invariant tests#712

Merged
famvilianity-eng merged 2 commits into
StellarCheckMate:mainfrom
stellajose:fix/empty-game-id-validation-and-invariant-tests
May 31, 2026
Merged

fix: reject empty game_id in create_match and add invariant tests#712
famvilianity-eng merged 2 commits into
StellarCheckMate:mainfrom
stellajose:fix/empty-game-id-validation-and-invariant-tests

Conversation

@stellajose
Copy link
Copy Markdown
Contributor

Summary

Adds a missing validation guard in create_match that rejects empty game_id strings before the length check, returning Error::InvalidGameId. Also wires up the helpers and invariants test modules into the escrow test suite.

Changes

  • contracts/escrow/src/lib.rs — added game_id.is_empty() guard returning Error::InvalidGameId
  • contracts/escrow/src/tests/mod.rs — registered helpers and invariants modules
  • contracts/escrow/src/tests/helpers.rs — new shared test helper utilities
  • contracts/escrow/src/tests/invariants.rs — new invariant test coverage

Testing

All changes include corresponding test coverage via the new invariants module.

Closes #657
Closes #605

stellajose and others added 2 commits May 31, 2026 19:52
Validate that game_id is non-empty before length check in create_match,
returning Error::InvalidGameId on empty input. Wire up helpers and
invariants test modules to the escrow test suite.

Closes StellarCheckMate#657
Closes StellarCheckMate#605
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@stellajose Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@famvilianity-eng famvilianity-eng merged commit f129d2e into StellarCheckMate:main May 31, 2026
0 of 3 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.

Feature: add shared test helpers plus invariant-style lifecycle tests Add Test: escrow empty game_id rejection uses try_create_match

2 participants