Summary
Add state-machine test suite that models legal and illegal transitions across protocol lifecycle actions.
Why this change matters
Round protocols are inherently stateful. State-machine tests prevent accidental transition bugs (e.g., resolve before end, recreate while active, claim semantics drift) and improve confidence during refactors.
Where to work
contracts/src/tests/ (new state-machine module)
- possible helpers in test utilities for reusable transition setup
What contributors should implement
- Define allowed states and transitions for each mode.
- Encode both success and rejection transitions.
- Validate persistence and event side-effects after each step.
- Include regression cases from historical bugs.
Acceptance Criteria
- Transition graph is documented in test module.
- Illegal transitions consistently return expected errors.
- Tests cover both Up/Down and Precision modes.
Final result should look/feel like
The protocol lifecycle is test-documented as a contract of behavior, making future changes safer and easier to review.
Difficulty
intermediate
Summary
Add state-machine test suite that models legal and illegal transitions across protocol lifecycle actions.
Why this change matters
Round protocols are inherently stateful. State-machine tests prevent accidental transition bugs (e.g., resolve before end, recreate while active, claim semantics drift) and improve confidence during refactors.
Where to work
contracts/src/tests/(new state-machine module)What contributors should implement
Acceptance Criteria
Final result should look/feel like
The protocol lifecycle is test-documented as a contract of behavior, making future changes safer and easier to review.
Difficulty
intermediate