test(#617): add deterministic event ordering test for resolve_market#699
Merged
greatest0fallt1me merged 1 commit intoJun 27, 2026
Conversation
…esolve_market - Document event ordering contract in resolve_market rustdoc: mkt_res → st_chng → idx_transition (deterministic sequence) - Add test: single-winner ordering (test_resolve_market_emits_events_in_deterministic_order) - Add test: tie-outcome ordering preserved (test_event_ordering_preserved_on_tie_outcome) - Add test: no events emitted on failed resolution (negative case) - Register resolution_event_ordering_tests module under #[cfg(test)] Closes Predictify-org#617
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #617 — adds deterministic event ordering tests and documents the event emission contract for
resolve_market.Changes
contracts/predictify-hybrid/src/lib.rs# Event Ordering Contractsection toresolve_marketrustdoc, specifying the exact sequence:mkt_res→st_chng→idx_transitioncontracts/predictify-hybrid/src/resolution_event_ordering_tests.rsThree tests covering the full acceptance criteria:
test_resolve_market_emits_events_in_deterministic_ordermkt_res < st_chng < idx_transitiontest_event_ordering_preserved_on_tie_outcometest_no_resolution_events_emitted_when_resolution_failsAcceptance Criteria
lib.rsrustdocunwrap()introducedTesting
All three tests call
MarketResolutionManager::resolve_marketdirectly and introspectenv.events().all()— no reliance on exact ledger timestamps.