Skip to content

Commit

Permalink
fix: expectations for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PearsonWhite committed Oct 30, 2024
1 parent 2bac70d commit f4a0399
Showing 1 changed file with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,26 @@ fn test_tracked_resources_fn(
let expected_outer_resource = outer_version.own_tracked_resource();
assert_eq!(execution.tracked_resource, expected_outer_resource);

let expected_inner_resource = if expected_outer_resource == inner_version.own_tracked_resource()
{
expected_outer_resource
} else {
TrackedResource::CairoSteps
};
// For native, this logic will be modified below.
let expected_inner_resource =
// If outer and inner are the same, we expect the tracked resource to be the same.
if expected_outer_resource == inner_version.own_tracked_resource() {
expected_outer_resource
} else {
// If outer and inner are not the same, and inner is not Native, we expect CairoSteps.
TrackedResource::CairoSteps
};

#[cfg(feature = "cairo_native")]
// If inner is Native, we expect inner to use SierraGas.
// This overrides previous logic.
let expected_inner_resource =
if inner_version == CompilerBasedVersion::CairoVersion(CairoVersion::Native) {
TrackedResource::SierraGas
} else {
expected_inner_resource
};

assert_eq!(execution.inner_calls.first().unwrap().tracked_resource, expected_inner_resource);
}

Expand Down

0 comments on commit f4a0399

Please sign in to comment.