Skip to content

test(resolution): gas_snap.rs fails to compile - missing predictify-hybrid dev-dependency #1231

Description

@ogunjobielijah09-cyber

Bug

contracts/resolution/tests/gas_snap.rs imports from predictify_hybrid but contracts/resolution/Cargo.toml does not declare it as a dev-dependency.

error[E0433]: cannot find module or crate `predictify_hybrid` in this scope
  --> contracts/resolution/tests/gas_snap.rs:40:5
   |
40 | use predictify_hybrid::types::{OracleConfig, OracleProvider};
   |     ^^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `predictify_hybrid`

error[E0432]: unresolved import `predictify_hybrid`
  --> contracts/resolution/tests/gas_snap.rs:39:5
   |
39 | use predictify_hybrid::{PredictifyHybrid, PredictifyHybridClient};
   |     ^^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `predictify_hybrid`

Impact

cargo test -p resolution fails to compile any test in the resolution crate, including the pre-existing error_tests.rs and the recently added err_stab.rs (issue #933). The gas_snap.rs file is currently unrunnable in CI.

Root cause

gas_snap.rs was introduced by PR #1143 ("Add contract-error enum expansion for resolution") to snapshot the resolution entrypoint CPU/memory budgets. It exercises the entrypoints via PredictifyHybrid clients, but predictify-hybrid was never added as a dev-dependency of the resolution crate.

Suggested fix

Add to contracts/resolution/Cargo.toml under [dev-dependencies]:

predictify-hybrid = { path = "../predictify-hybrid" }

Plus an explicit [[test]] registration for gas_snap so cargo discovers it explicitly:

[[test]]
name = "gas_snap"
path = "tests/gas_snap.rs"

Acceptance criteria

  • cargo test -p resolution compiles and runs all test targets (error_tests, err_stab, gas_snap).
  • CI green.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions