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 faa013c
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,20 @@ 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()
// If inner is Native, we expect inner to use SierraGas.
let expected_inner_resource = if inner_version
== CompilerBasedVersion::CairoVersion(CairoVersion::Native)
{
expected_outer_resource
TrackedResource::SierraGas
} else {
TrackedResource::CairoSteps
// Otherwise, 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
}
};
assert_eq!(execution.inner_calls.first().unwrap().tracked_resource, expected_inner_resource);
}
Expand Down

0 comments on commit faa013c

Please sign in to comment.