Skip to content

fix: reject rollback when match is in PendingResult or Completed state - #1877

Merged
famvilianity-eng merged 1 commit into
StellarCheckMate:mainfrom
zicogoodness:fix/issue-1817-dispute-rollback-state-validation
Oct 23, 2026
Merged

famvilianity-eng merged 1 commit into
StellarCheckMate:mainfrom
zicogoodness:fix/issue-1817-dispute-rollback-state-validation

Conversation

@zicogoodness

Copy link
Copy Markdown
Contributor

Overview

This PR ensures that dispute_and_rollback_match rejects attempts to trigger a rollback vote once a match result has already been submitted by the oracle (i.e. when the match state is MatchState::PendingResult or MatchState::Completed).

Changes

  • In contracts/escrow/src/lib.rs (dispute_and_rollback_match), added explicit validation to reject rollback with Error::InvalidState if match.state == MatchState::PendingResult || match.state == MatchState::Completed.
  • In contracts/escrow/src/tests/dispute_rollback.rs, added regression unit test test_rollback_rejects_pending_result_match verifying that attempting to rollback a match in PendingResult returns Err(Ok(Error::InvalidState)).

Closes #1817

@famvilianity-eng
famvilianity-eng merged commit 863cda8 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.

Fix: dispute_and_rollback_match allows rollback after a result has already been submitted

2 participants