Description
err.rs defines many error variants whose numeric codes are part of the client-facing API. Add a snapshot test that asserts a frozen mapping of variant name to numeric code so accidental reordering or insertion in the middle of the enum causes the CI to fail loudly.
Requirements and Context
- Snapshot table in a test file
- Adding a new variant requires explicitly extending the table
- Removing a variant fails the test
- Must be secure, tested, and documented
- Should be efficient and easy to review
Suggested Execution
- Fork the repo and create a branch
git checkout -b task/err-code-stability-snapshot
- Implement changes
contracts/predictify-hybrid/src/tests/err_code_stability_tests.rs
- Test and commit
cargo test -p predictify-hybrid err_code_stability
- Cover edge cases
- Include test output and notes in the PR
Example commit message
test: freeze err.rs error-code snapshot for client stability
Acceptance Criteria
Guidelines
- NatSpec-style
/// doc comments where relevant
- Clear documentation and inline comments
- Timeframe: 96 hours
Description
err.rsdefines many error variants whose numeric codes are part of the client-facing API. Add a snapshot test that asserts a frozen mapping of variant name to numeric code so accidental reordering or insertion in the middle of the enum causes the CI to fail loudly.Requirements and Context
Suggested Execution
contracts/predictify-hybrid/src/tests/err_code_stability_tests.rscargo test -p predictify-hybrid err_code_stabilityExample commit message
Acceptance Criteria
Errorvariants are in the snapshotGuidelines
///doc comments where relevant