Skip to content

chore: test cancel_match#995

Merged
famvilianity-eng merged 1 commit into
StellarCheckMate:mainfrom
lyon-1050:feature/issue-795-test-cancel_match
Jul 1, 2026
Merged

chore: test cancel_match#995
famvilianity-eng merged 1 commit into
StellarCheckMate:mainfrom
lyon-1050:feature/issue-795-test-cancel_match

Conversation

@lyon-1050

Copy link
Copy Markdown
Contributor
  1. cancel_match — redundant state check (applied)

The original checked state == Active then separately state != Pending. The second check already covers Active and every other non-Pending state. Collapsed into a
single check that maps the state to the correct error.

  1. add_allowed_token — duplicated append_allowed_token call (applied)

The if !already_allowed / else block called Self::append_allowed_token at the end of both branches — identical code. Lifted it out of the conditional so it runs
once unconditionally after the branching logic.

  1. create_match — missing self-contract check for player1 (interrupted)

The original only checked that player2 != contract_address. player1 had the same potential problem but was never validated against it. The fix extends the guard
to cover both players in a single condition.

closes #795

@famvilianity-eng famvilianity-eng merged commit 51735c2 into StellarCheckMate:main Jul 1, 2026
3 of 6 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.

Add test: cancel_match emits match/cancelled event

2 participants