Description
A large portion of the contract's test suite is dormant. contracts/predictify-hybrid/src/lib.rs disables many modules via #[cfg(any())] or commented-out mod declarations with the note "disabled - API drift" (for example validation_tests, circuit_breaker_tests, category_tags_tests, query_tests, bet_tests, balance_tests, governance_tests, event_management_tests). Separately, the contracts/predictify-hybrid/src/tests/ subdirectory has its own mod.rs but is never declared in lib.rs, so those suites (common, error_scenarios, integration, security, mocks, dispute_stake_tests) never compile. This issue restores the disabled coverage incrementally.
Requirements and context
contracts/predictify-hybrid/src/lib.rs:68 comments out mod validation_tests; // disabled - API drift; lines ~83, 130, and the block at ~104-138 disable additional suites.
contracts/predictify-hybrid/src/tests/mod.rs exists but there is no mod tests; in lib.rs (only a commented #[path = "tests/dispute_stake_tests.rs"]).
- Each re-enabled module must be brought back into line with current
pub fn signatures in markets.rs, bets.rs, disputes.rs, queries.rs, governance.rs, etc. (the same class of arity/field drift fixed elsewhere).
- Non-functional: re-enable in small, reviewable batches; a module should only be uncommented once it compiles and passes, so
cargo test stays green at each step.
- Track which modules are intentionally obsolete (e.g. superseded by
tests/ equivalents) and delete rather than resurrect duplicates.
Acceptance criteria
Suggested execution
1. Fork the repo and create a branch — git checkout -b feature/reenable-drifted-tests.
2. Implement changes — edit contracts/predictify-hybrid/src/lib.rs module declarations; fix the re-enabled *_tests.rs files and wire contracts/predictify-hybrid/src/tests/.
3. Write/extend tests — update the resurrected modules to the current API; reuse helpers from tests/common.rs and tests/mocks/.
4. Test and commit
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test -p predictify-hybrid
Example commit message
test: re-enable drifted validation/query/bet suites and wire tests/ module
Guidelines
Target the repo's ≥90% coverage standard once suites are restored. Document the re-enablement status in the test module doc-comments and note remaining gaps in TEST_EXECUTION_REPORT.md. Timeframe: 96 hours.
Description
A large portion of the contract's test suite is dormant.
contracts/predictify-hybrid/src/lib.rsdisables many modules via#[cfg(any())]or commented-outmoddeclarations with the note "disabled - API drift" (for examplevalidation_tests,circuit_breaker_tests,category_tags_tests,query_tests,bet_tests,balance_tests,governance_tests,event_management_tests). Separately, thecontracts/predictify-hybrid/src/tests/subdirectory has its ownmod.rsbut is never declared inlib.rs, so those suites (common,error_scenarios,integration,security,mocks,dispute_stake_tests) never compile. This issue restores the disabled coverage incrementally.Requirements and context
contracts/predictify-hybrid/src/lib.rs:68comments outmod validation_tests; // disabled - API drift; lines ~83, 130, and the block at ~104-138 disable additional suites.contracts/predictify-hybrid/src/tests/mod.rsexists but there is nomod tests;inlib.rs(only a commented#[path = "tests/dispute_stake_tests.rs"]).pub fnsignatures inmarkets.rs,bets.rs,disputes.rs,queries.rs,governance.rs, etc. (the same class of arity/field drift fixed elsewhere).cargo teststays green at each step.tests/equivalents) and delete rather than resurrect duplicates.Acceptance criteria
validation_tests,query_tests, andbet_testsmodules are re-enabled and passing (or formally removed with justification if superseded).tests/subdirectory is wired in viamod tests;(gated by#[cfg(test)]) or its modules are individually declared, and they compile.#[cfg(any())]without an inline comment explaining why it stays disabled.cargo test -p predictify-hybridruns the newly enabled suites and reports them in the summary.cargo fmt,cargo clippy, andcargo testpass.Suggested execution
1. Fork the repo and create a branch —
git checkout -b feature/reenable-drifted-tests.2. Implement changes — edit
contracts/predictify-hybrid/src/lib.rsmodule declarations; fix the re-enabled*_tests.rsfiles and wirecontracts/predictify-hybrid/src/tests/.3. Write/extend tests — update the resurrected modules to the current API; reuse helpers from
tests/common.rsandtests/mocks/.4. Test and commit
cargo fmt --all -- --check cargo clippy --all-targets --all-features -- -D warnings cargo test -p predictify-hybridExample commit message
Guidelines
Target the repo's ≥90% coverage standard once suites are restored. Document the re-enablement status in the test module doc-comments and note remaining gaps in
TEST_EXECUTION_REPORT.md. Timeframe: 96 hours.